@conduction/nextcloud-vue 2.104.0 → 2.105.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 (110) hide show
  1. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue.js +1 -1
  2. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue2.js.map +1 -1
  3. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js +1 -1
  4. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js.map +1 -1
  5. package/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
  6. package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js +93 -1
  7. package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js.map +1 -1
  8. package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js.map +1 -1
  9. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
  10. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +6 -3
  11. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  12. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +3 -3
  13. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  14. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +59 -1
  15. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  16. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  17. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue.js +1 -1
  18. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue2.js +1 -1
  19. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue2.js.map +1 -1
  20. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue3.js.map +1 -1
  21. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue.js +1 -1
  22. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue2.js +2 -0
  23. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue2.js.map +1 -1
  24. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue3.js +32 -29
  25. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue3.js.map +1 -1
  26. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
  27. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +73 -4
  28. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
  29. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +74 -27
  30. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
  31. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +54 -1
  32. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  33. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  34. package/dist/esm/components/CnIndexPage/useSelfFetchList.js +3 -2
  35. package/dist/esm/components/CnIndexPage/useSelfFetchList.js.map +1 -1
  36. package/dist/esm/components/CnNoticeWidget/CnNoticeWidget.vue.js +9 -0
  37. package/dist/esm/components/CnNoticeWidget/CnNoticeWidget.vue.js.map +1 -0
  38. package/dist/esm/components/CnNoticeWidget/CnNoticeWidget.vue2.js +88 -0
  39. package/dist/esm/components/CnNoticeWidget/CnNoticeWidget.vue2.js.map +1 -0
  40. package/dist/esm/components/CnNoticeWidget/CnNoticeWidget.vue3.js +39 -0
  41. package/dist/esm/components/CnNoticeWidget/CnNoticeWidget.vue3.js.map +1 -0
  42. package/dist/esm/components/CnSettingsField/CnSettingsField.vue.js +1 -1
  43. package/dist/esm/components/CnSettingsField/CnSettingsField.vue2.js.map +1 -1
  44. package/dist/esm/components/CnSettingsField/CnSettingsField.vue3.js +3 -3
  45. package/dist/esm/components/CnSettingsField/CnSettingsField.vue3.js.map +1 -1
  46. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue.js +1 -1
  47. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue2.js.map +1 -1
  48. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue3.js +16 -4
  49. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue3.js.map +1 -1
  50. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue.js +1 -1
  51. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue2.js +11 -0
  52. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue2.js.map +1 -1
  53. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue3.js +4 -4
  54. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue3.js.map +1 -1
  55. package/dist/esm/components/CnWidgetGrid/builtInWidgets.js +16 -14
  56. package/dist/esm/components/CnWidgetGrid/builtInWidgets.js.map +1 -1
  57. package/dist/esm/index.js +1 -0
  58. package/dist/esm/index.js.map +1 -1
  59. package/dist/esm/l10n/en.json.js +4 -1
  60. package/dist/esm/l10n/en.json.js.map +1 -1
  61. package/dist/esm/l10n/nl.json.js +4 -1
  62. package/dist/esm/l10n/nl.json.js.map +1 -1
  63. package/dist/esm/library-style.js +1 -1
  64. package/dist/esm/nextcloud-vue.css +566 -295
  65. package/dist/esm/utils/libraryWidgetKeys.js +1 -0
  66. package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
  67. package/dist/esm/utils/nextcloudApps.js +45 -0
  68. package/dist/esm/utils/nextcloudApps.js.map +1 -0
  69. package/dist/esm/utils/scopeListLayout.js +9 -2
  70. package/dist/esm/utils/scopeListLayout.js.map +1 -1
  71. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  72. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  73. package/dist/esm/utils/visibleWhen.js +12 -4
  74. package/dist/esm/utils/visibleWhen.js.map +1 -1
  75. package/dist/nextcloud-vue.cjs.js +3054 -2517
  76. package/dist/nextcloud-vue.cjs.js.map +2 -2
  77. package/dist/nextcloud-vue.css +566 -295
  78. package/l10n/en.json +4 -1
  79. package/l10n/nl.json +4 -1
  80. package/package.json +1 -1
  81. package/src/components/CnAdminSettingsShell/CnAdminSettingsShell.vue +1 -1
  82. package/src/components/CnChartWidget/CnChartWidget.md +2 -0
  83. package/src/components/CnChartWidget/CnChartWidget.vue +93 -1
  84. package/src/components/CnDashboardPage/CnDashboardPage.vue +9 -6
  85. package/src/components/CnDetailPage/CnDetailPage.md +1 -0
  86. package/src/components/CnDetailPage/CnDetailPage.vue +59 -1
  87. package/src/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue +1 -1
  88. package/src/components/CnFeaturesBoard/CnFeaturesBoard.vue +4 -1
  89. package/src/components/CnFlowsPage/CnFlowBoard.vue +132 -8
  90. package/src/components/CnIndexPage/CnIndexPage.md +1 -0
  91. package/src/components/CnIndexPage/CnIndexPage.vue +54 -1
  92. package/src/components/CnIndexPage/useSelfFetchList.js +3 -2
  93. package/src/components/CnNoticeWidget/CnNoticeWidget.vue +153 -0
  94. package/src/components/CnNoticeWidget/index.js +12 -0
  95. package/src/components/CnSettingsField/CnSettingsField.vue +4 -1
  96. package/src/components/CnSetupWizard/CnSetupWizard.vue +9 -1
  97. package/src/components/CnVersionInfoCard/CnVersionInfoCard.vue +15 -4
  98. package/src/components/CnWidgetGrid/builtInWidgets.js +2 -0
  99. package/src/components/index.js +1 -0
  100. package/src/css/dialog.css +20 -2
  101. package/src/css/look-board-detail.css +77 -4
  102. package/src/css/look-board-index.css +36 -2
  103. package/src/css/look-board.css +97 -12
  104. package/src/index.js +1 -0
  105. package/src/schemas/app-manifest-v2.schema.json +36 -3
  106. package/src/utils/libraryWidgetKeys.js +1 -0
  107. package/src/utils/nextcloudApps.js +50 -0
  108. package/src/utils/scopeListLayout.js +9 -2
  109. package/src/utils/validateManifestV2.compiled.js +3 -3
  110. package/src/utils/visibleWhen.js +12 -4
@@ -168,7 +168,8 @@ function useSelfFetchList(props, instance, inject, extras = {}) {
168
168
  const objCtx = unwrapCtx(objectCtxRaw);
169
169
  const base = (objCtx && typeof objCtx === 'object') ? { ...objCtx } : {};
170
170
  base.workspace = unwrapCtx(workspaceCtxRaw) || {};
171
- base.config = unwrapCtx(appConfigRaw) || {};
171
+ // The page's own `appConfig` prop wins over a config an ancestor provides.
172
+ base.config = { ...(unwrapCtx(appConfigRaw) || {}), ...(props.appConfig || {}) };
172
173
  return base
173
174
  }
174
175
 
@@ -180,7 +181,7 @@ function useSelfFetchList(props, instance, inject, extras = {}) {
180
181
  // never again. Stringified (like CnDeltaWidget's `sourceKey`) so the
181
182
  // watcher fires on real content changes only, not object identity.
182
183
  const workspaceSignature = computed(() => JSON.stringify(unwrapCtx(workspaceCtxRaw) || {}));
183
- const appConfigSignature = computed(() => JSON.stringify(unwrapCtx(appConfigRaw) || {}));
184
+ const appConfigSignature = computed(() => JSON.stringify({ ...(unwrapCtx(appConfigRaw) || {}), ...(props.appConfig || {}) }));
184
185
 
185
186
  // Pass register/schema in their positional id slots (not as a {register, schema} object as
186
187
  // second arg) — that previously made fetch URLs go to `/api/objects/undefined/[object Object]`.
@@ -1 +1 @@
1
- {"version":3,"file":"useSelfFetchList.js","sources":["../../../../src/components/CnIndexPage/useSelfFetchList.js"],"sourcesContent":["import { computed, ref, watch } from 'vue'\nimport { useListView } from '../../composables/index.js'\nimport { useObjectSubscription } from '../../composables/useObjectSubscription.js'\nimport { useObjectStore } from '../../store/index.js'\n// Both filter resolvers live in `utils/routeFilters.js` so CnLogsPage applies\n// the same two grammars (route-param interpolation + `?key=value` deep links)\n// without pulling in this composable's index-only sidebar/subscription wiring.\nimport { withPersonalLenses } from '../../utils/personalLenses.js'\nimport { parseSortKeysFromQuery, resolveFilterMap, resolveQueryFilters } from '../../utils/routeFilters.js'\nimport { orderToSortKeys } from '../../utils/sortOrder.js'\n\nfunction resolveInitialQuickFilterIndex(quickFilters) {\n\tconst tabs = Array.isArray(quickFilters) ? quickFilters : null\n\tif (!tabs || tabs.length === 0) {\n\t\treturn null\n\t}\n\tconst di = tabs.findIndex((t) => t && t.default === true)\n\treturn di >= 0 ? di : 0\n}\n\n/**\n * OR-merge several quick-filter maps into one fetch filter. Values for the\n * same key collapse to an array (deduped) when more than one tab contributes\n * it — `buildQueryString` serialises an array as `key[]=a&key[]=b`, which the\n * OpenRegister API interprets as an IN / OR match.\n *\n * @param {Array<object>} filterMaps Already route-resolved filter maps.\n * @return {object} The merged filter (scalar when a key has one value, array when many).\n */\n/**\n * Rows one board fetch asks for. A board shows every matching row at once,\n * so it loads far more than a table page (OpenRegister serves up to 1000);\n * past this the board offers \"Load more\".\n *\n * @type {number}\n */\nexport const BOARD_PAGE_SIZE = 500\n\n/**\n * The sort a quick filter sets while it is active (`sort: { key, order }`, or a\n * list of those for a multi-column order), as sort keys, or null when it sets\n * none.\n *\n * @param {object|undefined} tab A quick filter.\n * @return {Array<{key: string, order: string}>|null} The sort keys.\n * @spec openspec/changes/screens-quick-filter-sort/specs/index-page/spec.md\n */\nexport function quickFilterSortKeys(tab) {\n\tconst sort = tab && tab.sort\n\tif (!sort) {\n\t\treturn null\n\t}\n\tconst keys = (Array.isArray(sort) ? sort : [sort])\n\t\t.filter((entry) => entry && typeof entry.key === 'string' && entry.key !== '')\n\t\t.map((entry) => ({ key: entry.key, order: entry.order === 'desc' ? 'desc' : 'asc' }))\n\treturn keys.length > 0 ? keys : null\n}\n\nfunction unionFilterMaps(filterMaps) {\n\tconst grouped = {}\n\tfor (const map of filterMaps) {\n\t\tif (!map || typeof map !== 'object') {\n\t\t\tcontinue\n\t\t}\n\t\tfor (const [k, v] of Object.entries(map)) {\n\t\t\tif (v === undefined || v === null || v === '') {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (!grouped[k]) {\n\t\t\t\tgrouped[k] = []\n\t\t\t}\n\t\t\tfor (const item of (Array.isArray(v) ? v : [v])) {\n\t\t\t\tif (!grouped[k].includes(item)) {\n\t\t\t\t\tgrouped[k].push(item)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tconst out = {}\n\tfor (const [k, arr] of Object.entries(grouped)) {\n\t\tout[k] = arr.length === 1 ? arr[0] : arr\n\t}\n\treturn out\n}\n\n/**\n * Self-fetch mode for CnIndexPage: when register+schema are set but no\n * `objects` prop was passed (manifest-driven pages), drive the list ourselves.\n *\n * @param {object} props CnIndexPage props.\n * @param {import('vue').ComponentInternalInstance|null} instance Pass `getCurrentInstance()`.\n * @param {typeof import('vue').inject} inject Pass Vue's `inject`.\n * @param {{activeFolderSchema?: import('vue').Ref<?{schema: string, register?: string}>}} [extras] `activeFolderSchema`: a ref the page sets to the selected folder's `{ schema, register? }`, switching the loaded object type while it is non-null.\n * @return {object} { isSelfFetch, list, selfObjectStore, selfObjectType, activeQuickFilterIndex }\n */\nexport function useSelfFetchList(props, instance, inject, extras = {}) {\n\tconst objectsProvided = !!(\n\t\tinstance && instance.proxy && instance.proxy.$options && instance.proxy.$options.propsData\n\t\t&& Object.hasOwn(instance.proxy.$options.propsData, 'objects')\n\t)\n\t// A named source wins over register/schema. Without this the page would\n\t// fire an OpenRegister request whose rows it then discards in favour of the\n\t// source's — wasted, but worse than wasted if the manifest names both by\n\t// mistake, because the request succeeds and nothing says the two disagree.\n\tconst isSelfFetch = !!(props.register && props.schema) && !objectsProvided && !props.entitySource\n\n\t// \"Also search inside files\" switch, seeded from `?contentSearch=1` so a\n\t// shared link reproduces the list. Only meaningful when `searchInFiles` is on.\n\tconst routeAtSetup = instance && instance.proxy && instance.proxy.$route\n\tconst contentSearch = ref(props.searchInFiles === true && String(routeAtSetup?.query?.contentSearch) === '1')\n\n\tconst activeQuickFilterIndex = ref(resolveInitialQuickFilterIndex(withPersonalLenses(props.quickFilters, props.personalLenses)))\n\tconst selectedQuickFilterIndices = ref([])\n\tconst isMultiQuickFilter = props.quickFilterMultiple === true\n\n\tif (!isSelfFetch) {\n\t\treturn {\n\t\t\tisSelfFetch: false,\n\t\t\tlist: null,\n\t\t\tselfObjectStore: null,\n\t\t\tselfObjectType: '',\n\t\t\tactiveQuickFilterIndex,\n\t\t\tselectedQuickFilterIndices,\n\t\t\tcontentSearch,\n\t\t\tselfFetchTokenCtx: null,\n\t\t\tinitialQueryFilterKeys: [],\n\t\t}\n\t}\n\n\t// The object type follows the selected folder's own schema when it declares\n\t// one; otherwise the page's register and schema.\n\tconst activeFolderSchema = extras.activeFolderSchema || null\n\tconst resolvedTarget = computed(() => {\n\t\tconst folder = activeFolderSchema && activeFolderSchema.value\n\t\tif (folder && folder.schema) {\n\t\t\tconst register = folder.register || props.register\n\t\t\treturn { register, schema: folder.schema, type: `${register}-${folder.schema}` }\n\t\t}\n\t\t// A collection endpoint gets its own type key, so a plain registration of\n\t\t// the same pair elsewhere never resets it.\n\t\tconst collectionUrl = props.collectionUrl || ''\n\t\tconst type = `${props.register}-${props.schema}` + (collectionUrl ? `@${collectionUrl}` : '')\n\t\treturn { register: props.register, schema: props.schema, type, collectionUrl }\n\t})\n\tconst objectType = computed(() => resolvedTarget.value.type)\n\tconst sidebarState = inject('sidebarState', null) ?? inject('objectSidebarState', null)\n\tconst objectStore = useObjectStore()\n\n\t// Token-resolution context for `@workspace.<key>` / `@config.<key>` /\n\t// `@objectId` / `@object.<field>` inside `props.filter` / quick-filter\n\t// tab filters. Same injects + unwrap shape as CnObjectListWidget's\n\t// `objectCtx`/`workspaceCtx`/`tokenCtx` computeds (and CnDeltaWidget) —\n\t// `cnWorkspaceContext` is the reactive bag a dashboard/workspace-root\n\t// (e.g. hrmq's App.vue for multi-administratie) provides; `cnObjectContext`\n\t// is a detail-page's object context (rare on an index page, but harmless\n\t// to support); `cnAppConfig` is the page-level app config bag. All three\n\t// default to null/absent so an app that never provides them is unaffected.\n\tconst objectCtxRaw = inject('cnObjectContext', null)\n\tconst workspaceCtxRaw = inject('cnWorkspaceContext', null)\n\tconst appConfigRaw = inject('cnAppConfig', null)\n\tconst unwrapCtx = (v) => ((v && typeof v === 'object' && 'value' in v) ? v.value : v)\n\n\t/**\n\t * Build the current token-resolution ctx `{ objectId?, object?, workspace, config }`\n\t * from the injected bags, unwrapping Vue refs. Called fresh on every fetch\n\t * so it always reflects the latest workspace/config state.\n\t *\n\t * @return {object} The token ctx.\n\t */\n\tfunction tokenCtx() {\n\t\tconst objCtx = unwrapCtx(objectCtxRaw)\n\t\tconst base = (objCtx && typeof objCtx === 'object') ? { ...objCtx } : {}\n\t\tbase.workspace = unwrapCtx(workspaceCtxRaw) || {}\n\t\tbase.config = unwrapCtx(appConfigRaw) || {}\n\t\treturn base\n\t}\n\n\t// Reactive signature of the workspace/config bags so a change (e.g. the\n\t// administration switcher writing `activeAdministrationId`) triggers a\n\t// re-fetch below — `fixedFilters` is a plain getter called at fetch time\n\t// (see useListView.resolveFixedFilters), it is NOT auto-tracked by Vue,\n\t// so without this the list would resolve the token once on mount and\n\t// never again. Stringified (like CnDeltaWidget's `sourceKey`) so the\n\t// watcher fires on real content changes only, not object identity.\n\tconst workspaceSignature = computed(() => JSON.stringify(unwrapCtx(workspaceCtxRaw) || {}))\n\tconst appConfigSignature = computed(() => JSON.stringify(unwrapCtx(appConfigRaw) || {}))\n\n\t// Pass register/schema in their positional id slots (not as a {register, schema} object as\n\t// second arg) — that previously made fetch URLs go to `/api/objects/undefined/[object Object]`.\n\t// Runs (sync, ahead of the list's own watcher) again whenever the type switches.\n\tfunction registerTarget() {\n\t\tconst { register, schema, type, collectionUrl } = resolvedTarget.value\n\t\tif (typeof objectStore.registerObjectType === 'function') {\n\t\t\tobjectStore.registerObjectType(type, schema, register, {\n\t\t\t\tregisterSlug: register,\n\t\t\t\tschemaSlug: schema,\n\t\t\t\t...(collectionUrl ? { collectionUrl } : {}),\n\t\t\t})\n\t\t}\n\t\t// A mixed list tells its own rows apart by `@self.register`, an id, so a slug register needs resolving.\n\t\tif (collectionUrl && !/^\\d+$/.test(String(register)) && typeof objectStore.fetchRegister === 'function') {\n\t\t\tobjectStore.fetchRegister(type)\n\t\t}\n\t}\n\tregisterTarget()\n\twatch(objectType, registerTarget, { flush: 'sync' })\n\n\t// Seed the visible-column set from the configured columns so the sidebar's\n\t// Columns tab reflects the curated default; null when none are configured\n\t// (schema-driven table — every column starts visible).\n\t// A column marked `hidden: true` is declared but starts outside the set,\n\t// so it is off until the person turns it on in the Columns tab.\n\tconst configuredColumnKeys = (props.columns || [])\n\t\t.filter((c) => !(c && typeof c === 'object' && c.hidden === true))\n\t\t.map((c) => (typeof c === 'string' ? c : c && c.key))\n\t\t.filter(Boolean)\n\n\t// Restore a persisted multi-column sort from the route query first (deep\n\t// link / reload); fall back to a host-passed `sortKeys` prop, then the\n\t// legacy single-key `sortKey`/`sortOrder` props.\n\tconst initialRoute = instance && instance.proxy && instance.proxy.$route\n\t// The page's own order, which a lens without a `sort` goes back to.\n\t// `defaultOrder` (manifest `config.defaultOrder`) is the order of last\n\t// resort, after `sortKeys` and `sortKey`.\n\tconst defaultOrderKeys = orderToSortKeys(props.defaultOrder)\n\tconst pageSortKeys = (Array.isArray(props.sortKeys) && props.sortKeys.length > 0)\n\t\t? props.sortKeys\n\t\t: (props.sortKey ? [{ key: props.sortKey, order: props.sortOrder || 'asc' }] : defaultOrderKeys)\n\t// The lens that is active on mount may set its own order.\n\tconst initialTabs = withPersonalLenses(props.quickFilters, props.personalLenses)\n\tconst initialTabSort = (!isMultiQuickFilter && Array.isArray(initialTabs))\n\t\t? quickFilterSortKeys(initialTabs[activeQuickFilterIndex.value])\n\t\t: null\n\tconst initialSortKeys = parseSortKeysFromQuery(initialRoute)\n\t\t|| initialTabSort\n\t\t|| (Array.isArray(props.sortKeys) && props.sortKeys.length > 0 ? props.sortKeys : undefined)\n\t\t|| (!props.sortKey && defaultOrderKeys.length > 0 ? defaultOrderKeys : undefined)\n\t// Same deep-link restore for facet filters and search, so opening a\n\t// shared/bookmarked URL reproduces the same view (CnIndexPage persists\n\t// both back to the route on change).\n\tconst initialActiveFilters = resolveQueryFilters(initialRoute && initialRoute.query, tokenCtx())\n\tconst initialSearchTerm = (initialRoute && typeof initialRoute.query?._search === 'string') ? initialRoute.query._search : ''\n\n\t// Set right after useListView returns; the fixed-filters getter reads it lazily.\n\tlet listHandle = null\n\tconst list = useListView(() => objectType.value, {\n\t\tobjectStore,\n\t\tsidebarState,\n\t\tdefaultSort: props.sortKey ? { key: props.sortKey, order: props.sortOrder || 'asc' } : undefined,\n\t\tdefaultSortKeys: initialSortKeys,\n\t\tdefaultActiveFilters: initialActiveFilters,\n\t\tdefaultSearchTerm: initialSearchTerm,\n\t\tdefaultPageSize: props.viewMode === 'board' ? BOARD_PAGE_SIZE : ((props.pagination && props.pagination.limit) || undefined),\n\t\tdefaultVisibleColumns: configuredColumnKeys.length ? configuredColumnKeys : null,\n\t\t// `pages[].config.extend` → OpenRegister's repeated `_extend[]`. A\n\t\t// getter so a reactive change re-scopes the next fetch, matching how\n\t\t// `fixedFilters` is read.\n\t\textend: () => (Array.isArray(props.extend) ? props.extend : []),\n\t\tfixedFilters: () => {\n\t\t\tconst route = instance && instance.proxy && instance.proxy.$route\n\t\t\tconst params = (route && route.params) || {}\n\t\t\tconst ctx = tokenCtx()\n\t\t\tconst queryFilters = resolveQueryFilters(route && route.query, ctx)\n\t\t\tconst base = resolveFilterMap(props.filter, params, ctx)\n\t\t\t// A folder-sidebar scope declaring `searchFields` narrows what the\n\t\t\t// search box searches over while that scope is active. Read off the\n\t\t\t// instance, like `$route` above, because the active scope is the\n\t\t\t// component's own state rather than a prop — and read through the\n\t\t\t// one fixed-filter getter rather than a second search path.\n\t\t\tconst scopeSearchFields = (instance && instance.proxy && instance.proxy.activeScopeSearchFields) || []\n\t\t\tconst scopeBase = scopeSearchFields.length > 0 ? { _searchFields: scopeSearchFields } : {}\n\t\t\t// File-content search widens a text search, so it rides only with a term.\n\t\t\tconst widen = props.searchInFiles === true && contentSearch.value && !!(listHandle && listHandle.searchTerm.value)\n\t\t\t// The visible calendar month, only while the page is in calendar mode.\n\t\t\tconst month = (instance && instance.proxy && instance.proxy.calendarRangeFilter) || {}\n\t\t\tconst scope = { ...(widen ? { ...scopeBase, _content_search: 'true' } : scopeBase), ...month }\n\t\t\tconst lensed = withPersonalLenses(props.quickFilters, props.personalLenses)\n\t\t\tconst tabs = Array.isArray(lensed) ? lensed : null\n\t\t\tif (!tabs) {\n\t\t\t\treturn { ...queryFilters, ...scope, ...base }\n\t\t\t}\n\n\t\t\t// Multiple mode: OR the selected tabs' filters together (union).\n\t\t\tif (isMultiQuickFilter) {\n\t\t\t\tconst maps = selectedQuickFilterIndices.value\n\t\t\t\t\t.map((i) => resolveFilterMap(tabs[i]?.filter, params, ctx))\n\t\t\t\treturn { ...queryFilters, ...scope, ...base, ...unionFilterMaps(maps) }\n\t\t\t}\n\n\t\t\t// Single mode: the active tab's filter spread last so it wins\n\t\t\t// over a colliding props.filter entry.\n\t\t\tconst activeIdx = activeQuickFilterIndex.value\n\t\t\tconst tabFilter = (activeIdx !== null && activeIdx !== undefined) ? tabs[activeIdx]?.filter : null\n\t\t\treturn { ...queryFilters, ...scope, ...base, ...resolveFilterMap(tabFilter, params, ctx) }\n\t\t},\n\t})\n\n\tlistHandle = list\n\n\t// Re-fetch when the quick-filter selection changes (pre-existing), OR\n\t// when the workspace/app-config bag content changes (e.g. the\n\t// administration switcher writes a new `activeAdministrationId`) — a\n\t// `@workspace.<key>`/`@config.<key>` token in `props.filter` must re-scope\n\t// the list without a manual reload. A change to `props.filter` itself (a\n\t// host toggling a filter checkbox) re-fetches the same way.\n\tconst filterSignature = computed(() => JSON.stringify(props.filter ?? null))\n\twatch([activeQuickFilterIndex, selectedQuickFilterIndices, contentSearch, workspaceSignature, appConfigSignature, filterSignature], (now, before) => {\n\t\t// Switching lens: a lens with a `sort` sets that order; leaving one\n\t\t// for a lens without goes back to the page's own order. A column the\n\t\t// person sorts by afterwards still wins until the next switch.\n\t\tif (!isMultiQuickFilter && before && now[0] !== before[0]) {\n\t\t\tconst tabs = withPersonalLenses(props.quickFilters, props.personalLenses) || []\n\t\t\tconst keys = quickFilterSortKeys(tabs[now[0]]) || (quickFilterSortKeys(tabs[before[0]]) ? pageSortKeys : null)\n\t\t\tif (keys && list.sortKeys) {\n\t\t\t\tlist.sortKeys.value = keys\n\t\t\t\tlist.sortKey.value = keys[0]?.key ?? null\n\t\t\t\tlist.sortOrder.value = keys[0]?.order ?? 'asc'\n\t\t\t}\n\t\t}\n\t\tif (list && typeof list.refresh === 'function') {\n\t\t\tlist.refresh(1)\n\t\t}\n\t})\n\n\t// Live collection updates (manifest-live-updates): subscribe to the\n\t// page's `or-collection-{register}-{schema}` scope so another user's\n\t// create/update/delete refreshes this list without a manual reload.\n\t// The subscription lifecycle (mount/unmount, in-flight dedupe, epoch\n\t// guard against stale async resolution) lives in useObjectSubscription;\n\t// the refetch-on-event (with the last fetch params, burst-coalesced)\n\t// lives in liveUpdatesPlugin. The `subscribe` prop (default true; from\n\t// a manifest: `config.subscribe: false`) is the opt-out, read through\n\t// a reactive getter so a runtime flip attaches/detaches accordingly.\n\t// Stores without live-updates support (no `subscribe` action) are a\n\t// silent no-op inside the composable, keeping this fully inert.\n\tuseObjectSubscription(objectStore, () => objectType.value, null, {\n\t\tenabled: () => props.subscribe !== false,\n\t})\n\n\treturn {\n\t\tisSelfFetch: true,\n\t\tlist,\n\t\tselfObjectStore: objectStore,\n\t\tselfObjectType: objectType,\n\t\tactiveQuickFilterIndex,\n\t\tselectedQuickFilterIndices,\n\t\tcontentSearch,\n\t\t// The page persists the view state back into the query, and needs both\n\t\t// to do it without trampling the rest of it: the keys it adopted from\n\t\t// the query on load (the only non-`_` ones it may clear), and the ctx\n\t\t// those keys' `@`-tokens resolve against.\n\t\tselfFetchTokenCtx: tokenCtx,\n\t\tinitialQueryFilterKeys: Object.keys(initialActiveFilters),\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAWA,SAAS,8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IAAI,EAAC;AACjH,GAAG,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;AAC9B,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,KAAI;AAC9B,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,KAAI;AAC7C,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,MAAK;AAClD,IAAI;AACJ,GAAG;AACH,EAAE,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE;AAClD,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAC;AAClB,GAAG;AACH,EAAE,EAAC;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,qBAAqB,CAAC,WAAW,EAAE,MAAM,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE;AAClE,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC,SAAS,KAAK,KAAK;AAC1C,EAAE,EAAC;AACH;AACA,CAAC,OAAO;AACR,EAAE,WAAW,EAAE,IAAI;AACnB,EAAE,IAAI;AACN,EAAE,eAAe,EAAE,WAAW;AAC9B,EAAE,cAAc,EAAE,UAAU;AAC5B,EAAE,sBAAsB;AACxB,EAAE,0BAA0B;AAC5B,EAAE,aAAa;AACf;AACA;AACA;AACA;AACA,EAAE,iBAAiB,EAAE,QAAQ;AAC7B,EAAE,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC;AAC3D,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"useSelfFetchList.js","sources":["../../../../src/components/CnIndexPage/useSelfFetchList.js"],"sourcesContent":["import { computed, ref, watch } from 'vue'\nimport { useListView } from '../../composables/index.js'\nimport { useObjectSubscription } from '../../composables/useObjectSubscription.js'\nimport { useObjectStore } from '../../store/index.js'\n// Both filter resolvers live in `utils/routeFilters.js` so CnLogsPage applies\n// the same two grammars (route-param interpolation + `?key=value` deep links)\n// without pulling in this composable's index-only sidebar/subscription wiring.\nimport { withPersonalLenses } from '../../utils/personalLenses.js'\nimport { parseSortKeysFromQuery, resolveFilterMap, resolveQueryFilters } from '../../utils/routeFilters.js'\nimport { orderToSortKeys } from '../../utils/sortOrder.js'\n\nfunction resolveInitialQuickFilterIndex(quickFilters) {\n\tconst tabs = Array.isArray(quickFilters) ? quickFilters : null\n\tif (!tabs || tabs.length === 0) {\n\t\treturn null\n\t}\n\tconst di = tabs.findIndex((t) => t && t.default === true)\n\treturn di >= 0 ? di : 0\n}\n\n/**\n * OR-merge several quick-filter maps into one fetch filter. Values for the\n * same key collapse to an array (deduped) when more than one tab contributes\n * it — `buildQueryString` serialises an array as `key[]=a&key[]=b`, which the\n * OpenRegister API interprets as an IN / OR match.\n *\n * @param {Array<object>} filterMaps Already route-resolved filter maps.\n * @return {object} The merged filter (scalar when a key has one value, array when many).\n */\n/**\n * Rows one board fetch asks for. A board shows every matching row at once,\n * so it loads far more than a table page (OpenRegister serves up to 1000);\n * past this the board offers \"Load more\".\n *\n * @type {number}\n */\nexport const BOARD_PAGE_SIZE = 500\n\n/**\n * The sort a quick filter sets while it is active (`sort: { key, order }`, or a\n * list of those for a multi-column order), as sort keys, or null when it sets\n * none.\n *\n * @param {object|undefined} tab A quick filter.\n * @return {Array<{key: string, order: string}>|null} The sort keys.\n * @spec openspec/changes/screens-quick-filter-sort/specs/index-page/spec.md\n */\nexport function quickFilterSortKeys(tab) {\n\tconst sort = tab && tab.sort\n\tif (!sort) {\n\t\treturn null\n\t}\n\tconst keys = (Array.isArray(sort) ? sort : [sort])\n\t\t.filter((entry) => entry && typeof entry.key === 'string' && entry.key !== '')\n\t\t.map((entry) => ({ key: entry.key, order: entry.order === 'desc' ? 'desc' : 'asc' }))\n\treturn keys.length > 0 ? keys : null\n}\n\nfunction unionFilterMaps(filterMaps) {\n\tconst grouped = {}\n\tfor (const map of filterMaps) {\n\t\tif (!map || typeof map !== 'object') {\n\t\t\tcontinue\n\t\t}\n\t\tfor (const [k, v] of Object.entries(map)) {\n\t\t\tif (v === undefined || v === null || v === '') {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (!grouped[k]) {\n\t\t\t\tgrouped[k] = []\n\t\t\t}\n\t\t\tfor (const item of (Array.isArray(v) ? v : [v])) {\n\t\t\t\tif (!grouped[k].includes(item)) {\n\t\t\t\t\tgrouped[k].push(item)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tconst out = {}\n\tfor (const [k, arr] of Object.entries(grouped)) {\n\t\tout[k] = arr.length === 1 ? arr[0] : arr\n\t}\n\treturn out\n}\n\n/**\n * Self-fetch mode for CnIndexPage: when register+schema are set but no\n * `objects` prop was passed (manifest-driven pages), drive the list ourselves.\n *\n * @param {object} props CnIndexPage props.\n * @param {import('vue').ComponentInternalInstance|null} instance Pass `getCurrentInstance()`.\n * @param {typeof import('vue').inject} inject Pass Vue's `inject`.\n * @param {{activeFolderSchema?: import('vue').Ref<?{schema: string, register?: string}>}} [extras] `activeFolderSchema`: a ref the page sets to the selected folder's `{ schema, register? }`, switching the loaded object type while it is non-null.\n * @return {object} { isSelfFetch, list, selfObjectStore, selfObjectType, activeQuickFilterIndex }\n */\nexport function useSelfFetchList(props, instance, inject, extras = {}) {\n\tconst objectsProvided = !!(\n\t\tinstance && instance.proxy && instance.proxy.$options && instance.proxy.$options.propsData\n\t\t&& Object.hasOwn(instance.proxy.$options.propsData, 'objects')\n\t)\n\t// A named source wins over register/schema. Without this the page would\n\t// fire an OpenRegister request whose rows it then discards in favour of the\n\t// source's — wasted, but worse than wasted if the manifest names both by\n\t// mistake, because the request succeeds and nothing says the two disagree.\n\tconst isSelfFetch = !!(props.register && props.schema) && !objectsProvided && !props.entitySource\n\n\t// \"Also search inside files\" switch, seeded from `?contentSearch=1` so a\n\t// shared link reproduces the list. Only meaningful when `searchInFiles` is on.\n\tconst routeAtSetup = instance && instance.proxy && instance.proxy.$route\n\tconst contentSearch = ref(props.searchInFiles === true && String(routeAtSetup?.query?.contentSearch) === '1')\n\n\tconst activeQuickFilterIndex = ref(resolveInitialQuickFilterIndex(withPersonalLenses(props.quickFilters, props.personalLenses)))\n\tconst selectedQuickFilterIndices = ref([])\n\tconst isMultiQuickFilter = props.quickFilterMultiple === true\n\n\tif (!isSelfFetch) {\n\t\treturn {\n\t\t\tisSelfFetch: false,\n\t\t\tlist: null,\n\t\t\tselfObjectStore: null,\n\t\t\tselfObjectType: '',\n\t\t\tactiveQuickFilterIndex,\n\t\t\tselectedQuickFilterIndices,\n\t\t\tcontentSearch,\n\t\t\tselfFetchTokenCtx: null,\n\t\t\tinitialQueryFilterKeys: [],\n\t\t}\n\t}\n\n\t// The object type follows the selected folder's own schema when it declares\n\t// one; otherwise the page's register and schema.\n\tconst activeFolderSchema = extras.activeFolderSchema || null\n\tconst resolvedTarget = computed(() => {\n\t\tconst folder = activeFolderSchema && activeFolderSchema.value\n\t\tif (folder && folder.schema) {\n\t\t\tconst register = folder.register || props.register\n\t\t\treturn { register, schema: folder.schema, type: `${register}-${folder.schema}` }\n\t\t}\n\t\t// A collection endpoint gets its own type key, so a plain registration of\n\t\t// the same pair elsewhere never resets it.\n\t\tconst collectionUrl = props.collectionUrl || ''\n\t\tconst type = `${props.register}-${props.schema}` + (collectionUrl ? `@${collectionUrl}` : '')\n\t\treturn { register: props.register, schema: props.schema, type, collectionUrl }\n\t})\n\tconst objectType = computed(() => resolvedTarget.value.type)\n\tconst sidebarState = inject('sidebarState', null) ?? inject('objectSidebarState', null)\n\tconst objectStore = useObjectStore()\n\n\t// Token-resolution context for `@workspace.<key>` / `@config.<key>` /\n\t// `@objectId` / `@object.<field>` inside `props.filter` / quick-filter\n\t// tab filters. Same injects + unwrap shape as CnObjectListWidget's\n\t// `objectCtx`/`workspaceCtx`/`tokenCtx` computeds (and CnDeltaWidget) —\n\t// `cnWorkspaceContext` is the reactive bag a dashboard/workspace-root\n\t// (e.g. hrmq's App.vue for multi-administratie) provides; `cnObjectContext`\n\t// is a detail-page's object context (rare on an index page, but harmless\n\t// to support); `cnAppConfig` is the page-level app config bag. All three\n\t// default to null/absent so an app that never provides them is unaffected.\n\tconst objectCtxRaw = inject('cnObjectContext', null)\n\tconst workspaceCtxRaw = inject('cnWorkspaceContext', null)\n\tconst appConfigRaw = inject('cnAppConfig', null)\n\tconst unwrapCtx = (v) => ((v && typeof v === 'object' && 'value' in v) ? v.value : v)\n\n\t/**\n\t * Build the current token-resolution ctx `{ objectId?, object?, workspace, config }`\n\t * from the injected bags, unwrapping Vue refs. Called fresh on every fetch\n\t * so it always reflects the latest workspace/config state.\n\t *\n\t * @return {object} The token ctx.\n\t */\n\tfunction tokenCtx() {\n\t\tconst objCtx = unwrapCtx(objectCtxRaw)\n\t\tconst base = (objCtx && typeof objCtx === 'object') ? { ...objCtx } : {}\n\t\tbase.workspace = unwrapCtx(workspaceCtxRaw) || {}\n\t\t// The page's own `appConfig` prop wins over a config an ancestor provides.\n\t\tbase.config = { ...(unwrapCtx(appConfigRaw) || {}), ...(props.appConfig || {}) }\n\t\treturn base\n\t}\n\n\t// Reactive signature of the workspace/config bags so a change (e.g. the\n\t// administration switcher writing `activeAdministrationId`) triggers a\n\t// re-fetch below — `fixedFilters` is a plain getter called at fetch time\n\t// (see useListView.resolveFixedFilters), it is NOT auto-tracked by Vue,\n\t// so without this the list would resolve the token once on mount and\n\t// never again. Stringified (like CnDeltaWidget's `sourceKey`) so the\n\t// watcher fires on real content changes only, not object identity.\n\tconst workspaceSignature = computed(() => JSON.stringify(unwrapCtx(workspaceCtxRaw) || {}))\n\tconst appConfigSignature = computed(() => JSON.stringify({ ...(unwrapCtx(appConfigRaw) || {}), ...(props.appConfig || {}) }))\n\n\t// Pass register/schema in their positional id slots (not as a {register, schema} object as\n\t// second arg) — that previously made fetch URLs go to `/api/objects/undefined/[object Object]`.\n\t// Runs (sync, ahead of the list's own watcher) again whenever the type switches.\n\tfunction registerTarget() {\n\t\tconst { register, schema, type, collectionUrl } = resolvedTarget.value\n\t\tif (typeof objectStore.registerObjectType === 'function') {\n\t\t\tobjectStore.registerObjectType(type, schema, register, {\n\t\t\t\tregisterSlug: register,\n\t\t\t\tschemaSlug: schema,\n\t\t\t\t...(collectionUrl ? { collectionUrl } : {}),\n\t\t\t})\n\t\t}\n\t\t// A mixed list tells its own rows apart by `@self.register`, an id, so a slug register needs resolving.\n\t\tif (collectionUrl && !/^\\d+$/.test(String(register)) && typeof objectStore.fetchRegister === 'function') {\n\t\t\tobjectStore.fetchRegister(type)\n\t\t}\n\t}\n\tregisterTarget()\n\twatch(objectType, registerTarget, { flush: 'sync' })\n\n\t// Seed the visible-column set from the configured columns so the sidebar's\n\t// Columns tab reflects the curated default; null when none are configured\n\t// (schema-driven table — every column starts visible).\n\t// A column marked `hidden: true` is declared but starts outside the set,\n\t// so it is off until the person turns it on in the Columns tab.\n\tconst configuredColumnKeys = (props.columns || [])\n\t\t.filter((c) => !(c && typeof c === 'object' && c.hidden === true))\n\t\t.map((c) => (typeof c === 'string' ? c : c && c.key))\n\t\t.filter(Boolean)\n\n\t// Restore a persisted multi-column sort from the route query first (deep\n\t// link / reload); fall back to a host-passed `sortKeys` prop, then the\n\t// legacy single-key `sortKey`/`sortOrder` props.\n\tconst initialRoute = instance && instance.proxy && instance.proxy.$route\n\t// The page's own order, which a lens without a `sort` goes back to.\n\t// `defaultOrder` (manifest `config.defaultOrder`) is the order of last\n\t// resort, after `sortKeys` and `sortKey`.\n\tconst defaultOrderKeys = orderToSortKeys(props.defaultOrder)\n\tconst pageSortKeys = (Array.isArray(props.sortKeys) && props.sortKeys.length > 0)\n\t\t? props.sortKeys\n\t\t: (props.sortKey ? [{ key: props.sortKey, order: props.sortOrder || 'asc' }] : defaultOrderKeys)\n\t// The lens that is active on mount may set its own order.\n\tconst initialTabs = withPersonalLenses(props.quickFilters, props.personalLenses)\n\tconst initialTabSort = (!isMultiQuickFilter && Array.isArray(initialTabs))\n\t\t? quickFilterSortKeys(initialTabs[activeQuickFilterIndex.value])\n\t\t: null\n\tconst initialSortKeys = parseSortKeysFromQuery(initialRoute)\n\t\t|| initialTabSort\n\t\t|| (Array.isArray(props.sortKeys) && props.sortKeys.length > 0 ? props.sortKeys : undefined)\n\t\t|| (!props.sortKey && defaultOrderKeys.length > 0 ? defaultOrderKeys : undefined)\n\t// Same deep-link restore for facet filters and search, so opening a\n\t// shared/bookmarked URL reproduces the same view (CnIndexPage persists\n\t// both back to the route on change).\n\tconst initialActiveFilters = resolveQueryFilters(initialRoute && initialRoute.query, tokenCtx())\n\tconst initialSearchTerm = (initialRoute && typeof initialRoute.query?._search === 'string') ? initialRoute.query._search : ''\n\n\t// Set right after useListView returns; the fixed-filters getter reads it lazily.\n\tlet listHandle = null\n\tconst list = useListView(() => objectType.value, {\n\t\tobjectStore,\n\t\tsidebarState,\n\t\tdefaultSort: props.sortKey ? { key: props.sortKey, order: props.sortOrder || 'asc' } : undefined,\n\t\tdefaultSortKeys: initialSortKeys,\n\t\tdefaultActiveFilters: initialActiveFilters,\n\t\tdefaultSearchTerm: initialSearchTerm,\n\t\tdefaultPageSize: props.viewMode === 'board' ? BOARD_PAGE_SIZE : ((props.pagination && props.pagination.limit) || undefined),\n\t\tdefaultVisibleColumns: configuredColumnKeys.length ? configuredColumnKeys : null,\n\t\t// `pages[].config.extend` → OpenRegister's repeated `_extend[]`. A\n\t\t// getter so a reactive change re-scopes the next fetch, matching how\n\t\t// `fixedFilters` is read.\n\t\textend: () => (Array.isArray(props.extend) ? props.extend : []),\n\t\tfixedFilters: () => {\n\t\t\tconst route = instance && instance.proxy && instance.proxy.$route\n\t\t\tconst params = (route && route.params) || {}\n\t\t\tconst ctx = tokenCtx()\n\t\t\tconst queryFilters = resolveQueryFilters(route && route.query, ctx)\n\t\t\tconst base = resolveFilterMap(props.filter, params, ctx)\n\t\t\t// A folder-sidebar scope declaring `searchFields` narrows what the\n\t\t\t// search box searches over while that scope is active. Read off the\n\t\t\t// instance, like `$route` above, because the active scope is the\n\t\t\t// component's own state rather than a prop — and read through the\n\t\t\t// one fixed-filter getter rather than a second search path.\n\t\t\tconst scopeSearchFields = (instance && instance.proxy && instance.proxy.activeScopeSearchFields) || []\n\t\t\tconst scopeBase = scopeSearchFields.length > 0 ? { _searchFields: scopeSearchFields } : {}\n\t\t\t// File-content search widens a text search, so it rides only with a term.\n\t\t\tconst widen = props.searchInFiles === true && contentSearch.value && !!(listHandle && listHandle.searchTerm.value)\n\t\t\t// The visible calendar month, only while the page is in calendar mode.\n\t\t\tconst month = (instance && instance.proxy && instance.proxy.calendarRangeFilter) || {}\n\t\t\tconst scope = { ...(widen ? { ...scopeBase, _content_search: 'true' } : scopeBase), ...month }\n\t\t\tconst lensed = withPersonalLenses(props.quickFilters, props.personalLenses)\n\t\t\tconst tabs = Array.isArray(lensed) ? lensed : null\n\t\t\tif (!tabs) {\n\t\t\t\treturn { ...queryFilters, ...scope, ...base }\n\t\t\t}\n\n\t\t\t// Multiple mode: OR the selected tabs' filters together (union).\n\t\t\tif (isMultiQuickFilter) {\n\t\t\t\tconst maps = selectedQuickFilterIndices.value\n\t\t\t\t\t.map((i) => resolveFilterMap(tabs[i]?.filter, params, ctx))\n\t\t\t\treturn { ...queryFilters, ...scope, ...base, ...unionFilterMaps(maps) }\n\t\t\t}\n\n\t\t\t// Single mode: the active tab's filter spread last so it wins\n\t\t\t// over a colliding props.filter entry.\n\t\t\tconst activeIdx = activeQuickFilterIndex.value\n\t\t\tconst tabFilter = (activeIdx !== null && activeIdx !== undefined) ? tabs[activeIdx]?.filter : null\n\t\t\treturn { ...queryFilters, ...scope, ...base, ...resolveFilterMap(tabFilter, params, ctx) }\n\t\t},\n\t})\n\n\tlistHandle = list\n\n\t// Re-fetch when the quick-filter selection changes (pre-existing), OR\n\t// when the workspace/app-config bag content changes (e.g. the\n\t// administration switcher writes a new `activeAdministrationId`) — a\n\t// `@workspace.<key>`/`@config.<key>` token in `props.filter` must re-scope\n\t// the list without a manual reload. A change to `props.filter` itself (a\n\t// host toggling a filter checkbox) re-fetches the same way.\n\tconst filterSignature = computed(() => JSON.stringify(props.filter ?? null))\n\twatch([activeQuickFilterIndex, selectedQuickFilterIndices, contentSearch, workspaceSignature, appConfigSignature, filterSignature], (now, before) => {\n\t\t// Switching lens: a lens with a `sort` sets that order; leaving one\n\t\t// for a lens without goes back to the page's own order. A column the\n\t\t// person sorts by afterwards still wins until the next switch.\n\t\tif (!isMultiQuickFilter && before && now[0] !== before[0]) {\n\t\t\tconst tabs = withPersonalLenses(props.quickFilters, props.personalLenses) || []\n\t\t\tconst keys = quickFilterSortKeys(tabs[now[0]]) || (quickFilterSortKeys(tabs[before[0]]) ? pageSortKeys : null)\n\t\t\tif (keys && list.sortKeys) {\n\t\t\t\tlist.sortKeys.value = keys\n\t\t\t\tlist.sortKey.value = keys[0]?.key ?? null\n\t\t\t\tlist.sortOrder.value = keys[0]?.order ?? 'asc'\n\t\t\t}\n\t\t}\n\t\tif (list && typeof list.refresh === 'function') {\n\t\t\tlist.refresh(1)\n\t\t}\n\t})\n\n\t// Live collection updates (manifest-live-updates): subscribe to the\n\t// page's `or-collection-{register}-{schema}` scope so another user's\n\t// create/update/delete refreshes this list without a manual reload.\n\t// The subscription lifecycle (mount/unmount, in-flight dedupe, epoch\n\t// guard against stale async resolution) lives in useObjectSubscription;\n\t// the refetch-on-event (with the last fetch params, burst-coalesced)\n\t// lives in liveUpdatesPlugin. The `subscribe` prop (default true; from\n\t// a manifest: `config.subscribe: false`) is the opt-out, read through\n\t// a reactive getter so a runtime flip attaches/detaches accordingly.\n\t// Stores without live-updates support (no `subscribe` action) are a\n\t// silent no-op inside the composable, keeping this fully inert.\n\tuseObjectSubscription(objectStore, () => objectType.value, null, {\n\t\tenabled: () => props.subscribe !== false,\n\t})\n\n\treturn {\n\t\tisSelfFetch: true,\n\t\tlist,\n\t\tselfObjectStore: objectStore,\n\t\tselfObjectType: objectType,\n\t\tactiveQuickFilterIndex,\n\t\tselectedQuickFilterIndices,\n\t\tcontentSearch,\n\t\t// The page persists the view state back into the query, and needs both\n\t\t// to do it without trampling the rest of it: the keys it adopted from\n\t\t// the query on load (the only non-`_` ones it may clear), and the ctx\n\t\t// those keys' `@`-tokens resolve against.\n\t\tselfFetchTokenCtx: tokenCtx,\n\t\tinitialQueryFilterKeys: Object.keys(initialActiveFilters),\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAWA,SAAS,8BAA8B,CAAC,YAAY,EAAE;AACtD,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,GAAG,KAAI;AAC/D,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;AACjC,EAAE,OAAO,IAAI;AACb,EAAE;AACF,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,IAAI,EAAC;AAC1D,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;AACxB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,eAAe,GAAG,IAAG;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,GAAG,EAAE;AACzC,CAAC,MAAM,IAAI,GAAG,GAAG,IAAI,GAAG,CAAC,KAAI;AAC7B,CAAC,IAAI,CAAC,IAAI,EAAE;AACZ,EAAE,OAAO,IAAI;AACb,EAAE;AACF,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC;AAClD,GAAG,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,IAAI,OAAO,KAAK,CAAC,GA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N,EAAE,eAAe,EAAE,WAAW;AAC9B,EAAE,cAAc,EAAE,UAAU;AAC5B,EAAE,sBAAsB;AACxB,EAAE,0BAA0B;AAC5B,EAAE,aAAa;AACf;AACA;AACA;AACA;AACA,EAAE,iBAAiB,EAAE,QAAQ;AAC7B,EAAE,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC;AAC3D,EAAE;AACF;;;;"}
@@ -0,0 +1,9 @@
1
+ import script from './CnNoticeWidget.vue2.js';
2
+ import { render } from './CnNoticeWidget.vue3.js';
3
+
4
+ script.render = render;
5
+ script.__scopeId = "data-v-74287902";
6
+ const __sfc_main = script;
7
+
8
+ export { __sfc_main as default };
9
+ //# sourceMappingURL=CnNoticeWidget.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CnNoticeWidget.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,88 @@
1
+ import __sfc_main from '../CnIcon/CnIcon.vue.js';
2
+
3
+ /** The tones a notice takes, and the icon each shows by default. */
4
+ const VARIANT_ICONS = Object.freeze({
5
+ info: 'InformationOutline',
6
+ warning: 'AlertOutline',
7
+ error: 'AlertCircleOutline',
8
+ success: 'CheckCircleOutline',
9
+ });
10
+
11
+ /**
12
+ * CnNoticeWidget — a toned notice box: an icon, a bold title and a line of
13
+ * text in one rounded box, as the boards draw a warning beside a record
14
+ * (DqSociaalDomein "Bijzondere persoonsgegevens: gezondheid. Elke inzage
15
+ * wordt gelogd met het doel."). Usable in a detail page's side column, its
16
+ * body grid and on a dashboard as widget type `notice`; the surface applies
17
+ * the widget's `visibleWhen`.
18
+ *
19
+ * `content`: `{ variant?, title?, text, icon? }`. `variant` is `info`
20
+ * (default), `warning`, `error` or `success`; `title` and `text` go through
21
+ * the host's translate; `icon` names a CnIcon instead of the variant's own.
22
+ *
23
+ * ```vue
24
+ * <CnNoticeWidget :content="{ variant: 'warning', title: 'Special category data: health.', text: 'Every view is logged with its purpose.' }" />
25
+ * ```
26
+ */
27
+ var script = {
28
+ name: 'CnNoticeWidget',
29
+
30
+ components: { CnIcon: __sfc_main },
31
+
32
+ inject: {
33
+ /** The host app's translate function (CnAppRoot `cnTranslate`). */
34
+ cnTranslate: { default: () => (key) => key },
35
+ },
36
+
37
+ props: {
38
+ /**
39
+ * The notice: `{ variant?, title?, text, icon? }`.
40
+ *
41
+ * @type {{variant?: string, title?: string, text?: string, icon?: string}}
42
+ */
43
+ content: {
44
+ type: Object,
45
+ default: () => ({}),
46
+ },
47
+ },
48
+
49
+ computed: {
50
+ /** @return {string} `info`, `warning`, `error` or `success`. */
51
+ resolvedVariant() {
52
+ const variant = this.content && this.content.variant === 'danger' ? 'error' : this.content && this.content.variant;
53
+ return Object.hasOwn(VARIANT_ICONS, variant) ? variant : 'info'
54
+ },
55
+
56
+ /** @return {string} The icon name. */
57
+ resolvedIcon() {
58
+ const icon = this.content && this.content.icon;
59
+ return typeof icon === 'string' && icon !== '' ? icon : VARIANT_ICONS[this.resolvedVariant]
60
+ },
61
+
62
+ /** @return {string} The title through the host translate. */
63
+ resolvedTitle() {
64
+ return this.translate(this.content && this.content.title)
65
+ },
66
+
67
+ /** @return {string} The text through the host translate. */
68
+ resolvedText() {
69
+ return this.translate(this.content && this.content.text)
70
+ },
71
+ },
72
+
73
+ methods: {
74
+ /**
75
+ * @param {unknown} text A manifest string.
76
+ * @return {string} Its translation, '' for anything but a non-empty string.
77
+ */
78
+ translate(text) {
79
+ if (typeof text !== 'string' || text === '') {
80
+ return ''
81
+ }
82
+ return typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text
83
+ },
84
+ },
85
+ };
86
+
87
+ export { script as default };
88
+ //# sourceMappingURL=CnNoticeWidget.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CnNoticeWidget.vue2.js","sources":["../../../../src/components/CnNoticeWidget/CnNoticeWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<section\n\t\tv-if=\"resolvedText || resolvedTitle\"\n\t\tclass=\"cn-notice-widget\"\n\t\t:class=\"`cn-notice-widget--${resolvedVariant}`\"\n\t\t:aria-label=\"resolvedTitle || null\"\n\t\trole=\"note\"\n\t\tdata-testid=\"cn-notice-widget\">\n\t\t<CnIcon\n\t\t\tclass=\"cn-notice-widget__icon\"\n\t\t\t:name=\"resolvedIcon\"\n\t\t\t:size=\"18\"\n\t\t\taria-hidden=\"true\" />\n\t\t<p class=\"cn-notice-widget__text\">\n\t\t\t<strong v-if=\"resolvedTitle\" class=\"cn-notice-widget__title\" data-testid=\"cn-notice-widget-title\">{{ resolvedTitle }}</strong>{{ resolvedTitle && resolvedText ? ' ' : '' }}{{ resolvedText }}\n\t\t</p>\n\t</section>\n</template>\n\n<script>\nimport { CnIcon } from '../CnIcon/index.js'\n\n/** The tones a notice takes, and the icon each shows by default. */\nconst VARIANT_ICONS = Object.freeze({\n\tinfo: 'InformationOutline',\n\twarning: 'AlertOutline',\n\terror: 'AlertCircleOutline',\n\tsuccess: 'CheckCircleOutline',\n})\n\n/**\n * CnNoticeWidget — a toned notice box: an icon, a bold title and a line of\n * text in one rounded box, as the boards draw a warning beside a record\n * (DqSociaalDomein \"Bijzondere persoonsgegevens: gezondheid. Elke inzage\n * wordt gelogd met het doel.\"). Usable in a detail page's side column, its\n * body grid and on a dashboard as widget type `notice`; the surface applies\n * the widget's `visibleWhen`.\n *\n * `content`: `{ variant?, title?, text, icon? }`. `variant` is `info`\n * (default), `warning`, `error` or `success`; `title` and `text` go through\n * the host's translate; `icon` names a CnIcon instead of the variant's own.\n *\n * ```vue\n * <CnNoticeWidget :content=\"{ variant: 'warning', title: 'Special category data: health.', text: 'Every view is logged with its purpose.' }\" />\n * ```\n */\nexport default {\n\tname: 'CnNoticeWidget',\n\n\tcomponents: { CnIcon },\n\n\tinject: {\n\t\t/** The host app's translate function (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The notice: `{ variant?, title?, text, icon? }`.\n\t\t *\n\t\t * @type {{variant?: string, title?: string, text?: string, icon?: string}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} `info`, `warning`, `error` or `success`. */\n\t\tresolvedVariant() {\n\t\t\tconst variant = this.content && this.content.variant === 'danger' ? 'error' : this.content && this.content.variant\n\t\t\treturn Object.hasOwn(VARIANT_ICONS, variant) ? variant : 'info'\n\t\t},\n\n\t\t/** @return {string} The icon name. */\n\t\tresolvedIcon() {\n\t\t\tconst icon = this.content && this.content.icon\n\t\t\treturn typeof icon === 'string' && icon !== '' ? icon : VARIANT_ICONS[this.resolvedVariant]\n\t\t},\n\n\t\t/** @return {string} The title through the host translate. */\n\t\tresolvedTitle() {\n\t\t\treturn this.translate(this.content && this.content.title)\n\t\t},\n\n\t\t/** @return {string} The text through the host translate. */\n\t\tresolvedText() {\n\t\t\treturn this.translate(this.content && this.content.text)\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * @param {unknown} text A manifest string.\n\t\t * @return {string} Its translation, '' for anything but a non-empty string.\n\t\t */\n\t\ttranslate(text) {\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-notice-widget {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 10px;\n\tpadding: 14px 16px;\n\tborder-radius: var(--cn-board-card-radius, 12px);\n\tfont-size: 14px;\n\tline-height: 1.5;\n\tbackground: color-mix(in srgb, var(--color-info, #0071ad) 10%, var(--color-main-background));\n\tcolor: var(--color-main-text);\n}\n\n.cn-notice-widget--warning {\n\tbackground: var(--color-warning-light, #fff4de);\n\tcolor: var(--color-warning-text, #7a4f00);\n}\n\n.cn-notice-widget--error {\n\tbackground: color-mix(in srgb, var(--color-error, #db0606) 10%, var(--color-main-background));\n\tcolor: var(--color-error-text, var(--color-main-text));\n}\n\n.cn-notice-widget--success {\n\tbackground: color-mix(in srgb, var(--color-success, #2d7b41) 10%, var(--color-main-background));\n\tcolor: var(--color-success-text, var(--color-main-text));\n}\n\n.cn-notice-widget__icon {\n\tflex: 0 0 auto;\n\tmargin-top: 2px;\n}\n\n.cn-notice-widget__text {\n\tmargin: 0;\n\toverflow-wrap: anywhere;\n}\n\n.cn-notice-widget__title {\n\tfont-weight: 700;\n}\n</style>\n"],"names":["CnIcon"],"mappings":";;AA0BA;AACA,MAAM,aAAY,GAAI,MAAM,CAAC,MAAM,CAAC;CACnC,IAAI,EAAE,oBAAoB;CAC1B,OAAO,EAAE,cAAc;CACvB,KAAK,EAAE,oBAAoB;CAC3B,OAAO,EAAE,oBAAoB;AAC9B,CAAC,EAAA;;AAED;;;AAGC;;;;AAIA;;AAEA;AACA;AACA;AACA;;AAEA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,gBAAgB;;AAEtB,CAAA,UAAU,EAAE,UAAEA,YAAQ;;AAEtB,CAAA,MAAM,EAAE;;AAEP,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;EAC5C;;AAED,CAAA,KAAK,EAAE;AACN;AACC;AACA;AACA;;AAED,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,OAAO,EAAE,CAAC;GACnB;EACD;;AAED,CAAA,QAAQ,EAAE;;AAET,EAAA,eAAe,GAAG;GACjB,MAAM,UAAU,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,OAAQ,KAAI,QAAS,GAAE,UAAU,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,QAAM;GACjH,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAA,GAAI,OAAQ,GAAE,MAAK;GAC9D;;AAED;AACA,EAAA,YAAY,GAAG;AACd,GAAA,MAAM,IAAG,GAAI,IAAI,CAAC,OAAM,IAAK,IAAI,CAAC,OAAO,CAAC,KAAG;AAC7C,GAAA,OAAO,OAAO,IAAG,KAAM,YAAY,IAAK,KAAI,EAAG,GAAE,IAAK,GAAE,aAAa,CAAC,IAAI,CAAC,eAAe,CAAA;GAC1F;;;AAGD,EAAA,aAAa,GAAG;GACf,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAM,IAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAA;GACxD;;;AAGD,EAAA,YAAY,GAAG;GACd,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;GACvD;EACD;;AAED,CAAA,OAAO,EAAE;AACR;AACC;AACA;;AAED,EAAA,SAAS,CAAC,IAAI,EAAE;AACf,GAAA,IAAI,OAAO,IAAG,KAAM,QAAO,IAAK,SAAS,EAAE,EAAE;AAC5C,IAAA,OAAO,EAAC;AACT,IAAA;AACA,GAAA,OAAO,OAAO,IAAI,CAAC,WAAY,KAAI,UAAW,GAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA,GAAI,IAAG;GAC5E;EACD;AACF;;;;"}
@@ -0,0 +1,39 @@
1
+ import { resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, createElementVNode, toDisplayString, createCommentVNode, createTextVNode } from 'vue';
2
+
3
+ const _hoisted_1 = ["aria-label"];
4
+ const _hoisted_2 = { class: "cn-notice-widget__text" };
5
+ const _hoisted_3 = {
6
+ key: 0,
7
+ class: "cn-notice-widget__title",
8
+ "data-testid": "cn-notice-widget-title"
9
+ };
10
+
11
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
12
+ const _component_CnIcon = resolveComponent("CnIcon");
13
+
14
+ return ($options.resolvedText || $options.resolvedTitle)
15
+ ? (openBlock(), createElementBlock("section", {
16
+ key: 0,
17
+ class: normalizeClass(["cn-notice-widget", `cn-notice-widget--${$options.resolvedVariant}`]),
18
+ "aria-label": $options.resolvedTitle || null,
19
+ role: "note",
20
+ "data-testid": "cn-notice-widget"
21
+ }, [
22
+ createVNode(_component_CnIcon, {
23
+ class: "cn-notice-widget__icon",
24
+ name: $options.resolvedIcon,
25
+ size: 18,
26
+ "aria-hidden": "true"
27
+ }, null, 8 /* PROPS */, ["name"]),
28
+ createElementVNode("p", _hoisted_2, [
29
+ ($options.resolvedTitle)
30
+ ? (openBlock(), createElementBlock("strong", _hoisted_3, toDisplayString($options.resolvedTitle), 1 /* TEXT */))
31
+ : createCommentVNode("v-if", true),
32
+ createTextVNode(toDisplayString($options.resolvedTitle && $options.resolvedText ? ' ' : '') + toDisplayString($options.resolvedText), 1 /* TEXT */)
33
+ ])
34
+ ], 10 /* CLASS, PROPS */, _hoisted_1))
35
+ : createCommentVNode("v-if", true)
36
+ }
37
+
38
+ export { render };
39
+ //# sourceMappingURL=CnNoticeWidget.vue3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CnNoticeWidget.vue3.js","sources":["../../../../src/components/CnNoticeWidget/CnNoticeWidget.vue?vue&type=template&id=74287902&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<section\n\t\tv-if=\"resolvedText || resolvedTitle\"\n\t\tclass=\"cn-notice-widget\"\n\t\t:class=\"`cn-notice-widget--${resolvedVariant}`\"\n\t\t:aria-label=\"resolvedTitle || null\"\n\t\trole=\"note\"\n\t\tdata-testid=\"cn-notice-widget\">\n\t\t<CnIcon\n\t\t\tclass=\"cn-notice-widget__icon\"\n\t\t\t:name=\"resolvedIcon\"\n\t\t\t:size=\"18\"\n\t\t\taria-hidden=\"true\" />\n\t\t<p class=\"cn-notice-widget__text\">\n\t\t\t<strong v-if=\"resolvedTitle\" class=\"cn-notice-widget__title\" data-testid=\"cn-notice-widget-title\">{{ resolvedTitle }}</strong>{{ resolvedTitle && resolvedText ? ' ' : '' }}{{ resolvedText }}\n\t\t</p>\n\t</section>\n</template>\n\n<script>\nimport { CnIcon } from '../CnIcon/index.js'\n\n/** The tones a notice takes, and the icon each shows by default. */\nconst VARIANT_ICONS = Object.freeze({\n\tinfo: 'InformationOutline',\n\twarning: 'AlertOutline',\n\terror: 'AlertCircleOutline',\n\tsuccess: 'CheckCircleOutline',\n})\n\n/**\n * CnNoticeWidget — a toned notice box: an icon, a bold title and a line of\n * text in one rounded box, as the boards draw a warning beside a record\n * (DqSociaalDomein \"Bijzondere persoonsgegevens: gezondheid. Elke inzage\n * wordt gelogd met het doel.\"). Usable in a detail page's side column, its\n * body grid and on a dashboard as widget type `notice`; the surface applies\n * the widget's `visibleWhen`.\n *\n * `content`: `{ variant?, title?, text, icon? }`. `variant` is `info`\n * (default), `warning`, `error` or `success`; `title` and `text` go through\n * the host's translate; `icon` names a CnIcon instead of the variant's own.\n *\n * ```vue\n * <CnNoticeWidget :content=\"{ variant: 'warning', title: 'Special category data: health.', text: 'Every view is logged with its purpose.' }\" />\n * ```\n */\nexport default {\n\tname: 'CnNoticeWidget',\n\n\tcomponents: { CnIcon },\n\n\tinject: {\n\t\t/** The host app's translate function (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The notice: `{ variant?, title?, text, icon? }`.\n\t\t *\n\t\t * @type {{variant?: string, title?: string, text?: string, icon?: string}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} `info`, `warning`, `error` or `success`. */\n\t\tresolvedVariant() {\n\t\t\tconst variant = this.content && this.content.variant === 'danger' ? 'error' : this.content && this.content.variant\n\t\t\treturn Object.hasOwn(VARIANT_ICONS, variant) ? variant : 'info'\n\t\t},\n\n\t\t/** @return {string} The icon name. */\n\t\tresolvedIcon() {\n\t\t\tconst icon = this.content && this.content.icon\n\t\t\treturn typeof icon === 'string' && icon !== '' ? icon : VARIANT_ICONS[this.resolvedVariant]\n\t\t},\n\n\t\t/** @return {string} The title through the host translate. */\n\t\tresolvedTitle() {\n\t\t\treturn this.translate(this.content && this.content.title)\n\t\t},\n\n\t\t/** @return {string} The text through the host translate. */\n\t\tresolvedText() {\n\t\t\treturn this.translate(this.content && this.content.text)\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * @param {unknown} text A manifest string.\n\t\t * @return {string} Its translation, '' for anything but a non-empty string.\n\t\t */\n\t\ttranslate(text) {\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-notice-widget {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 10px;\n\tpadding: 14px 16px;\n\tborder-radius: var(--cn-board-card-radius, 12px);\n\tfont-size: 14px;\n\tline-height: 1.5;\n\tbackground: color-mix(in srgb, var(--color-info, #0071ad) 10%, var(--color-main-background));\n\tcolor: var(--color-main-text);\n}\n\n.cn-notice-widget--warning {\n\tbackground: var(--color-warning-light, #fff4de);\n\tcolor: var(--color-warning-text, #7a4f00);\n}\n\n.cn-notice-widget--error {\n\tbackground: color-mix(in srgb, var(--color-error, #db0606) 10%, var(--color-main-background));\n\tcolor: var(--color-error-text, var(--color-main-text));\n}\n\n.cn-notice-widget--success {\n\tbackground: color-mix(in srgb, var(--color-success, #2d7b41) 10%, var(--color-main-background));\n\tcolor: var(--color-success-text, var(--color-main-text));\n}\n\n.cn-notice-widget__icon {\n\tflex: 0 0 auto;\n\tmargin-top: 2px;\n}\n\n.cn-notice-widget__text {\n\tmargin: 0;\n\toverflow-wrap: anywhere;\n}\n\n.cn-notice-widget__title {\n\tfont-weight: 700;\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","_createVNode"],"mappings":";;;;;;;;;;;;;AAUQ,EAAA,OAAA,CAAA,QAAA,CAAA,YAAI,IAAA,QAAA,CAAA,aAAA;oBADVA;;QAEA,KAAK,EAAAC,cAAA,CAAA,CAAC,kBAAkB,EAAA,CAAA,kBAAA,EAClB,QAAA,CAAA,eAAA,CAAA,CAAA,CAAA,CAAA;AACL,QAAA,YAAU,EAAE,QAAa,CAAA,aAAA,IAAA,IAAA;AACzB,QAAA,IAAG,EAAC,MAAM;AACV,QAAA,aAAS,EAAA,kBAAA;;QACTC,WAIO,CAAA,iBAAA,EAAA;AAHP,UAAA,KAAK,EAAC,wBAAwB;AAC7B,UAAA,IAAI,UAAc,CAAA,YAAA;AAClB,UAAA,IAAC,EAAA,EAAA;AACF,UAAA,aAAO,EAAA,MAAA;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnSettingsField.vue2.js';
2
2
  import { render } from './CnSettingsField.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-d2218996";
5
+ script.__scopeId = "data-v-7acf5300";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -1 +1 @@
1
- {"version":3,"file":"CnSettingsField.vue2.js","sources":["../../../../src/components/CnSettingsField/CnSettingsField.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-settings-field\" :data-testid=\"`cn-settings-field-${field.key}`\">\n\t\t<NcCheckboxRadioSwitch\n\t\t\tv-if=\"kind === 'switch' || kind === 'boolean'\"\n\t\t\t:type=\"kind === 'switch' ? 'switch' : 'checkbox'\"\n\t\t\t:modelValue=\"!!modelValue\"\n\t\t\t:disabled=\"field.readOnly\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\">\n\t\t\t{{ label }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<div v-else-if=\"kind === 'image'\"\n\t\t\tclass=\"cn-settings-field__image\"\n\t\t\trole=\"group\"\n\t\t\t:aria-labelledby=\"`${inputId}-label`\">\n\t\t\t<span :id=\"`${inputId}-label`\" class=\"cn-settings-field__image-label\">{{ label }}</span>\n\t\t\t<div class=\"cn-settings-field__image-row\">\n\t\t\t\t<span class=\"cn-settings-field__image-tile\" :data-testid=\"`cn-settings-field-image-${field.key}`\">\n\t\t\t\t\t<img v-if=\"stringValue\" :src=\"stringValue\" :alt=\"t('nextcloud-vue', 'Current {name}', { name: label })\">\n\t\t\t\t\t<span v-else class=\"cn-settings-field__image-initials\" aria-hidden=\"true\">{{ field.initials || '' }}</span>\n\t\t\t\t</span>\n\t\t\t\t<input\n\t\t\t\t\t:id=\"inputId\"\n\t\t\t\t\tref=\"file\"\n\t\t\t\t\tclass=\"hidden-visually\"\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t:accept=\"field.accept || 'image/*'\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t:aria-labelledby=\"`${inputId}-label`\"\n\t\t\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t\t\t@change=\"upload($event.target.files && $event.target.files[0])\">\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"!field.readOnly && field.uploadUrl\"\n\t\t\t\t\t:disabled=\"uploading\"\n\t\t\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t\t\t:data-testid=\"`cn-settings-field-upload-${field.key}`\"\n\t\t\t\t\t@click=\"$refs.file && $refs.file.click()\">\n\t\t\t\t\t<template v-if=\"uploading\" #icon>\n\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ field.uploadLabel || t('nextcloud-vue', 'Upload {name}', { name: label }) }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</div>\n\t\t<NcSelect\n\t\t\tv-else-if=\"kind === 'select'\"\n\t\t\t:inputId=\"inputId\"\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"normalizedOptions\"\n\t\t\t:inputLabel=\"label\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:loading=\"optionsLoading\"\n\t\t\t:disabled=\"field.readOnly\"\n\t\t\t:clearable=\"!field.required\"\n\t\t\tlabel=\"label\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue(optionValue($event))\" />\n\t\t<NcTextArea\n\t\t\tv-else-if=\"kind === 'textarea'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:rows=\"field.rows || 4\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<NcTextField\n\t\t\tv-else-if=\"kind === 'secret'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"password\"\n\t\t\tautocomplete=\"new-password\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:placeholder=\"field.secretSet ? secretSetPlaceholder : (field.placeholder || '')\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<NcTextField\n\t\t\tv-else-if=\"kind === 'number'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"number\"\n\t\t\t:min=\"field.min\"\n\t\t\t:max=\"field.max\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event === '' ? null : Number($event))\" />\n\t\t<NcTextField\n\t\t\tv-else\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\t:type=\"kind === 'password' ? 'password' : 'text'\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<p v-if=\"shownError\"\n\t\t\t:id=\"`${inputId}-error`\"\n\t\t\tclass=\"cn-settings-field__error\"\n\t\t\t:data-testid=\"`cn-settings-field-error-${field.key}`\">\n\t\t\t{{ shownError }}\n\t\t</p>\n\t\t<p v-else-if=\"hint\" :id=\"`${inputId}-hint`\" class=\"cn-settings-field__hint\">\n\t\t\t{{ hint }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcCheckboxRadioSwitch, NcLoadingIcon, NcSelect, NcTextArea, NcTextField } from '@nextcloud/vue'\nimport { buildHeaders, prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { serverErrorMessage } from '../../utils/serverErrorMessage.js'\n\nlet fieldUid = 0\n\n/** Field types and the names CnSettingsPage's manifest uses for them. */\nconst KIND_ALIASES = { enum: 'select', string: 'text' }\n\n/**\n * CnSettingsField - one settings field: the control for its type with its\n * label, and under it an error or a hint. Shared by CnSettingsPage and\n * CnSettingsFieldsSection.\n *\n * Types: `text` (default), `textarea`, `number`, `switch`, `boolean` (a checkbox),\n * `select` (`enum`) with static `options` or options read from `optionsUrl`,\n * `password` (a masked input that shows its value back) and `secret`\n * (replace-only: the input stays empty, and with `secretSet` says a value is\n * stored; the host sends it only when something is typed), and `image` (a\n * preview tile, the initials without an image, and an upload button that\n * posts the file to `uploadUrl` at once and emits `uploaded`).\n *\n * ```vue\n * <CnSettingsField\n * :field=\"{ key: 'apiKey', label: 'API key', type: 'secret', secretSet: true }\"\n * v-model=\"form.apiKey\" />\n * ```\n */\nexport default {\n\tname: 'CnSettingsField',\n\n\tcomponents: { NcButton, NcCheckboxRadioSwitch, NcLoadingIcon, NcSelect, NcTextArea, NcTextField },\n\n\tprops: {\n\t\t/**\n\t\t * The field: `{ key, label, type?, options?, optionsUrl?, optionsPath?,\n\t\t * optionLabel?, optionValue?, placeholder?, rows?, min?, max?, required?,\n\t\t * readOnly?, secretSet? }`. `label` arrives translated.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tfield: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * The value: text, a number, a boolean or a select value. Any type,\n\t\t * because a Boolean in a type list would read an empty string as true.\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: null,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** A validation message, drawn under the control and tied to it. */\n\t\terror: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A hint under the control (not drawn while there is an error). */\n\t\thint: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'uploaded'],\n\n\tdata() {\n\t\tfieldUid += 1\n\t\treturn {\n\t\t\tuid: fieldUid,\n\t\t\tfetchedOptions: null,\n\t\t\toptionsLoading: false,\n\t\t\tuploading: false,\n\t\t\tuploadError: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The control kind. */\n\t\tkind() {\n\t\t\tconst type = String(this.field.type || 'text')\n\t\t\treturn KIND_ALIASES[type] || type\n\t\t},\n\n\t\t/** @return {string} The label. */\n\t\tlabel() {\n\t\t\treturn String(this.field.label || this.field.key || '')\n\t\t},\n\n\t\t/** @return {string} The control's id. */\n\t\tinputId() {\n\t\t\treturn `cn-settings-field-${this.uid}-${String(this.field.key).replace(/[^A-Za-z0-9_-]/g, '-')}`\n\t\t},\n\n\t\t/** @return {string} The message shown under the control: an upload failure, else `error`. */\n\t\tshownError() {\n\t\t\treturn this.uploadError || this.error\n\t\t},\n\n\t\t/** @return {string|null} The id of the error or hint the control is described by. */\n\t\tdescribedBy() {\n\t\t\tif (this.shownError) {\n\t\t\t\treturn `${this.inputId}-error`\n\t\t\t}\n\t\t\treturn this.hint ? `${this.inputId}-hint` : null\n\t\t},\n\n\t\t/** @return {string} The value as text for a text control. */\n\t\tstringValue() {\n\t\t\treturn this.modelValue === null || this.modelValue === undefined ? '' : String(this.modelValue)\n\t\t},\n\n\t\t/** @return {string} The placeholder of a secret that is stored. */\n\t\tsecretSetPlaceholder() {\n\t\t\treturn t('nextcloud-vue', 'Stored. Type a new value to replace it.')\n\t\t},\n\n\t\t/**\n\t\t * The select options as `{ label, value }`: the static `options` (strings,\n\t\t * numbers or objects), or those read from `optionsUrl`.\n\t\t *\n\t\t * @return {Array<{label: string, value: (string|number|boolean)}>}\n\t\t */\n\t\tnormalizedOptions() {\n\t\t\tconst raw = Array.isArray(this.field.options) ? this.field.options : (this.fetchedOptions || [])\n\t\t\treturn raw.map((option) => (option && typeof option === 'object'\n\t\t\t\t? { ...option, label: String(option.label ?? option.value ?? ''), value: option.value }\n\t\t\t\t: { label: String(option), value: option }))\n\t\t},\n\n\t\t/** @return {object|null} The option the value selects, for NcSelect. */\n\t\tselectedOption() {\n\t\t\tif (this.modelValue === null || this.modelValue === undefined || this.modelValue === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn this.normalizedOptions.find((option) => option.value === this.modelValue)\n\t\t\t\t|| { label: String(this.modelValue), value: this.modelValue }\n\t\t},\n\t},\n\n\twatch: {\n\t\t'field.optionsUrl': {\n\t\t\thandler() {\n\t\t\t\tthis.loadOptions()\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Upload a chosen image to `uploadUrl` as multipart form data (the\n\t\t * file under `uploadField`, default `image`, plus `uploadParams`), then\n\t\t * take the new image url from the answer at `uploadValuePath` (or a\n\t\t * cache-busted `previewUrl`).\n\t\t *\n\t\t * @param {File|undefined} file The chosen file.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-an-image-field-uploads-at-once\n\t\t */\n\t\tasync upload(file) {\n\t\t\tif (!file || !this.field.uploadUrl) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst form = new FormData()\n\t\t\tfor (const [name, value] of Object.entries(this.field.uploadParams || {})) {\n\t\t\t\tform.append(name, value)\n\t\t\t}\n\t\t\tform.append(this.field.uploadField || 'image', file)\n\t\t\tthis.uploading = true\n\t\t\tthis.uploadError = ''\n\t\t\ttry {\n\t\t\t\tconst response = await axios.post(prefixUrl(this.field.uploadUrl), form)\n\t\t\t\tconst fromAnswer = this.field.uploadValuePath ? readPath(response?.data, this.field.uploadValuePath) : ''\n\t\t\t\tconst next = fromAnswer || (this.field.previewUrl ? `${prefixUrl(this.field.previewUrl)}${this.field.previewUrl.includes('?') ? '&' : '?'}v=${Date.now()}` : '')\n\t\t\t\t/**\n\t\t\t\t * @event uploaded An image was uploaded. Payload: its new url.\n\t\t\t\t */\n\t\t\t\tthis.$emit('uploaded', next)\n\t\t\t} catch (error) {\n\t\t\t\tthis.uploadError = t('nextcloud-vue', 'The image could not be uploaded: {reason}', { reason: serverErrorMessage(error) })\n\t\t\t} finally {\n\t\t\t\tthis.uploading = false\n\t\t\t\tif (this.$refs.file) {\n\t\t\t\t\tthis.$refs.file.value = ''\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Report a new value.\n\t\t *\n\t\t * @param {unknown} value The value.\n\t\t * @return {void}\n\t\t */\n\t\temitValue(value) {\n\t\t\t/**\n\t\t\t * @event update:modelValue The value changed. Payload: the new value.\n\t\t\t */\n\t\t\tthis.$emit('update:modelValue', value)\n\t\t},\n\n\t\t/**\n\t\t * The storable value of what NcSelect emits.\n\t\t *\n\t\t * @param {object|string|number|null} emitted An option, or null on clear.\n\t\t * @return {string|number|boolean|null}\n\t\t */\n\t\toptionValue(emitted) {\n\t\t\tif (emitted === null || emitted === undefined) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn typeof emitted === 'object' && 'value' in emitted ? emitted.value : emitted\n\t\t},\n\n\t\t/**\n\t\t * Read a sourced select's options: a list (or the list at\n\t\t * `optionsPath`, or under `results`) mapped through `optionLabel` and\n\t\t * `optionValue` (dotted paths; default `label`/`title`/`name` and `value`/`id`).\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadOptions() {\n\t\t\tconst url = this.kind === 'select' && !Array.isArray(this.field.options) ? this.field.optionsUrl : ''\n\t\t\tif (!url) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.optionsLoading = true\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(prefixUrl(url), { headers: buildHeaders() })\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthis.fetchedOptions = []\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst data = await response.json()\n\t\t\t\tconst list = this.field.optionsPath ? readPath(data, this.field.optionsPath) : (Array.isArray(data) ? data : data?.results)\n\t\t\t\tthis.fetchedOptions = (Array.isArray(list) ? list : []).map((item) => {\n\t\t\t\t\tif (!item || typeof item !== 'object') {\n\t\t\t\t\t\treturn { label: String(item), value: item }\n\t\t\t\t\t}\n\t\t\t\t\tconst value = this.field.optionValue ? readPath(item, this.field.optionValue) : (item.value ?? item.id)\n\t\t\t\t\tconst label = this.field.optionLabel ? readPath(item, this.field.optionLabel) : (item.label ?? item.title ?? item.name ?? value)\n\t\t\t\t\treturn { label: String(label ?? ''), value }\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\tthis.fetchedOptions = []\n\t\t\t} finally {\n\t\t\t\tthis.optionsLoading = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-settings-field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmin-width: 0;\n}\n\n.cn-settings-field__hint,\n.cn-settings-field__error {\n\tmargin: 0;\n\tfont-size: 13px;\n\tline-height: 1.4;\n}\n\n.cn-settings-field__image {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-settings-field__image-label {\n\tfont-weight: 600;\n}\n\n.cn-settings-field__image-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 12px;\n}\n\n.cn-settings-field__image-tile {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 64px;\n\theight: 64px;\n\toverflow: hidden;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large);\n\tbackground: var(--color-primary-element-light);\n}\n\n.cn-settings-field__image-tile img {\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tobject-fit: contain;\n}\n\n.cn-settings-field__image-initials {\n\tfont-size: 20px;\n\tfont-weight: 700;\n\tcolor: var(--color-primary-element-light-text, var(--color-primary-element));\n}\n\n.cn-settings-field__hint {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-settings-field__error {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n</style>\n"],"names":["t","axios"],"mappings":";;;;;;;AAgIA,IAAI,QAAO,GAAI,EAAA;;AAEf;AACA,MAAM,YAAW,GAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAO,GAAA;;AAEtD;;;;AAIC;AACA;AACA;;AAEA;;;;AAIA;AACA;AACA;AACA;;AAEA;;AAED,aAAe;CACd,IAAI,EAAE,iBAAiB;;AAEvB,CAAA,UAAU,EAAE,EAAE,QAAQ,EAAE,qBAAqB,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa;;AAEjG,CAAA,KAAK,EAAE;AACN;;AAEC;;AAEA;;;AAGD,EAAA,KAAK,EAAE;GACN,IAAI,EAAE,MAAM;GACZ,QAAQ,EAAE,IAAI;GACd;;AAED;;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Q,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,KAAI,IAAK,IAAI,CAAC,KAAI,IAAK,IAAI,CAAC,IAAG,IAAK,KAAK,EAAA;AAC/H,KAAA,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,EAAE,KAAM,EAAA;KAC3C,EAAA;AACF,IAAA,CAAE,MAAM;AACP,IAAA,IAAI,CAAC,cAAa,GAAI,GAAC;AACxB,IAAA,SAAU;IACT,IAAI,CAAC,iBAAiB,MAAI;AAC3B,IAAA;GACA;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnSettingsField.vue2.js","sources":["../../../../src/components/CnSettingsField/CnSettingsField.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-settings-field\" :data-testid=\"`cn-settings-field-${field.key}`\">\n\t\t<NcCheckboxRadioSwitch\n\t\t\tv-if=\"kind === 'switch' || kind === 'boolean'\"\n\t\t\t:type=\"kind === 'switch' ? 'switch' : 'checkbox'\"\n\t\t\t:modelValue=\"!!modelValue\"\n\t\t\t:disabled=\"field.readOnly\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\">\n\t\t\t{{ label }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<div v-else-if=\"kind === 'image'\"\n\t\t\tclass=\"cn-settings-field__image\"\n\t\t\trole=\"group\"\n\t\t\t:aria-labelledby=\"`${inputId}-label`\">\n\t\t\t<!-- `hideLabel` keeps the name for a screen reader only. -->\n\t\t\t<span :id=\"`${inputId}-label`\"\n\t\t\t\tclass=\"cn-settings-field__image-label\"\n\t\t\t\t:class=\"{ 'hidden-visually': field.hideLabel === true }\">{{ label }}</span>\n\t\t\t<div class=\"cn-settings-field__image-row\">\n\t\t\t\t<span class=\"cn-settings-field__image-tile\" :data-testid=\"`cn-settings-field-image-${field.key}`\">\n\t\t\t\t\t<img v-if=\"stringValue\" :src=\"stringValue\" :alt=\"t('nextcloud-vue', 'Current {name}', { name: label })\">\n\t\t\t\t\t<span v-else class=\"cn-settings-field__image-initials\" aria-hidden=\"true\">{{ field.initials || '' }}</span>\n\t\t\t\t</span>\n\t\t\t\t<input\n\t\t\t\t\t:id=\"inputId\"\n\t\t\t\t\tref=\"file\"\n\t\t\t\t\tclass=\"hidden-visually\"\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t:accept=\"field.accept || 'image/*'\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t:aria-labelledby=\"`${inputId}-label`\"\n\t\t\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t\t\t@change=\"upload($event.target.files && $event.target.files[0])\">\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"!field.readOnly && field.uploadUrl\"\n\t\t\t\t\t:disabled=\"uploading\"\n\t\t\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t\t\t:data-testid=\"`cn-settings-field-upload-${field.key}`\"\n\t\t\t\t\t@click=\"$refs.file && $refs.file.click()\">\n\t\t\t\t\t<template v-if=\"uploading\" #icon>\n\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ field.uploadLabel || t('nextcloud-vue', 'Upload {name}', { name: label }) }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</div>\n\t\t<NcSelect\n\t\t\tv-else-if=\"kind === 'select'\"\n\t\t\t:inputId=\"inputId\"\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"normalizedOptions\"\n\t\t\t:inputLabel=\"label\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:loading=\"optionsLoading\"\n\t\t\t:disabled=\"field.readOnly\"\n\t\t\t:clearable=\"!field.required\"\n\t\t\tlabel=\"label\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue(optionValue($event))\" />\n\t\t<NcTextArea\n\t\t\tv-else-if=\"kind === 'textarea'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:rows=\"field.rows || 4\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<NcTextField\n\t\t\tv-else-if=\"kind === 'secret'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"password\"\n\t\t\tautocomplete=\"new-password\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:placeholder=\"field.secretSet ? secretSetPlaceholder : (field.placeholder || '')\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<NcTextField\n\t\t\tv-else-if=\"kind === 'number'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"number\"\n\t\t\t:min=\"field.min\"\n\t\t\t:max=\"field.max\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event === '' ? null : Number($event))\" />\n\t\t<NcTextField\n\t\t\tv-else\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\t:type=\"kind === 'password' ? 'password' : 'text'\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<p v-if=\"shownError\"\n\t\t\t:id=\"`${inputId}-error`\"\n\t\t\tclass=\"cn-settings-field__error\"\n\t\t\t:data-testid=\"`cn-settings-field-error-${field.key}`\">\n\t\t\t{{ shownError }}\n\t\t</p>\n\t\t<p v-else-if=\"hint\" :id=\"`${inputId}-hint`\" class=\"cn-settings-field__hint\">\n\t\t\t{{ hint }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcCheckboxRadioSwitch, NcLoadingIcon, NcSelect, NcTextArea, NcTextField } from '@nextcloud/vue'\nimport { buildHeaders, prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { serverErrorMessage } from '../../utils/serverErrorMessage.js'\n\nlet fieldUid = 0\n\n/** Field types and the names CnSettingsPage's manifest uses for them. */\nconst KIND_ALIASES = { enum: 'select', string: 'text' }\n\n/**\n * CnSettingsField - one settings field: the control for its type with its\n * label, and under it an error or a hint. Shared by CnSettingsPage and\n * CnSettingsFieldsSection.\n *\n * Types: `text` (default), `textarea`, `number`, `switch`, `boolean` (a checkbox),\n * `select` (`enum`) with static `options` or options read from `optionsUrl`,\n * `password` (a masked input that shows its value back) and `secret`\n * (replace-only: the input stays empty, and with `secretSet` says a value is\n * stored; the host sends it only when something is typed), and `image` (a\n * preview tile, the initials without an image, and an upload button that\n * posts the file to `uploadUrl` at once and emits `uploaded`).\n *\n * ```vue\n * <CnSettingsField\n * :field=\"{ key: 'apiKey', label: 'API key', type: 'secret', secretSet: true }\"\n * v-model=\"form.apiKey\" />\n * ```\n */\nexport default {\n\tname: 'CnSettingsField',\n\n\tcomponents: { NcButton, NcCheckboxRadioSwitch, NcLoadingIcon, NcSelect, NcTextArea, NcTextField },\n\n\tprops: {\n\t\t/**\n\t\t * The field: `{ key, label, type?, options?, optionsUrl?, optionsPath?,\n\t\t * optionLabel?, optionValue?, placeholder?, rows?, min?, max?, required?,\n\t\t * readOnly?, secretSet? }`. `label` arrives translated.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tfield: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * The value: text, a number, a boolean or a select value. Any type,\n\t\t * because a Boolean in a type list would read an empty string as true.\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: null,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** A validation message, drawn under the control and tied to it. */\n\t\terror: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A hint under the control (not drawn while there is an error). */\n\t\thint: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'uploaded'],\n\n\tdata() {\n\t\tfieldUid += 1\n\t\treturn {\n\t\t\tuid: fieldUid,\n\t\t\tfetchedOptions: null,\n\t\t\toptionsLoading: false,\n\t\t\tuploading: false,\n\t\t\tuploadError: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The control kind. */\n\t\tkind() {\n\t\t\tconst type = String(this.field.type || 'text')\n\t\t\treturn KIND_ALIASES[type] || type\n\t\t},\n\n\t\t/** @return {string} The label. */\n\t\tlabel() {\n\t\t\treturn String(this.field.label || this.field.key || '')\n\t\t},\n\n\t\t/** @return {string} The control's id. */\n\t\tinputId() {\n\t\t\treturn `cn-settings-field-${this.uid}-${String(this.field.key).replace(/[^A-Za-z0-9_-]/g, '-')}`\n\t\t},\n\n\t\t/** @return {string} The message shown under the control: an upload failure, else `error`. */\n\t\tshownError() {\n\t\t\treturn this.uploadError || this.error\n\t\t},\n\n\t\t/** @return {string|null} The id of the error or hint the control is described by. */\n\t\tdescribedBy() {\n\t\t\tif (this.shownError) {\n\t\t\t\treturn `${this.inputId}-error`\n\t\t\t}\n\t\t\treturn this.hint ? `${this.inputId}-hint` : null\n\t\t},\n\n\t\t/** @return {string} The value as text for a text control. */\n\t\tstringValue() {\n\t\t\treturn this.modelValue === null || this.modelValue === undefined ? '' : String(this.modelValue)\n\t\t},\n\n\t\t/** @return {string} The placeholder of a secret that is stored. */\n\t\tsecretSetPlaceholder() {\n\t\t\treturn t('nextcloud-vue', 'Stored. Type a new value to replace it.')\n\t\t},\n\n\t\t/**\n\t\t * The select options as `{ label, value }`: the static `options` (strings,\n\t\t * numbers or objects), or those read from `optionsUrl`.\n\t\t *\n\t\t * @return {Array<{label: string, value: (string|number|boolean)}>}\n\t\t */\n\t\tnormalizedOptions() {\n\t\t\tconst raw = Array.isArray(this.field.options) ? this.field.options : (this.fetchedOptions || [])\n\t\t\treturn raw.map((option) => (option && typeof option === 'object'\n\t\t\t\t? { ...option, label: String(option.label ?? option.value ?? ''), value: option.value }\n\t\t\t\t: { label: String(option), value: option }))\n\t\t},\n\n\t\t/** @return {object|null} The option the value selects, for NcSelect. */\n\t\tselectedOption() {\n\t\t\tif (this.modelValue === null || this.modelValue === undefined || this.modelValue === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn this.normalizedOptions.find((option) => option.value === this.modelValue)\n\t\t\t\t|| { label: String(this.modelValue), value: this.modelValue }\n\t\t},\n\t},\n\n\twatch: {\n\t\t'field.optionsUrl': {\n\t\t\thandler() {\n\t\t\t\tthis.loadOptions()\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Upload a chosen image to `uploadUrl` as multipart form data (the\n\t\t * file under `uploadField`, default `image`, plus `uploadParams`), then\n\t\t * take the new image url from the answer at `uploadValuePath` (or a\n\t\t * cache-busted `previewUrl`).\n\t\t *\n\t\t * @param {File|undefined} file The chosen file.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-an-image-field-uploads-at-once\n\t\t */\n\t\tasync upload(file) {\n\t\t\tif (!file || !this.field.uploadUrl) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst form = new FormData()\n\t\t\tfor (const [name, value] of Object.entries(this.field.uploadParams || {})) {\n\t\t\t\tform.append(name, value)\n\t\t\t}\n\t\t\tform.append(this.field.uploadField || 'image', file)\n\t\t\tthis.uploading = true\n\t\t\tthis.uploadError = ''\n\t\t\ttry {\n\t\t\t\tconst response = await axios.post(prefixUrl(this.field.uploadUrl), form)\n\t\t\t\tconst fromAnswer = this.field.uploadValuePath ? readPath(response?.data, this.field.uploadValuePath) : ''\n\t\t\t\tconst next = fromAnswer || (this.field.previewUrl ? `${prefixUrl(this.field.previewUrl)}${this.field.previewUrl.includes('?') ? '&' : '?'}v=${Date.now()}` : '')\n\t\t\t\t/**\n\t\t\t\t * @event uploaded An image was uploaded. Payload: its new url.\n\t\t\t\t */\n\t\t\t\tthis.$emit('uploaded', next)\n\t\t\t} catch (error) {\n\t\t\t\tthis.uploadError = t('nextcloud-vue', 'The image could not be uploaded: {reason}', { reason: serverErrorMessage(error) })\n\t\t\t} finally {\n\t\t\t\tthis.uploading = false\n\t\t\t\tif (this.$refs.file) {\n\t\t\t\t\tthis.$refs.file.value = ''\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Report a new value.\n\t\t *\n\t\t * @param {unknown} value The value.\n\t\t * @return {void}\n\t\t */\n\t\temitValue(value) {\n\t\t\t/**\n\t\t\t * @event update:modelValue The value changed. Payload: the new value.\n\t\t\t */\n\t\t\tthis.$emit('update:modelValue', value)\n\t\t},\n\n\t\t/**\n\t\t * The storable value of what NcSelect emits.\n\t\t *\n\t\t * @param {object|string|number|null} emitted An option, or null on clear.\n\t\t * @return {string|number|boolean|null}\n\t\t */\n\t\toptionValue(emitted) {\n\t\t\tif (emitted === null || emitted === undefined) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn typeof emitted === 'object' && 'value' in emitted ? emitted.value : emitted\n\t\t},\n\n\t\t/**\n\t\t * Read a sourced select's options: a list (or the list at\n\t\t * `optionsPath`, or under `results`) mapped through `optionLabel` and\n\t\t * `optionValue` (dotted paths; default `label`/`title`/`name` and `value`/`id`).\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadOptions() {\n\t\t\tconst url = this.kind === 'select' && !Array.isArray(this.field.options) ? this.field.optionsUrl : ''\n\t\t\tif (!url) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.optionsLoading = true\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(prefixUrl(url), { headers: buildHeaders() })\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthis.fetchedOptions = []\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst data = await response.json()\n\t\t\t\tconst list = this.field.optionsPath ? readPath(data, this.field.optionsPath) : (Array.isArray(data) ? data : data?.results)\n\t\t\t\tthis.fetchedOptions = (Array.isArray(list) ? list : []).map((item) => {\n\t\t\t\t\tif (!item || typeof item !== 'object') {\n\t\t\t\t\t\treturn { label: String(item), value: item }\n\t\t\t\t\t}\n\t\t\t\t\tconst value = this.field.optionValue ? readPath(item, this.field.optionValue) : (item.value ?? item.id)\n\t\t\t\t\tconst label = this.field.optionLabel ? readPath(item, this.field.optionLabel) : (item.label ?? item.title ?? item.name ?? value)\n\t\t\t\t\treturn { label: String(label ?? ''), value }\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\tthis.fetchedOptions = []\n\t\t\t} finally {\n\t\t\t\tthis.optionsLoading = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-settings-field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmin-width: 0;\n}\n\n.cn-settings-field__hint,\n.cn-settings-field__error {\n\tmargin: 0;\n\tfont-size: 13px;\n\tline-height: 1.4;\n}\n\n.cn-settings-field__image {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-settings-field__image-label {\n\tfont-weight: 600;\n}\n\n.cn-settings-field__image-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 12px;\n}\n\n.cn-settings-field__image-tile {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 64px;\n\theight: 64px;\n\toverflow: hidden;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large);\n\tbackground: var(--color-primary-element-light);\n}\n\n.cn-settings-field__image-tile img {\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tobject-fit: contain;\n}\n\n.cn-settings-field__image-initials {\n\tfont-size: 20px;\n\tfont-weight: 700;\n\tcolor: var(--color-primary-element-light-text, var(--color-primary-element));\n}\n\n.cn-settings-field__hint {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-settings-field__error {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n</style>\n"],"names":["t","axios"],"mappings":";;;;;;;AAmIA,IAAI,QAAO,GAAI,EAAA;;AAEf;AACA,MAAM,YAAW,GAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAO,GAAA;;AAEtD;;;;AAIC;AACA;AACA;;AAEA;;;;AAIA;AACA;AACA;AACA;;AAEA;;AAED,aAAe;CACd,IAAI,EAAE,iBAAiB;;AAEvB,CAAA,UAAU,EAAE,EAAE,QAAQ,EAAE,qBAAqB,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa;;AAEjG,CAAA,KAAK,EAAE;AACN;;AAEC;;AAEA;;;AAGD,EAAA,KAAK,EAAE;GACN,IAAI,EAAE,MAAM;GACZ,QAAQ,EAAE,IAAI;GACd;;AAED;;;;EAIA,UAAU,EAAE;AACX,GAAA,IAAI,EAAE,IAAI;GACV,OAAO,EAAE,IAAI;GACb;;;AAGD,EAAA,KAAK,EAAE;GACN,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;;EAGD,IAAI,EAAE;GACL,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;EACD;;AAED,CAAA,KAAK,EAAE,CAAC,mBAAmB,EAAE,UA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,CAAC,cAAa,GAAI,GAAC;AACxB,IAAA,SAAU;IACT,IAAI,CAAC,iBAAiB,MAAI;AAC3B,IAAA;GACA;EACD;AACF;;;;"}
@@ -1,4 +1,4 @@
1
- import { resolveComponent, openBlock, createElementBlock, createBlock, withCtx, createTextVNode, toDisplayString, createElementVNode, createSlots, createVNode, createCommentVNode } from 'vue';
1
+ import { resolveComponent, openBlock, createElementBlock, createBlock, withCtx, createTextVNode, toDisplayString, createElementVNode, normalizeClass, createSlots, createVNode, createCommentVNode } from 'vue';
2
2
 
3
3
  const _hoisted_1 = ["data-testid"];
4
4
  const _hoisted_2 = ["aria-labelledby"];
@@ -50,8 +50,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
50
50
  }, [
51
51
  createElementVNode("span", {
52
52
  id: `${$options.inputId}-label`,
53
- class: "cn-settings-field__image-label"
54
- }, toDisplayString($options.label), 9 /* TEXT, PROPS */, _hoisted_3),
53
+ class: normalizeClass(["cn-settings-field__image-label", { 'hidden-visually': $props.field.hideLabel === true }])
54
+ }, toDisplayString($options.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_3),
55
55
  createElementVNode("div", _hoisted_4, [
56
56
  createElementVNode("span", {
57
57
  class: "cn-settings-field__image-tile",
@@ -1 +1 @@
1
- {"version":3,"file":"CnSettingsField.vue3.js","sources":["../../../../src/components/CnSettingsField/CnSettingsField.vue?vue&type=template&id=d2218996&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-settings-field\" :data-testid=\"`cn-settings-field-${field.key}`\">\n\t\t<NcCheckboxRadioSwitch\n\t\t\tv-if=\"kind === 'switch' || kind === 'boolean'\"\n\t\t\t:type=\"kind === 'switch' ? 'switch' : 'checkbox'\"\n\t\t\t:modelValue=\"!!modelValue\"\n\t\t\t:disabled=\"field.readOnly\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\">\n\t\t\t{{ label }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<div v-else-if=\"kind === 'image'\"\n\t\t\tclass=\"cn-settings-field__image\"\n\t\t\trole=\"group\"\n\t\t\t:aria-labelledby=\"`${inputId}-label`\">\n\t\t\t<span :id=\"`${inputId}-label`\" class=\"cn-settings-field__image-label\">{{ label }}</span>\n\t\t\t<div class=\"cn-settings-field__image-row\">\n\t\t\t\t<span class=\"cn-settings-field__image-tile\" :data-testid=\"`cn-settings-field-image-${field.key}`\">\n\t\t\t\t\t<img v-if=\"stringValue\" :src=\"stringValue\" :alt=\"t('nextcloud-vue', 'Current {name}', { name: label })\">\n\t\t\t\t\t<span v-else class=\"cn-settings-field__image-initials\" aria-hidden=\"true\">{{ field.initials || '' }}</span>\n\t\t\t\t</span>\n\t\t\t\t<input\n\t\t\t\t\t:id=\"inputId\"\n\t\t\t\t\tref=\"file\"\n\t\t\t\t\tclass=\"hidden-visually\"\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t:accept=\"field.accept || 'image/*'\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t:aria-labelledby=\"`${inputId}-label`\"\n\t\t\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t\t\t@change=\"upload($event.target.files && $event.target.files[0])\">\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"!field.readOnly && field.uploadUrl\"\n\t\t\t\t\t:disabled=\"uploading\"\n\t\t\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t\t\t:data-testid=\"`cn-settings-field-upload-${field.key}`\"\n\t\t\t\t\t@click=\"$refs.file && $refs.file.click()\">\n\t\t\t\t\t<template v-if=\"uploading\" #icon>\n\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ field.uploadLabel || t('nextcloud-vue', 'Upload {name}', { name: label }) }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</div>\n\t\t<NcSelect\n\t\t\tv-else-if=\"kind === 'select'\"\n\t\t\t:inputId=\"inputId\"\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"normalizedOptions\"\n\t\t\t:inputLabel=\"label\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:loading=\"optionsLoading\"\n\t\t\t:disabled=\"field.readOnly\"\n\t\t\t:clearable=\"!field.required\"\n\t\t\tlabel=\"label\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue(optionValue($event))\" />\n\t\t<NcTextArea\n\t\t\tv-else-if=\"kind === 'textarea'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:rows=\"field.rows || 4\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<NcTextField\n\t\t\tv-else-if=\"kind === 'secret'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"password\"\n\t\t\tautocomplete=\"new-password\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:placeholder=\"field.secretSet ? secretSetPlaceholder : (field.placeholder || '')\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<NcTextField\n\t\t\tv-else-if=\"kind === 'number'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"number\"\n\t\t\t:min=\"field.min\"\n\t\t\t:max=\"field.max\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event === '' ? null : Number($event))\" />\n\t\t<NcTextField\n\t\t\tv-else\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\t:type=\"kind === 'password' ? 'password' : 'text'\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<p v-if=\"shownError\"\n\t\t\t:id=\"`${inputId}-error`\"\n\t\t\tclass=\"cn-settings-field__error\"\n\t\t\t:data-testid=\"`cn-settings-field-error-${field.key}`\">\n\t\t\t{{ shownError }}\n\t\t</p>\n\t\t<p v-else-if=\"hint\" :id=\"`${inputId}-hint`\" class=\"cn-settings-field__hint\">\n\t\t\t{{ hint }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcCheckboxRadioSwitch, NcLoadingIcon, NcSelect, NcTextArea, NcTextField } from '@nextcloud/vue'\nimport { buildHeaders, prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { serverErrorMessage } from '../../utils/serverErrorMessage.js'\n\nlet fieldUid = 0\n\n/** Field types and the names CnSettingsPage's manifest uses for them. */\nconst KIND_ALIASES = { enum: 'select', string: 'text' }\n\n/**\n * CnSettingsField - one settings field: the control for its type with its\n * label, and under it an error or a hint. Shared by CnSettingsPage and\n * CnSettingsFieldsSection.\n *\n * Types: `text` (default), `textarea`, `number`, `switch`, `boolean` (a checkbox),\n * `select` (`enum`) with static `options` or options read from `optionsUrl`,\n * `password` (a masked input that shows its value back) and `secret`\n * (replace-only: the input stays empty, and with `secretSet` says a value is\n * stored; the host sends it only when something is typed), and `image` (a\n * preview tile, the initials without an image, and an upload button that\n * posts the file to `uploadUrl` at once and emits `uploaded`).\n *\n * ```vue\n * <CnSettingsField\n * :field=\"{ key: 'apiKey', label: 'API key', type: 'secret', secretSet: true }\"\n * v-model=\"form.apiKey\" />\n * ```\n */\nexport default {\n\tname: 'CnSettingsField',\n\n\tcomponents: { NcButton, NcCheckboxRadioSwitch, NcLoadingIcon, NcSelect, NcTextArea, NcTextField },\n\n\tprops: {\n\t\t/**\n\t\t * The field: `{ key, label, type?, options?, optionsUrl?, optionsPath?,\n\t\t * optionLabel?, optionValue?, placeholder?, rows?, min?, max?, required?,\n\t\t * readOnly?, secretSet? }`. `label` arrives translated.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tfield: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * The value: text, a number, a boolean or a select value. Any type,\n\t\t * because a Boolean in a type list would read an empty string as true.\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: null,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** A validation message, drawn under the control and tied to it. */\n\t\terror: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A hint under the control (not drawn while there is an error). */\n\t\thint: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'uploaded'],\n\n\tdata() {\n\t\tfieldUid += 1\n\t\treturn {\n\t\t\tuid: fieldUid,\n\t\t\tfetchedOptions: null,\n\t\t\toptionsLoading: false,\n\t\t\tuploading: false,\n\t\t\tuploadError: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The control kind. */\n\t\tkind() {\n\t\t\tconst type = String(this.field.type || 'text')\n\t\t\treturn KIND_ALIASES[type] || type\n\t\t},\n\n\t\t/** @return {string} The label. */\n\t\tlabel() {\n\t\t\treturn String(this.field.label || this.field.key || '')\n\t\t},\n\n\t\t/** @return {string} The control's id. */\n\t\tinputId() {\n\t\t\treturn `cn-settings-field-${this.uid}-${String(this.field.key).replace(/[^A-Za-z0-9_-]/g, '-')}`\n\t\t},\n\n\t\t/** @return {string} The message shown under the control: an upload failure, else `error`. */\n\t\tshownError() {\n\t\t\treturn this.uploadError || this.error\n\t\t},\n\n\t\t/** @return {string|null} The id of the error or hint the control is described by. */\n\t\tdescribedBy() {\n\t\t\tif (this.shownError) {\n\t\t\t\treturn `${this.inputId}-error`\n\t\t\t}\n\t\t\treturn this.hint ? `${this.inputId}-hint` : null\n\t\t},\n\n\t\t/** @return {string} The value as text for a text control. */\n\t\tstringValue() {\n\t\t\treturn this.modelValue === null || this.modelValue === undefined ? '' : String(this.modelValue)\n\t\t},\n\n\t\t/** @return {string} The placeholder of a secret that is stored. */\n\t\tsecretSetPlaceholder() {\n\t\t\treturn t('nextcloud-vue', 'Stored. Type a new value to replace it.')\n\t\t},\n\n\t\t/**\n\t\t * The select options as `{ label, value }`: the static `options` (strings,\n\t\t * numbers or objects), or those read from `optionsUrl`.\n\t\t *\n\t\t * @return {Array<{label: string, value: (string|number|boolean)}>}\n\t\t */\n\t\tnormalizedOptions() {\n\t\t\tconst raw = Array.isArray(this.field.options) ? this.field.options : (this.fetchedOptions || [])\n\t\t\treturn raw.map((option) => (option && typeof option === 'object'\n\t\t\t\t? { ...option, label: String(option.label ?? option.value ?? ''), value: option.value }\n\t\t\t\t: { label: String(option), value: option }))\n\t\t},\n\n\t\t/** @return {object|null} The option the value selects, for NcSelect. */\n\t\tselectedOption() {\n\t\t\tif (this.modelValue === null || this.modelValue === undefined || this.modelValue === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn this.normalizedOptions.find((option) => option.value === this.modelValue)\n\t\t\t\t|| { label: String(this.modelValue), value: this.modelValue }\n\t\t},\n\t},\n\n\twatch: {\n\t\t'field.optionsUrl': {\n\t\t\thandler() {\n\t\t\t\tthis.loadOptions()\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Upload a chosen image to `uploadUrl` as multipart form data (the\n\t\t * file under `uploadField`, default `image`, plus `uploadParams`), then\n\t\t * take the new image url from the answer at `uploadValuePath` (or a\n\t\t * cache-busted `previewUrl`).\n\t\t *\n\t\t * @param {File|undefined} file The chosen file.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-an-image-field-uploads-at-once\n\t\t */\n\t\tasync upload(file) {\n\t\t\tif (!file || !this.field.uploadUrl) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst form = new FormData()\n\t\t\tfor (const [name, value] of Object.entries(this.field.uploadParams || {})) {\n\t\t\t\tform.append(name, value)\n\t\t\t}\n\t\t\tform.append(this.field.uploadField || 'image', file)\n\t\t\tthis.uploading = true\n\t\t\tthis.uploadError = ''\n\t\t\ttry {\n\t\t\t\tconst response = await axios.post(prefixUrl(this.field.uploadUrl), form)\n\t\t\t\tconst fromAnswer = this.field.uploadValuePath ? readPath(response?.data, this.field.uploadValuePath) : ''\n\t\t\t\tconst next = fromAnswer || (this.field.previewUrl ? `${prefixUrl(this.field.previewUrl)}${this.field.previewUrl.includes('?') ? '&' : '?'}v=${Date.now()}` : '')\n\t\t\t\t/**\n\t\t\t\t * @event uploaded An image was uploaded. Payload: its new url.\n\t\t\t\t */\n\t\t\t\tthis.$emit('uploaded', next)\n\t\t\t} catch (error) {\n\t\t\t\tthis.uploadError = t('nextcloud-vue', 'The image could not be uploaded: {reason}', { reason: serverErrorMessage(error) })\n\t\t\t} finally {\n\t\t\t\tthis.uploading = false\n\t\t\t\tif (this.$refs.file) {\n\t\t\t\t\tthis.$refs.file.value = ''\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Report a new value.\n\t\t *\n\t\t * @param {unknown} value The value.\n\t\t * @return {void}\n\t\t */\n\t\temitValue(value) {\n\t\t\t/**\n\t\t\t * @event update:modelValue The value changed. Payload: the new value.\n\t\t\t */\n\t\t\tthis.$emit('update:modelValue', value)\n\t\t},\n\n\t\t/**\n\t\t * The storable value of what NcSelect emits.\n\t\t *\n\t\t * @param {object|string|number|null} emitted An option, or null on clear.\n\t\t * @return {string|number|boolean|null}\n\t\t */\n\t\toptionValue(emitted) {\n\t\t\tif (emitted === null || emitted === undefined) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn typeof emitted === 'object' && 'value' in emitted ? emitted.value : emitted\n\t\t},\n\n\t\t/**\n\t\t * Read a sourced select's options: a list (or the list at\n\t\t * `optionsPath`, or under `results`) mapped through `optionLabel` and\n\t\t * `optionValue` (dotted paths; default `label`/`title`/`name` and `value`/`id`).\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadOptions() {\n\t\t\tconst url = this.kind === 'select' && !Array.isArray(this.field.options) ? this.field.optionsUrl : ''\n\t\t\tif (!url) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.optionsLoading = true\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(prefixUrl(url), { headers: buildHeaders() })\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthis.fetchedOptions = []\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst data = await response.json()\n\t\t\t\tconst list = this.field.optionsPath ? readPath(data, this.field.optionsPath) : (Array.isArray(data) ? data : data?.results)\n\t\t\t\tthis.fetchedOptions = (Array.isArray(list) ? list : []).map((item) => {\n\t\t\t\t\tif (!item || typeof item !== 'object') {\n\t\t\t\t\t\treturn { label: String(item), value: item }\n\t\t\t\t\t}\n\t\t\t\t\tconst value = this.field.optionValue ? readPath(item, this.field.optionValue) : (item.value ?? item.id)\n\t\t\t\t\tconst label = this.field.optionLabel ? readPath(item, this.field.optionLabel) : (item.label ?? item.title ?? item.name ?? value)\n\t\t\t\t\treturn { label: String(label ?? ''), value }\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\tthis.fetchedOptions = []\n\t\t\t} finally {\n\t\t\t\tthis.optionsLoading = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-settings-field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmin-width: 0;\n}\n\n.cn-settings-field__hint,\n.cn-settings-field__error {\n\tmargin: 0;\n\tfont-size: 13px;\n\tline-height: 1.4;\n}\n\n.cn-settings-field__image {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-settings-field__image-label {\n\tfont-weight: 600;\n}\n\n.cn-settings-field__image-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 12px;\n}\n\n.cn-settings-field__image-tile {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 64px;\n\theight: 64px;\n\toverflow: hidden;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large);\n\tbackground: var(--color-primary-element-light);\n}\n\n.cn-settings-field__image-tile img {\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tobject-fit: contain;\n}\n\n.cn-settings-field__image-initials {\n\tfont-size: 20px;\n\tfont-weight: 700;\n\tcolor: var(--color-primary-element-light-text, var(--color-primary-element));\n}\n\n.cn-settings-field__hint {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-settings-field__error {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n</style>\n"],"names":["_createBlock","_createElementBlock","_createElementVNode","_openBlock","_toDisplayString","_createTextVNode","_createVNode"],"mappings":";;;;;AA0BQ,MAAA,UAAA,GAAA,EAAA,KAAC,EAAA,8BAAA,GAAA;;;;;AAGS,EAAA,KAAK,EAAC,mCAAG;AAAA,EAAA,aAAA,EAAA,MAAA;;;;;;;;;;;;;;;AAlBrB,IAAA,KAAK,EAAC,mBAAgB;IAAA,aAAA,EAAA,CAAA,kBAAA,EAAA,MAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA;;AAEnB,IAAA,CAAA,QAAA,CAAA,IAAI,iBAAiB,QAAI,CAAA,IAAA,KAAA,SAAA;sBAD/BA,WAQuB,CAAA,gCAAA,EA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type=template&id=7acf5300&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-settings-field\" :data-testid=\"`cn-settings-field-${field.key}`\">\n\t\t<NcCheckboxRadioSwitch\n\t\t\tv-if=\"kind === 'switch' || kind === 'boolean'\"\n\t\t\t:type=\"kind === 'switch' ? 'switch' : 'checkbox'\"\n\t\t\t:modelValue=\"!!modelValue\"\n\t\t\t:disabled=\"field.readOnly\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\">\n\t\t\t{{ label }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<div v-else-if=\"kind === 'image'\"\n\t\t\tclass=\"cn-settings-field__image\"\n\t\t\trole=\"group\"\n\t\t\t:aria-labelledby=\"`${inputId}-label`\">\n\t\t\t<!-- `hideLabel` keeps the name for a screen reader only. -->\n\t\t\t<span :id=\"`${inputId}-label`\"\n\t\t\t\tclass=\"cn-settings-field__image-label\"\n\t\t\t\t:class=\"{ 'hidden-visually': field.hideLabel === true }\">{{ label }}</span>\n\t\t\t<div class=\"cn-settings-field__image-row\">\n\t\t\t\t<span class=\"cn-settings-field__image-tile\" :data-testid=\"`cn-settings-field-image-${field.key}`\">\n\t\t\t\t\t<img v-if=\"stringValue\" :src=\"stringValue\" :alt=\"t('nextcloud-vue', 'Current {name}', { name: label })\">\n\t\t\t\t\t<span v-else class=\"cn-settings-field__image-initials\" aria-hidden=\"true\">{{ field.initials || '' }}</span>\n\t\t\t\t</span>\n\t\t\t\t<input\n\t\t\t\t\t:id=\"inputId\"\n\t\t\t\t\tref=\"file\"\n\t\t\t\t\tclass=\"hidden-visually\"\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t:accept=\"field.accept || 'image/*'\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t:aria-labelledby=\"`${inputId}-label`\"\n\t\t\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t\t\t@change=\"upload($event.target.files && $event.target.files[0])\">\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"!field.readOnly && field.uploadUrl\"\n\t\t\t\t\t:disabled=\"uploading\"\n\t\t\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t\t\t:data-testid=\"`cn-settings-field-upload-${field.key}`\"\n\t\t\t\t\t@click=\"$refs.file && $refs.file.click()\">\n\t\t\t\t\t<template v-if=\"uploading\" #icon>\n\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ field.uploadLabel || t('nextcloud-vue', 'Upload {name}', { name: label }) }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</div>\n\t\t<NcSelect\n\t\t\tv-else-if=\"kind === 'select'\"\n\t\t\t:inputId=\"inputId\"\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"normalizedOptions\"\n\t\t\t:inputLabel=\"label\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:loading=\"optionsLoading\"\n\t\t\t:disabled=\"field.readOnly\"\n\t\t\t:clearable=\"!field.required\"\n\t\t\tlabel=\"label\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue(optionValue($event))\" />\n\t\t<NcTextArea\n\t\t\tv-else-if=\"kind === 'textarea'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:rows=\"field.rows || 4\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<NcTextField\n\t\t\tv-else-if=\"kind === 'secret'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"password\"\n\t\t\tautocomplete=\"new-password\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:placeholder=\"field.secretSet ? secretSetPlaceholder : (field.placeholder || '')\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<NcTextField\n\t\t\tv-else-if=\"kind === 'number'\"\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\ttype=\"number\"\n\t\t\t:min=\"field.min\"\n\t\t\t:max=\"field.max\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event === '' ? null : Number($event))\" />\n\t\t<NcTextField\n\t\t\tv-else\n\t\t\t:id=\"inputId\"\n\t\t\t:label=\"label\"\n\t\t\t:type=\"kind === 'password' ? 'password' : 'text'\"\n\t\t\t:modelValue=\"stringValue\"\n\t\t\t:placeholder=\"field.placeholder || ''\"\n\t\t\t:readonly=\"field.readOnly\"\n\t\t\t:error=\"!!error\"\n\t\t\t:aria-describedby=\"describedBy\"\n\t\t\t@update:modelValue=\"emitValue($event)\" />\n\t\t<p v-if=\"shownError\"\n\t\t\t:id=\"`${inputId}-error`\"\n\t\t\tclass=\"cn-settings-field__error\"\n\t\t\t:data-testid=\"`cn-settings-field-error-${field.key}`\">\n\t\t\t{{ shownError }}\n\t\t</p>\n\t\t<p v-else-if=\"hint\" :id=\"`${inputId}-hint`\" class=\"cn-settings-field__hint\">\n\t\t\t{{ hint }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcCheckboxRadioSwitch, NcLoadingIcon, NcSelect, NcTextArea, NcTextField } from '@nextcloud/vue'\nimport { buildHeaders, prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { serverErrorMessage } from '../../utils/serverErrorMessage.js'\n\nlet fieldUid = 0\n\n/** Field types and the names CnSettingsPage's manifest uses for them. */\nconst KIND_ALIASES = { enum: 'select', string: 'text' }\n\n/**\n * CnSettingsField - one settings field: the control for its type with its\n * label, and under it an error or a hint. Shared by CnSettingsPage and\n * CnSettingsFieldsSection.\n *\n * Types: `text` (default), `textarea`, `number`, `switch`, `boolean` (a checkbox),\n * `select` (`enum`) with static `options` or options read from `optionsUrl`,\n * `password` (a masked input that shows its value back) and `secret`\n * (replace-only: the input stays empty, and with `secretSet` says a value is\n * stored; the host sends it only when something is typed), and `image` (a\n * preview tile, the initials without an image, and an upload button that\n * posts the file to `uploadUrl` at once and emits `uploaded`).\n *\n * ```vue\n * <CnSettingsField\n * :field=\"{ key: 'apiKey', label: 'API key', type: 'secret', secretSet: true }\"\n * v-model=\"form.apiKey\" />\n * ```\n */\nexport default {\n\tname: 'CnSettingsField',\n\n\tcomponents: { NcButton, NcCheckboxRadioSwitch, NcLoadingIcon, NcSelect, NcTextArea, NcTextField },\n\n\tprops: {\n\t\t/**\n\t\t * The field: `{ key, label, type?, options?, optionsUrl?, optionsPath?,\n\t\t * optionLabel?, optionValue?, placeholder?, rows?, min?, max?, required?,\n\t\t * readOnly?, secretSet? }`. `label` arrives translated.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tfield: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * The value: text, a number, a boolean or a select value. Any type,\n\t\t * because a Boolean in a type list would read an empty string as true.\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: null,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** A validation message, drawn under the control and tied to it. */\n\t\terror: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A hint under the control (not drawn while there is an error). */\n\t\thint: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'uploaded'],\n\n\tdata() {\n\t\tfieldUid += 1\n\t\treturn {\n\t\t\tuid: fieldUid,\n\t\t\tfetchedOptions: null,\n\t\t\toptionsLoading: false,\n\t\t\tuploading: false,\n\t\t\tuploadError: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The control kind. */\n\t\tkind() {\n\t\t\tconst type = String(this.field.type || 'text')\n\t\t\treturn KIND_ALIASES[type] || type\n\t\t},\n\n\t\t/** @return {string} The label. */\n\t\tlabel() {\n\t\t\treturn String(this.field.label || this.field.key || '')\n\t\t},\n\n\t\t/** @return {string} The control's id. */\n\t\tinputId() {\n\t\t\treturn `cn-settings-field-${this.uid}-${String(this.field.key).replace(/[^A-Za-z0-9_-]/g, '-')}`\n\t\t},\n\n\t\t/** @return {string} The message shown under the control: an upload failure, else `error`. */\n\t\tshownError() {\n\t\t\treturn this.uploadError || this.error\n\t\t},\n\n\t\t/** @return {string|null} The id of the error or hint the control is described by. */\n\t\tdescribedBy() {\n\t\t\tif (this.shownError) {\n\t\t\t\treturn `${this.inputId}-error`\n\t\t\t}\n\t\t\treturn this.hint ? `${this.inputId}-hint` : null\n\t\t},\n\n\t\t/** @return {string} The value as text for a text control. */\n\t\tstringValue() {\n\t\t\treturn this.modelValue === null || this.modelValue === undefined ? '' : String(this.modelValue)\n\t\t},\n\n\t\t/** @return {string} The placeholder of a secret that is stored. */\n\t\tsecretSetPlaceholder() {\n\t\t\treturn t('nextcloud-vue', 'Stored. Type a new value to replace it.')\n\t\t},\n\n\t\t/**\n\t\t * The select options as `{ label, value }`: the static `options` (strings,\n\t\t * numbers or objects), or those read from `optionsUrl`.\n\t\t *\n\t\t * @return {Array<{label: string, value: (string|number|boolean)}>}\n\t\t */\n\t\tnormalizedOptions() {\n\t\t\tconst raw = Array.isArray(this.field.options) ? this.field.options : (this.fetchedOptions || [])\n\t\t\treturn raw.map((option) => (option && typeof option === 'object'\n\t\t\t\t? { ...option, label: String(option.label ?? option.value ?? ''), value: option.value }\n\t\t\t\t: { label: String(option), value: option }))\n\t\t},\n\n\t\t/** @return {object|null} The option the value selects, for NcSelect. */\n\t\tselectedOption() {\n\t\t\tif (this.modelValue === null || this.modelValue === undefined || this.modelValue === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn this.normalizedOptions.find((option) => option.value === this.modelValue)\n\t\t\t\t|| { label: String(this.modelValue), value: this.modelValue }\n\t\t},\n\t},\n\n\twatch: {\n\t\t'field.optionsUrl': {\n\t\t\thandler() {\n\t\t\t\tthis.loadOptions()\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Upload a chosen image to `uploadUrl` as multipart form data (the\n\t\t * file under `uploadField`, default `image`, plus `uploadParams`), then\n\t\t * take the new image url from the answer at `uploadValuePath` (or a\n\t\t * cache-busted `previewUrl`).\n\t\t *\n\t\t * @param {File|undefined} file The chosen file.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-an-image-field-uploads-at-once\n\t\t */\n\t\tasync upload(file) {\n\t\t\tif (!file || !this.field.uploadUrl) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst form = new FormData()\n\t\t\tfor (const [name, value] of Object.entries(this.field.uploadParams || {})) {\n\t\t\t\tform.append(name, value)\n\t\t\t}\n\t\t\tform.append(this.field.uploadField || 'image', file)\n\t\t\tthis.uploading = true\n\t\t\tthis.uploadError = ''\n\t\t\ttry {\n\t\t\t\tconst response = await axios.post(prefixUrl(this.field.uploadUrl), form)\n\t\t\t\tconst fromAnswer = this.field.uploadValuePath ? readPath(response?.data, this.field.uploadValuePath) : ''\n\t\t\t\tconst next = fromAnswer || (this.field.previewUrl ? `${prefixUrl(this.field.previewUrl)}${this.field.previewUrl.includes('?') ? '&' : '?'}v=${Date.now()}` : '')\n\t\t\t\t/**\n\t\t\t\t * @event uploaded An image was uploaded. Payload: its new url.\n\t\t\t\t */\n\t\t\t\tthis.$emit('uploaded', next)\n\t\t\t} catch (error) {\n\t\t\t\tthis.uploadError = t('nextcloud-vue', 'The image could not be uploaded: {reason}', { reason: serverErrorMessage(error) })\n\t\t\t} finally {\n\t\t\t\tthis.uploading = false\n\t\t\t\tif (this.$refs.file) {\n\t\t\t\t\tthis.$refs.file.value = ''\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Report a new value.\n\t\t *\n\t\t * @param {unknown} value The value.\n\t\t * @return {void}\n\t\t */\n\t\temitValue(value) {\n\t\t\t/**\n\t\t\t * @event update:modelValue The value changed. Payload: the new value.\n\t\t\t */\n\t\t\tthis.$emit('update:modelValue', value)\n\t\t},\n\n\t\t/**\n\t\t * The storable value of what NcSelect emits.\n\t\t *\n\t\t * @param {object|string|number|null} emitted An option, or null on clear.\n\t\t * @return {string|number|boolean|null}\n\t\t */\n\t\toptionValue(emitted) {\n\t\t\tif (emitted === null || emitted === undefined) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn typeof emitted === 'object' && 'value' in emitted ? emitted.value : emitted\n\t\t},\n\n\t\t/**\n\t\t * Read a sourced select's options: a list (or the list at\n\t\t * `optionsPath`, or under `results`) mapped through `optionLabel` and\n\t\t * `optionValue` (dotted paths; default `label`/`title`/`name` and `value`/`id`).\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadOptions() {\n\t\t\tconst url = this.kind === 'select' && !Array.isArray(this.field.options) ? this.field.optionsUrl : ''\n\t\t\tif (!url) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.optionsLoading = true\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(prefixUrl(url), { headers: buildHeaders() })\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthis.fetchedOptions = []\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst data = await response.json()\n\t\t\t\tconst list = this.field.optionsPath ? readPath(data, this.field.optionsPath) : (Array.isArray(data) ? data : data?.results)\n\t\t\t\tthis.fetchedOptions = (Array.isArray(list) ? list : []).map((item) => {\n\t\t\t\t\tif (!item || typeof item !== 'object') {\n\t\t\t\t\t\treturn { label: String(item), value: item }\n\t\t\t\t\t}\n\t\t\t\t\tconst value = this.field.optionValue ? readPath(item, this.field.optionValue) : (item.value ?? item.id)\n\t\t\t\t\tconst label = this.field.optionLabel ? readPath(item, this.field.optionLabel) : (item.label ?? item.title ?? item.name ?? value)\n\t\t\t\t\treturn { label: String(label ?? ''), value }\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\tthis.fetchedOptions = []\n\t\t\t} finally {\n\t\t\t\tthis.optionsLoading = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-settings-field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmin-width: 0;\n}\n\n.cn-settings-field__hint,\n.cn-settings-field__error {\n\tmargin: 0;\n\tfont-size: 13px;\n\tline-height: 1.4;\n}\n\n.cn-settings-field__image {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-settings-field__image-label {\n\tfont-weight: 600;\n}\n\n.cn-settings-field__image-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 12px;\n}\n\n.cn-settings-field__image-tile {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 64px;\n\theight: 64px;\n\toverflow: hidden;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large);\n\tbackground: var(--color-primary-element-light);\n}\n\n.cn-settings-field__image-tile img {\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tobject-fit: contain;\n}\n\n.cn-settings-field__image-initials {\n\tfont-size: 20px;\n\tfont-weight: 700;\n\tcolor: var(--color-primary-element-light-text, var(--color-primary-element));\n}\n\n.cn-settings-field__hint {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-settings-field__error {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n</style>\n"],"names":["_createBlock","_normalizeClass","_createElementBlock","_openBlock","_toDisplayString","_createElementVNode","_createTextVNode","_createVNode"],"mappings":";;;;;AA6BQ,MAAA,UAAA,GAAA,EAAA,KAAC,EAAA,8BAAA,GAAA;;;;;AAGS,EAAA,KAAK,EAAC,mCAAG;AAAA,EAAA,aAAA,EAAA,MAAA;;;;;;;;;;;;;;;AArBrB,IAAA,KAAK,EAAC,mBAAgB;IAAA,aAAA,EAAA,CAAA,kBAAA,EAAA,MAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA;;AAEnB,IAAA,CAAA,QAAA,CAAA,IAAI,iBAAiB,QAAI,CAAA,IAAA,KAAA,SAAA;sBAD/BA,WAQuB,CAAA,gCAAA,EAAA;;AANtB,UAAA,IAAI,EAAE,QAAG,CAAA,IAAA,KAAA,QAAA,GAAA,QAAA,GAAA,UAAA;AACT,UAAA,UAAU,IAAI,MAAO,CAAA,UAAA;UACrB,QAAQ,EAAE,MAAK,CAAA,KAAA,CAAC,QAAQ;AACxB,UAAA,kBAAgB,EAAE,QAAW,CAAA,WAAA;UAC7B,qBAAU,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAA,QAAA,CAAA,SAAA,CAAA,MAAA,CAAA,CAAA,CAAA;;2BACX,MAAW;4CAAR,QAAK,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;;;;SAEO,QAAI,CAAA,IAAA,KAAA,OAAA;0CAmCd,CAAA,KAAA,EAAA;;AAlCJ,YAAA,KAAI,EAAC,0BAA0B;AAC/B,YAAA,IAAG,EAAC,OAAO;AACX,YAAA,iBAAe,KAAK,QAAO,CAAA,OAAA,CAAA,MAAA,CAAA;;8BAIrB,CAAA,MAAA,EAAA;AAFA,cAAA,EAAE,KAAK,QAAO,CAAA,OAAA,CAAA,MAAA,CAAA;mBACf,EAAAC,cAAA,CAAA,CAAA,gCAAiC,EAChC,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AC,QAAM;AACtB,oBAAA,KAAK,IAAI,MAAK,CAAA,KAAA;AACd,oBAAA,kBAAgB,EAAE,QAAW,CAAA,WAAA;oBAC7B,qBAAc,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAA,QAAA,CAAA,SAAA,CAAA,MAAA,CAAA,CAAA,CAAA;;KACb,QAAA,CAAA,UAAA;sBAAHE;;AACG,UAAA,EAAC,KAAK,QAAO,CAAA,OAAA,CAAA,MAAA,CAAA;AACf,UAAA,KAAK,EAAC,0BAAG;UACR,aAAC,EAAA,CAAA,wBAAA,EAAA,MAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA;2BACC,QAAA,CAAA,UAAA,CAAA,EAAA,CAAA,oBAAA,UAAA,CAAA;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnSetupWizard.vue2.js';
2
2
  import { render } from './CnSetupWizard.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-130330d9";
5
+ script.__scopeId = "data-v-dd2d6164";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };