@conduction/nextcloud-vue 2.151.0 → 2.153.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.
- package/dist/esm/components/CnAiCompanion/CnAiFloatingButton.vue2.js +13 -1
- package/dist/esm/components/CnAiCompanion/CnAiFloatingButton.vue2.js.map +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiFloatingButton.vue3.js +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiFloatingButton.vue3.js.map +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiInput.vue2.js.map +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiInput.vue3.js.map +1 -1
- package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue.js +1 -1
- package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue3.js +1 -1
- package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +30 -5
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
- package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue.js +1 -1
- package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js +38 -0
- package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue.js +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js +2 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue3.js +33 -25
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue3.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue.js +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js +22 -2
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue.js +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js +7 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnExportsWidget/CnExportsWidget.vue.js +1 -1
- package/dist/esm/components/CnExportsWidget/CnExportsWidget.vue2.js +2 -1
- package/dist/esm/components/CnExportsWidget/CnExportsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnExportsWidget/CnExportsWidget.vue3.js +6 -2
- package/dist/esm/components/CnExportsWidget/CnExportsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue.js +1 -1
- package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue2.js.map +1 -1
- package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue3.js.map +1 -1
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js +1 -1
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +3 -1
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js +31 -9
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +21 -3
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue.js +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js +20 -0
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue.js +1 -1
- package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js.map +1 -1
- package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js.map +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue.js +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue2.js +18 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue3.js +4 -2
- package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue.js +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue2.js +25 -3
- package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue2.js.map +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue3.js +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +31 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +102 -97
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue.js +1 -1
- package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue2.js +33 -0
- package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue2.js.map +1 -1
- package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js +2 -2
- package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js.map +1 -1
- package/dist/esm/components/CnSettingsField/CnSettingsField.vue.js +1 -1
- package/dist/esm/components/CnSettingsField/CnSettingsField.vue2.js +2 -1
- package/dist/esm/components/CnSettingsField/CnSettingsField.vue2.js.map +1 -1
- package/dist/esm/components/CnSettingsField/CnSettingsField.vue3.js +15 -13
- package/dist/esm/components/CnSettingsField/CnSettingsField.vue3.js.map +1 -1
- package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue.js +1 -1
- package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue2.js +27 -0
- package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue2.js.map +1 -1
- package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue3.js +6 -6
- package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue3.js.map +1 -1
- package/dist/esm/components/CnStepper/CnStepper.vue.js +1 -1
- package/dist/esm/components/CnStepper/CnStepper.vue2.js.map +1 -1
- package/dist/esm/components/CnStepper/CnStepper.vue3.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue.js +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js +14 -14
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js.map +1 -1
- package/dist/esm/composables/indexSources.js +4 -1
- package/dist/esm/composables/indexSources.js.map +1 -1
- package/dist/esm/l10n/en.json.js +30 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +31 -2
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +1129 -567
- package/dist/esm/utils/fillTemplate.js +12 -2
- package/dist/esm/utils/fillTemplate.js.map +1 -1
- package/dist/esm/utils/libraryTranslate.js +19 -1
- package/dist/esm/utils/libraryTranslate.js.map +1 -1
- package/dist/esm/utils/savedViewSummary.js +109 -4
- package/dist/esm/utils/savedViewSummary.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +1096 -592
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +1129 -567
- package/l10n/en.json +30 -1
- package/l10n/nl.json +31 -2
- package/package.json +1 -1
- package/src/components/CnAiCompanion/CnAiFloatingButton.vue +14 -2
- package/src/components/CnAiCompanion/CnAiInput.vue +19 -0
- package/src/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue +7 -1
- package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +30 -5
- package/src/components/CnBannerWidget/CnBannerWidget.vue +38 -0
- package/src/components/CnConversationThread/CnConversationThread.vue +7 -1
- package/src/components/CnConversationThread/CnConversationWidget.vue +22 -2
- package/src/components/CnDashboardPage/CnDashboardPage.vue +17 -0
- package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +16 -1
- package/src/components/CnExportsWidget/CnExportsWidget.vue +5 -1
- package/src/components/CnFeaturesBoard/CnFeaturesBoard.vue +2 -0
- package/src/components/CnFieldListWidget/CnFieldListWidget.vue +18 -4
- package/src/components/CnIndexPage/CnIndexPage.vue +21 -3
- package/src/components/CnMapWidget/CnMapWidget.vue +20 -0
- package/src/components/CnNotificationMatrix/CnNotificationMatrix.vue +23 -0
- package/src/components/CnPlanWidget/CnPlanWidget.vue +20 -1
- package/src/components/CnPlanWidget/CnPlanWidgetRow.vue +26 -4
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +73 -5
- package/src/components/CnSavedViewLookFields/CnSavedViewLookFields.vue +35 -2
- package/src/components/CnSettingsField/CnSettingsField.vue +5 -3
- package/src/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue +31 -4
- package/src/components/CnStepper/CnStepper.vue +7 -5
- package/src/components/CnTimelineWidget/CnTimelineManage.vue +9 -4
- package/src/composables/indexSources.js +4 -1
- package/src/css/dialog.css +18 -3
- package/src/css/form-field.css +11 -0
- package/src/css/look-board-detail.css +124 -1
- package/src/css/look-board-index.css +75 -9
- package/src/css/look-board.css +242 -6
- package/src/css/patches.css +5 -5
- package/src/utils/fillTemplate.js +12 -2
- package/src/utils/libraryTranslate.js +18 -0
- package/src/utils/savedViewSummary.js +109 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnSettingsFieldsSection.vue3.js","sources":["../../../../src/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue?vue&type=template&id=e6a15fa2&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<component\n\t\t:is=\"bare ? 'div' : 'CnSettingsSection'\"\n\t\tv-bind=\"bare ? { class: 'cn-settings-fields-section--bare' } : sectionProps\"\n\t\tdata-testid=\"cn-settings-fields-section\">\n\t\t<template v-if=\"bare\">\n\t\t\t<NcLoadingIcon v-if=\"loading\" :size=\"24\" data-testid=\"cn-settings-fields-loading\" />\n\t\t\t<NcNoteCard v-else-if=\"loadError !== ''\" type=\"error\" data-testid=\"cn-settings-fields-load-error\">\n\t\t\t\t{{ loadError }}\n\t\t\t</NcNoteCard>\n\t\t</template>\n\t\t<form v-if=\"!loading && loadError === ''\"\n\t\t\tclass=\"cn-settings-fields\"\n\t\t\tnovalidate\n\t\t\t@submit.prevent=\"save\">\n\t\t\t<div v-if=\"hintsToggle\" class=\"cn-settings-fields__hints-toggle\">\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t:aria-expanded=\"showHints ? 'true' : 'false'\"\n\t\t\t\t\tdata-testid=\"cn-settings-fields-hints-toggle\"\n\t\t\t\t\t@click=\"showHints = !showHints\">\n\t\t\t\t\t{{ showHints ? t('nextcloud-vue', 'Hide the explanations') : t('nextcloud-vue', 'Show the explanations') }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<!-- `saveInline`: the save button beside the form instead of\n\t\t\t under it (DqBeheerinstellingen Serviceaccount). -->\n\t\t\t<div v-if=\"inlineSave\"\n\t\t\t\tclass=\"cn-settings-fields__inline-row\"\n\t\t\t\tdata-testid=\"cn-settings-fields-inline-row\">\n\t\t\t\t<div class=\"cn-settings-fields__grid\" :class=\"`cn-settings-fields__grid--${columnCount}`\">\n\t\t\t\t\t<CnSettingsField\n\t\t\t\t\t\tv-for=\"field in mainFields\"\n\t\t\t\t\t\t:key=\"field.key\"\n\t\t\t\t\t\tclass=\"cn-settings-fields__field\"\n\t\t\t\t\t\t:class=\"{ 'cn-settings-fields__field--wide': field.wide || isFullWidth(field) }\"\n\t\t\t\t\t\t:field=\"field\"\n\t\t\t\t\t\t:modelValue=\"form[field.key]\"\n\t\t\t\t\t\t:error=\"errors[field.key] || unreadable[field.key] || ''\"\n\t\t\t\t\t\t:hint=\"field.hint\"\n\t\t\t\t\t\t@update:modelValue=\"setValue(field, $event)\"\n\t\t\t\t\t\t@uploaded=\"onUploaded(field, $event)\"\n\t\t\t\t\t\t@action=\"runAction(field)\" />\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cn-settings-fields__inline-save\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t:disabled=\"saving || !dirty\"\n\t\t\t\t\t\tdata-testid=\"cn-settings-fields-save\">\n\t\t\t\t\t\t<template v-if=\"saving\" #icon>\n\t\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ resolvedSaveLabel }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div v-else class=\"cn-settings-fields__grid\" :class=\"`cn-settings-fields__grid--${columnCount}`\">\n\t\t\t\t<CnSettingsField\n\t\t\t\t\tv-for=\"field in mainFields\"\n\t\t\t\t\t:key=\"field.key\"\n\t\t\t\t\tclass=\"cn-settings-fields__field\"\n\t\t\t\t\t:class=\"{ 'cn-settings-fields__field--wide': field.wide || isFullWidth(field) }\"\n\t\t\t\t\t:field=\"field\"\n\t\t\t\t\t:modelValue=\"form[field.key]\"\n\t\t\t\t\t:error=\"errors[field.key] || unreadable[field.key] || ''\"\n\t\t\t\t\t:hint=\"field.hint\"\n\t\t\t\t\t@update:modelValue=\"setValue(field, $event)\"\n\t\t\t\t\t@uploaded=\"onUploaded(field, $event)\"\n\t\t\t\t\t@clear=\"setClearing(field, $event)\"\n\t\t\t\t\t@action=\"runAction(field)\" />\n\t\t\t</div>\n\n\t\t\t<!-- The fields marked `advanced`, behind one disclosure after the\n\t\t\t rest (DqBeheerinstellingen Zaak-e-mail). Saved with the rest. -->\n\t\t\t<div v-if=\"advancedFields.length > 0\" class=\"cn-settings-fields__advanced\">\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t:aria-expanded=\"showAdvanced ? 'true' : 'false'\"\n\t\t\t\t\t:aria-controls=\"advancedId\"\n\t\t\t\t\tdata-testid=\"cn-settings-fields-advanced-toggle\"\n\t\t\t\t\t@click=\"showAdvanced = !showAdvanced\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<ChevronUp v-if=\"showAdvanced\" :size=\"20\" />\n\t\t\t\t\t\t<ChevronDown v-else :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ resolvedAdvancedLabel }}\n\t\t\t\t</NcButton>\n\t\t\t\t<div v-show=\"showAdvanced\"\n\t\t\t\t\t:id=\"advancedId\"\n\t\t\t\t\tclass=\"cn-settings-fields__grid\"\n\t\t\t\t\t:class=\"`cn-settings-fields__grid--${columnCount}`\"\n\t\t\t\t\tdata-testid=\"cn-settings-fields-advanced\">\n\t\t\t\t\t<CnSettingsField\n\t\t\t\t\t\tv-for=\"field in advancedFields\"\n\t\t\t\t\t\t:key=\"field.key\"\n\t\t\t\t\t\tclass=\"cn-settings-fields__field\"\n\t\t\t\t\t\t:class=\"{ 'cn-settings-fields__field--wide': field.wide || isFullWidth(field) }\"\n\t\t\t\t\t\t:field=\"field\"\n\t\t\t\t\t\t:modelValue=\"form[field.key]\"\n\t\t\t\t\t\t:error=\"errors[field.key] || unreadable[field.key] || ''\"\n\t\t\t\t\t\t:hint=\"field.hint\"\n\t\t\t\t\t\t@update:modelValue=\"setValue(field, $event)\"\n\t\t\t\t\t\t@uploaded=\"onUploaded(field, $event)\"\n\t\t\t\t\t\t@action=\"runAction(field)\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<NcNoteCard v-if=\"notice\"\n\t\t\t\t:type=\"notice.type\"\n\t\t\t\t:role=\"notice.type === 'error' ? 'alert' : 'status'\"\n\t\t\t\tdata-testid=\"cn-settings-fields-notice\">\n\t\t\t\t{{ notice.text }}\n\t\t\t</NcNoteCard>\n\n\t\t\t<div v-if=\"!autoSave && hasInputs && !inlineSave\" class=\"cn-settings-section__save cn-settings-fields__save\">\n\t\t\t\t<span v-if=\"dirty\" class=\"cn-settings-fields__dirty\" data-testid=\"cn-settings-fields-dirty\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Unsaved changes') }}\n\t\t\t\t</span>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t:disabled=\"saving || !dirty\"\n\t\t\t\t\tdata-testid=\"cn-settings-fields-save\">\n\t\t\t\t\t<template v-if=\"saving\" #icon>\n\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ resolvedSaveLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</form>\n\t</component>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { showConfirmation } from '@nextcloud/dialogs'\nimport { getCanonicalLocale, translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcLoadingIcon, NcNoteCard } from '@nextcloud/vue'\nimport ChevronDown from 'vue-material-design-icons/ChevronDown.vue'\nimport ChevronUp from 'vue-material-design-icons/ChevronUp.vue'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { serverErrorMessage } from '../../utils/serverErrorMessage.js'\nimport { CnSettingsField } from '../CnSettingsField/index.js'\nimport { CnSettingsSection } from '../CnSettingsSection/index.js'\n\n/**\n * A value by key: the key as written when the object holds it (a flat map\n * with dotted keys such as `integration.brk.mode`), else as a dotted path.\n *\n * @param {object} data The object.\n * @param {string} key The key or dotted path.\n * @return {unknown}\n */\nfunction literalFirst(data, key) {\n\tif (data && typeof data === 'object' && Object.hasOwn(data, key)) {\n\t\treturn data[key]\n\t}\n\treturn readPath(data, key)\n}\n\n/**\n * The request options for a target: an OCS endpoint (`/ocs/...`) needs the\n * `OCS-APIRequest` header; `prefixUrl` already serves it outside index.php.\n *\n * @param {string} url The target.\n * @return {object}\n */\nfunction ocsConfig(url) {\n\treturn /^\\/ocs\\//.test(String(url)) ? { headers: { 'OCS-APIRequest': 'true' } } : {}\n}\n\n/** Types that hold no value of their own: never read into the form's dirty state, checked or saved. */\n/** A time of day, `HH:MM`. */\nconst TIME = /^([01]\\d|2[0-3]):[0-5]\\d$/\n\nconst VALUELESS_TYPES = ['heading', 'status', 'action', 'note']\n\n/** Types whose value is a list of choices (a `select` with `multiple` too). */\nconst LIST_TYPES = ['checkboxes']\n\n/** Types drawn across the whole grid. */\nconst FULL_WIDTH_TYPES = ['heading', 'status']\n\n/**\n * Whether a stored value reads as on: a boolean, or `1`, `true`, `yes` or `on`.\n *\n * @param {unknown} value The stored value.\n * @return {boolean}\n */\nfunction isOn(value) {\n\tif (typeof value === 'boolean') {\n\t\treturn value\n\t}\n\treturn ['1', 'true', 'yes', 'on'].includes(String(value ?? '').trim().toLowerCase())\n}\n\n/**\n * @param {unknown} value A value.\n * @return {boolean} Whether it is null, undefined or an empty string.\n */\nfunction isEmpty(value) {\n\treturn value === null || value === undefined || value === ''\n}\n\n/**\n * Put `{name}` placeholders' values in a text; an unknown name stays as written.\n *\n * @param {string} text The text.\n * @param {(name: string) => unknown} lookup The value of a name.\n * @return {string}\n */\nfunction interpolate(text, lookup) {\n\treturn String(text || '').replace(/\\{([A-Za-z0-9_.-]+)(\\|date)?\\}/g, (whole, name, format) => {\n\t\tconst value = lookup(name)\n\t\tif (isEmpty(value) || typeof value === 'object') {\n\t\t\treturn whole\n\t\t}\n\t\tif (format === '|date') {\n\t\t\tconst date = new Date(String(value))\n\t\t\treturn Number.isNaN(date.getTime()) ? String(value) : date.toLocaleDateString(getCanonicalLocale() || undefined, { day: 'numeric', month: 'long', year: 'numeric' })\n\t\t}\n\t\treturn String(value)\n\t})\n}\n\n/**\n * A random value of `bytes` bytes as hexadecimal, from the browser's\n * cryptographic random source.\n *\n * @param {number} bytes How many bytes.\n * @return {string}\n */\nfunction randomHex(bytes) {\n\tconst values = new Uint8Array(Math.max(1, Number(bytes) || 32))\n\tglobalThis.crypto.getRandomValues(values)\n\treturn Array.from(values, (byte) => byte.toString(16).padStart(2, '0')).join('')\n}\n\n/**\n * The text of a lines field: one entry per line, from a list or a JSON list.\n *\n * @param {unknown} raw The stored value.\n * @return {string}\n */\nfunction linesText(raw) {\n\tlet list = raw\n\tif (typeof raw === 'string') {\n\t\ttry {\n\t\t\tlist = JSON.parse(raw)\n\t\t} catch {\n\t\t\treturn raw\n\t\t}\n\t}\n\treturn Array.isArray(list) ? list.map((entry) => String(entry).trim()).filter(Boolean).join('\\n') : ''\n}\n\n/**\n * The entries of a lines field's text, trimmed, without empty lines or repeats.\n *\n * @param {unknown} text The text.\n * @return {Array<string>}\n */\nfunction linesList(text) {\n\treturn [...new Set(String(text || '').split('\\n').map((line) => line.trim()).filter(Boolean))]\n}\n\n/**\n * A multi-choice value as a list: a list, a JSON list, or comma text.\n *\n * @param {unknown} raw The stored value.\n * @return {Array}\n */\nfunction choiceList(raw) {\n\tif (Array.isArray(raw)) {\n\t\treturn raw\n\t}\n\tif (typeof raw !== 'string' || raw.trim() === '') {\n\t\treturn []\n\t}\n\ttry {\n\t\tconst parsed = JSON.parse(raw)\n\t\tif (Array.isArray(parsed)) {\n\t\t\treturn parsed\n\t\t}\n\t} catch {\n\t\t// Not JSON: comma text.\n\t}\n\treturn raw.split(',').map((entry) => entry.trim()).filter(Boolean)\n}\n\n/**\n * An object stored as an object or as JSON text, and whether it was text.\n *\n * @param {unknown} raw The stored value.\n * @return {{object: object, text: boolean}}\n */\nfunction storedObject(raw) {\n\tif (typeof raw === 'string') {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(raw || '{}')\n\t\t\treturn { object: parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {}, text: true }\n\t\t} catch {\n\t\t\treturn { object: {}, text: true }\n\t\t}\n\t}\n\treturn { object: raw && typeof raw === 'object' && !Array.isArray(raw) ? raw : {}, text: false }\n}\n\n/**\n * A field's `path` split into the setting that holds JSON and the key inside it.\n *\n * @param {object} field The field.\n * @return {{root: string, rest: string}|null}\n */\nfunction pathParts(field) {\n\tconst path = typeof field.path === 'string' ? field.path : ''\n\tconst dot = path.indexOf('.')\n\treturn dot > 0 ? { root: path.slice(0, dot), rest: path.slice(dot + 1) } : null\n}\n\n/**\n * The sentence a refused request came back with: the body's `message` when\n * there is one (a refusal names its rule under `error` and says it under\n * `message`), else the clearest message available.\n *\n * @param {unknown} error The rejected value.\n * @return {string}\n */\nfunction refusalMessage(error) {\n\tconst message = error?.response?.data?.message\n\treturn typeof message === 'string' && message.trim() !== '' && message.length <= 400 && !/^\\s*</.test(message)\n\t\t? message.trim()\n\t\t: serverErrorMessage(error)\n}\n\n/**\n * Up to two initials of a name, for an image field without an image.\n *\n * @param {unknown} name The name.\n * @return {string}\n */\nfunction initialsOf(name) {\n\treturn String(name || '').trim().split(/\\s+/).filter(Boolean).slice(0, 2).map((word) => word[0].toUpperCase()).join('')\n}\n\n/**\n * CnSettingsFieldsSection - a settings section declared as fields: it reads\n * the app's settings, draws the fields in one to four columns, and saves\n * them with ONE Save button for the section.\n *\n * It reads `GET url` (default `/apps/<appId>/api/settings`) and writes the\n * section's fields with `PUT saveUrl` (default the same url). The Save button\n * is on while something changed (\"Unsaved changes\"); a save checks the\n * fields first (required, pattern, min, max) and marks each failing field,\n * then says it saved or why it did not. A `secret` field never shows the\n * stored value: it says a value is stored, and is sent only when something\n * was typed.\n *\n * Besides value fields a section can hold a `heading`, a read-only `status`\n * note (static `text`, or `textMap` by the value read at its key, with `tone`\n * or `toneMap`) and an `action` button (it posts to its `url`, or with `fill`\n * puts a random value in another field, and shows the server's sentence). A\n * field with `visibleWhen` shows only while its condition holds. With\n * `hintsToggle` the hints fold away behind one button.\n *\n * It renders inside CnAdminSettingsShell and CnSettingsPage, in the default\n * and the board look; with `bare` it draws no card of its own (for a host\n * that already gives the section its title, such as a settings dialog).\n *\n * ```vue\n * <CnSettingsFieldsSection\n * app-id=\"myapp\"\n * name=\"Connection\"\n * :columns=\"2\"\n * :fields=\"[\n * { key: 'baseUrl', label: 'Server address', required: true, pattern: '^https://', patternMessage: 'Starts with https://' },\n * { key: 'apiKey', label: 'API key', type: 'secret' },\n * { key: 'mode', label: 'Mode', type: 'select', options: [{ value: 'live', label: 'Live' }, { value: 'test', label: 'Test' }] },\n * { key: 'enabled', label: 'Enabled', type: 'switch', hint: 'Off stops every call.' },\n * ]\" />\n * ```\n */\nexport default {\n\tname: 'CnSettingsFieldsSection',\n\n\tcomponents: { ChevronDown, ChevronUp, CnSettingsField, CnSettingsSection, NcButton, NcLoadingIcon, NcNoteCard },\n\n\tinject: {\n\t\t/** The app's translate function; identity outside CnAppRoot. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/** The section title. */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** The line under the title. */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A longer explanation in its own block under the title. */\n\t\tdetailedDescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A documentation link beside the title. */\n\t\tdocUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Span the whole settings grid in the board look. */\n\t\twide: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The fields: `[{ key, label, type?, hint?, placeholder?, required?,\n\t\t * pattern?, patternMessage?, min?, max?, integer?, rows?, options?, optionsUrl?,\n\t\t * optionsPath?, optionLabel?, optionValue?, default?, readOnly?, wide?,\n\t\t * url?, valuePath?, saveUrl?, saveMethod?, saveKey?, saveParams?, uploadUrl?,\n\t\t * uploadField?, uploadParams?, uploadValuePath?, initials?, initialsFrom?,\n\t\t * visibleWhen?, trueValue?, falseValue?, setKey?, saveAs?, text?, textMap?,\n\t\t * tone?, toneMap?, method?, send?, resultPath?, okPath?, successText?, failureText?, fill?,\n\t\t * multiple?, keyLabel?, valueLabel?, valueType?, valueAbove?, valueMessage?, addLabel?,\n\t\t * path?, scope? }]`.\n\t\t * `type` is `text` (default), `textarea`, `number`, `switch`, `select`,\n\t\t * `radio`, `checkboxes`, `pairs`, `lines`, `secret`, `image`, `heading`,\n\t\t * `status`, `action` or `note`. A `note` is a labelled line of plain text\n\t\t * (`text`) that holds no value: a setting kept elsewhere, said where. A `checkboxes` field (or a `select` with\n\t\t * `multiple`) saves its choices as a list, or with `saveAs` `json` or\n\t\t * `csv` as JSON or comma text. A `pairs` field edits key-to-value rows\n\t\t * and saves them as one object (JSON text with `saveAs: 'json'`); its\n\t\t * `pattern` checks each key and `valueAbove` each value. A\n\t\t * field with `path: 'setting.key'` edits one key inside a JSON-valued\n\t\t * setting and saves the whole setting back. A field with `scope: true`\n\t\t * is never saved: its value fills `{key}` in the urls, and a change\n\t\t * reads the section again.\n\t\t * `default` stands in for a value that is missing or empty. A switch\n\t\t * reads `1`/`true`/`yes`/`on` as on and saves `trueValue`/`falseValue`\n\t\t * when declared. A secret says it is stored from `setKey` when the\n\t\t * server answers that under another key. A `lines` field edits a list\n\t\t * one entry per line and saves it as a list, or as JSON text with\n\t\t * `saveAs: 'json'`. `visibleWhen` is `{ key, equals?, notEquals?, in?,\n\t\t * empty? }` (or a list of them, all of which must hold) over the form\n\t\t * and the values read; a hidden field is not checked. An action posts\n\t\t * the `send` fields to `url` with `method` (default POST) and shows the\n\t\t * answer at `resultPath` (default `message`), as an error when `okPath`\n\t\t * reads false; without a sentence there it says `successText` (or\n\t\t * `failureText` when `okPath` reads false), `{name}` filled from the\n\t\t * answer; with `fill: { key, bytes }` it puts a random value in\n\t\t * that field instead. `key` names the setting; a dotted key reads a\n\t\t * nested value and is written as written. A field with its own `url`\n\t\t * is read there (at `valuePath`, default its key) and saved to its\n\t\t * `saveUrl` (default that `url`) with `saveMethod` (default POST) under\n\t\t * `saveKey` (default its key), with `saveParams` merged into the body,\n\t\t * so one section can hold the settings of several apps. A target under\n\t\t * `/ocs/` is sent the `OCS-APIRequest` header. An `image` uploads at once to `uploadUrl`. Labels,\n\t\t * hints, placeholders and messages go through the app's translate\n\t\t * function.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-section-declared-as-fields-reads-and-saves-the-apps-settings\n\t\t */\n\t\tfields: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * The row this card is opened from (CnSettingsSection `openedFrom`): the\n\t\t * card shows only while the page's hash names its `id`.\n\t\t *\n\t\t * @spec openspec/changes/settings-section-opened-from-row/specs/settings-section-opened-from-row/spec.md#requirement-a-settings-card-can-be-opened-from-a-row\n\t\t */\n\t\topenedFrom: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Columns of the field grid: 1 to 4. A narrow card stacks them. */\n\t\tcolumns: {\n\t\t\ttype: Number,\n\t\t\tdefault: 1,\n\t\t\tvalidator: (value) => [1, 2, 3, 4].includes(value),\n\t\t},\n\n\t\t/** The app id, for the default url `/apps/<appId>/api/settings`. */\n\t\tappId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Where the settings are read (`GET`); app-absolute or a full URL. */\n\t\turl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Where the section saves; defaults to `url`. */\n\t\tsaveUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The method of the save request. */\n\t\tsaveMethod: {\n\t\t\ttype: String,\n\t\t\tdefault: 'PUT',\n\t\t\tvalidator: (value) => ['PUT', 'POST', 'PATCH'].includes(String(value).toUpperCase()),\n\t\t},\n\n\t\t/** A dotted path to the values in the GET answer; empty reads the answer itself. */\n\t\tvaluesPath: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The Save button's label. Defaults to \"Save\". */\n\t\tsaveLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The note after a save. `{name}` takes the value of that field or of\n\t\t * that key in the values read. Defaults to \"Saved.\".\n\t\t */\n\t\tsavedMessage: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Read the values again after a save, for status notes the server works out. */\n\t\treloadAfterSave: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Send every field of the section on a save, not only the changed ones,\n\t\t * for an endpoint that replaces the whole record.\n\t\t */\n\t\tsaveAll: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Fold the hints, and status notes marked `foldable`, away behind one\n\t\t * \"Show the explanations\" button, for a long form.\n\t\t */\n\t\thintsToggle: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Save each change at once (a typed value after a pause), with no Save button. */\n\t\tautoSave: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Draw no card, title or description: the host already gives the section its own. */\n\t\tbare: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Draw the save button beside the form instead of under it, for a\n\t\t * one-field form (\"Use this account\").\n\t\t *\n\t\t * @spec openspec/changes/settings-fields-inline-save-and-advanced/specs/settings-fields-inline-save-and-advanced/spec.md#requirement-a-section-can-draw-its-save-button-beside-the-form\n\t\t */\n\t\tsaveInline: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The label of the disclosure the fields marked `advanced` sit behind.\n\t\t * Defaults to \"Advanced\".\n\t\t */\n\t\tadvancedLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['saved', 'save-error'],\n\n\tdata() {\n\t\treturn {\n\t\t\tform: {},\n\t\t\tbaseline: {},\n\t\t\tstoredSecrets: {},\n\t\t\t// Secret key to true while the admin asked to remove its stored value.\n\t\t\tclearSecrets: {},\n\t\t\t// Field key to the message of a read target that failed.\n\t\t\tunreadable: {},\n\t\t\terrors: {},\n\t\t\tloading: true,\n\t\t\tloadError: '',\n\t\t\tsaving: false,\n\t\t\tnotice: null,\n\t\t\t// The values the section's own read target answered, for status\n\t\t\t// notes, visibleWhen and placeholders that name a key no field holds.\n\t\t\tvalues: {},\n\t\t\tactionStates: {},\n\t\t\tshowHints: false,\n\t\t\tshowAdvanced: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {number} The column count, 1 to 4. */\n\t\tcolumnCount() {\n\t\t\treturn [1, 2, 3, 4].includes(this.columns) ? this.columns : 1\n\t\t},\n\n\t\t/** @return {object} The props of the card around the form. */\n\t\tsectionProps() {\n\t\t\treturn {\n\t\t\t\tname: this.name,\n\t\t\t\tdescription: this.description,\n\t\t\t\tdetailedDescription: this.detailedDescription,\n\t\t\t\tdocUrl: this.docUrl,\n\t\t\t\twide: this.wide,\n\t\t\t\tloading: this.loading,\n\t\t\t\terror: this.loadError !== '',\n\t\t\t\terrorMessage: this.loadError,\n\t\t\t\tonRetry: this.load,\n\t\t\t\topenedFrom: this.openedFrom,\n\t\t\t}\n\t\t},\n\n\t\t/** @return {string} Where the settings are read: `url`, else the app's settings endpoint. */\n\t\treadTarget() {\n\t\t\treturn this.resolveUrl(this.url || (this.appId ? `/apps/${this.appId}/api/settings` : ''))\n\t\t},\n\n\t\t/** @return {string} Where the section saves: `saveUrl`, else the read target. */\n\t\twriteTarget() {\n\t\t\treturn this.saveUrl ? this.resolveUrl(this.saveUrl) : this.readTarget\n\t\t},\n\n\t\t/**\n\t\t * The values of the scope fields: the form's, else their `default`.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tscopeValues() {\n\t\t\tconst values = {}\n\t\t\tfor (const field of Array.isArray(this.fields) ? this.fields : []) {\n\t\t\t\tif (field && field.scope && field.key) {\n\t\t\t\t\tvalues[field.key] = isEmpty(this.form[field.key]) ? field.default : this.form[field.key]\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn values\n\t\t},\n\n\t\t/**\n\t\t * The declared fields with their text translated and a secret's stored state.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tresolvedFields() {\n\t\t\treturn (Array.isArray(this.fields) ? this.fields : [])\n\t\t\t\t.filter((field) => field && typeof field.key === 'string' && field.key !== '')\n\t\t\t\t.map((field) => ({\n\t\t\t\t\t...field,\n\t\t\t\t\tlabel: this.tr(field.label || field.key),\n\t\t\t\t\thint: this.hintsToggle && !this.showHints ? '' : this.tr(field.hint || ''),\n\t\t\t\t\tplaceholder: this.tr(field.placeholder || ''),\n\t\t\t\t\toptions: Array.isArray(field.options) ? field.options.map((option) => this.translateOption(option)) : field.options,\n\t\t\t\t\tsecretSet: field.type === 'secret' ? !!this.storedSecrets[field.key] : undefined,\n\t\t\t\t\tclearing: field.type === 'secret' ? !!this.clearSecrets[field.key] : undefined,\n\t\t\t\t\tinitials: field.type === 'image' ? initialsOf(field.initialsFrom ? this.form[field.initialsFrom] : field.initials) : undefined,\n\t\t\t\t\treadOnly: field.readOnly || !!this.unreadable[field.key],\n\t\t\t\t\t...(field.type === 'status' ? this.statusOf(field) : {}),\n\t\t\t\t\t...(field.type === 'action' ? { actionBusy: !!this.actionStates[field.key]?.busy, actionResult: this.actionStates[field.key]?.result || null } : {}),\n\t\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * The fields shown now: their `visibleWhen` holds, and a status note has text.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tvisibleFields() {\n\t\t\treturn this.resolvedFields.filter((field) => this.isVisible(field)\n\t\t\t\t&& !(field.type === 'status' && field.text === '')\n\t\t\t\t&& !(field.foldable && this.hintsToggle && !this.showHints))\n\t\t},\n\n\t\t/**\n\t\t * The visible fields drawn in the form itself: every one not marked `advanced`.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tmainFields() {\n\t\t\treturn this.visibleFields.filter((field) => field.advanced !== true)\n\t\t},\n\n\t\t/**\n\t\t * The visible fields marked `advanced`, drawn behind the disclosure.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t * @spec openspec/changes/settings-fields-inline-save-and-advanced/specs/settings-fields-inline-save-and-advanced/spec.md#requirement-advanced-fields-sit-behind-one-disclosure\n\t\t */\n\t\tadvancedFields() {\n\t\t\treturn this.visibleFields.filter((field) => field.advanced === true)\n\t\t},\n\n\t\t/** @return {string} The id the disclosure's button controls. */\n\t\tadvancedId() {\n\t\t\treturn `cn-settings-fields-advanced-${this.$.uid}`\n\t\t},\n\n\t\t/** @return {string} The disclosure's label, translated. */\n\t\tresolvedAdvancedLabel() {\n\t\t\treturn this.advancedLabel ? this.tr(this.advancedLabel) : t('nextcloud-vue', 'Advanced')\n\t\t},\n\n\t\t/** @return {boolean} Whether the save button stands beside the form. */\n\t\tinlineSave() {\n\t\t\treturn this.saveInline && !this.autoSave && this.hasInputs\n\t\t},\n\n\t\t/** @return {boolean} Whether the section holds a field with a value to save. */\n\t\thasInputs() {\n\t\t\treturn this.resolvedFields.some((field) => !VALUELESS_TYPES.includes(field.type) && !field.scope)\n\t\t},\n\n\t\t/**\n\t\t * Whether something changed since the last load or save.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-one-save-per-section-with-a-dirty-state\n\t\t */\n\t\tdirty() {\n\t\t\treturn Object.values(this.clearSecrets).some(Boolean) || this.resolvedFields.some((field) => field.type !== 'image' && !field.scope && !VALUELESS_TYPES.includes(field.type) && !this.same(this.form[field.key], this.baseline[field.key]))\n\t\t},\n\n\t\t/** @return {string} The Save button's label. */\n\t\tresolvedSaveLabel() {\n\t\t\treturn this.saveLabel ? this.tr(this.saveLabel) : t('nextcloud-vue', 'Save')\n\t\t},\n\t},\n\n\twatch: {\n\t\t/**\n\t\t * Open the advanced fields when one of them is refused, so its\n\t\t * message is not hidden.\n\t\t *\n\t\t * @param {object} errors Field key to message.\n\t\t */\n\t\terrors(errors) {\n\t\t\tif (this.advancedFields.some((field) => errors[field.key])) {\n\t\t\t\tthis.showAdvanced = true\n\t\t\t}\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.load()\n\t},\n\n\tbeforeUnmount() {\n\t\tclearTimeout(this.autoSaveTimer)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * @param {object} field A field.\n\t\t * @return {boolean} Whether it spans the whole grid.\n\t\t */\n\t\tisFullWidth(field) {\n\t\t\treturn FULL_WIDTH_TYPES.includes(field.type)\n\t\t},\n\n\t\t/**\n\t\t * A url with its `{key}` tokens filled from the scope fields.\n\t\t *\n\t\t * @param {string} url The declared url.\n\t\t * @return {string}\n\t\t * @spec openspec/changes/settings-fields-lists/specs/settings-fields-section/spec.md#requirement-a-scope-field-fills-the-url\n\t\t */\n\t\tresolveUrl(url) {\n\t\t\tif (!url || !String(url).includes('{')) {\n\t\t\t\treturn url || ''\n\t\t\t}\n\t\t\tconst scope = this.scopeValues\n\t\t\treturn interpolate(url, (name) => (Object.hasOwn(scope, name) ? encodeURIComponent(String(scope[name] ?? '')) : undefined))\n\t\t},\n\n\t\t/**\n\t\t * @param {object} field A field.\n\t\t * @return {boolean} Whether its value is a list of choices.\n\t\t */\n\t\tisList(field) {\n\t\t\treturn LIST_TYPES.includes(field.type) || (field.type === 'select' && field.multiple === true)\n\t\t},\n\n\t\t/**\n\t\t * @param {object|string|number} option A declared option.\n\t\t * @return {object|string|number} It with its label and description translated.\n\t\t */\n\t\ttranslateOption(option) {\n\t\t\tif (!option || typeof option !== 'object') {\n\t\t\t\treturn option\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...option,\n\t\t\t\t...(typeof option.label === 'string' ? { label: this.tr(option.label) } : {}),\n\t\t\t\t...(typeof option.description === 'string' ? { description: this.tr(option.description) } : {}),\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A value by name: the field's form value, else the value read at that key.\n\t\t *\n\t\t * @param {string} key The field key or a key in the values read.\n\t\t * @return {unknown}\n\t\t */\n\t\tvalueOf(key) {\n\t\t\treturn Object.hasOwn(this.form, key) ? this.form[key] : literalFirst(this.values, key)\n\t\t},\n\n\t\t/**\n\t\t * Whether a field's `visibleWhen` holds; a field without one is always shown.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-field-can-depend-on-another\n\t\t */\n\t\tisVisible(field) {\n\t\t\tconst conditions = Array.isArray(field.visibleWhen) ? field.visibleWhen : (field.visibleWhen ? [field.visibleWhen] : [])\n\t\t\treturn conditions.every((condition) => {\n\t\t\t\tconst value = this.valueOf(condition.key)\n\t\t\t\tif ('equals' in condition) {\n\t\t\t\t\treturn typeof condition.equals === 'boolean' ? isOn(value) === condition.equals : String(value ?? '') === String(condition.equals)\n\t\t\t\t}\n\t\t\t\tif ('notEquals' in condition) {\n\t\t\t\t\treturn typeof condition.notEquals === 'boolean' ? isOn(value) !== condition.notEquals : String(value ?? '') !== String(condition.notEquals)\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(condition.in)) {\n\t\t\t\t\treturn condition.in.map(String).includes(String(value ?? ''))\n\t\t\t\t}\n\t\t\t\tif ('empty' in condition) {\n\t\t\t\t\treturn isEmpty(value) === !!condition.empty\n\t\t\t\t}\n\t\t\t\treturn !isEmpty(value) && value !== false\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * A status note's text and tone: its static `text`, else its `textMap`\n\t\t * entry for the value read at its key (`*` for any other value), with\n\t\t * `{name}` placeholders filled; an empty text hides the note.\n\t\t *\n\t\t * @param {object} field The status field.\n\t\t * @return {{text: string, tone: string}}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-status-note-and-an-action-sit-between-the-fields\n\t\t */\n\t\tstatusOf(field) {\n\t\t\tconst value = this.form[field.key]\n\t\t\tconst key = isEmpty(value) ? '' : String(value)\n\t\t\tconst map = field.textMap && typeof field.textMap === 'object' ? field.textMap : null\n\t\t\tlet text = field.text ?? ''\n\t\t\tif (!field.text && map) {\n\t\t\t\ttext = Object.hasOwn(map, key) ? map[key] : (map['*'] ?? '')\n\t\t\t} else if (!field.text) {\n\t\t\t\ttext = key\n\t\t\t}\n\t\t\tconst tones = field.toneMap && typeof field.toneMap === 'object' ? field.toneMap : {}\n\t\t\treturn {\n\t\t\t\ttext: interpolate(this.tr(text), (name) => (name === 'value' ? value : this.valueOf(name))),\n\t\t\t\ttone: field.tone || (Object.hasOwn(tones, key) ? tones[key] : tones['*']) || 'info',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @param {string} value A declared string.\n\t\t * @return {string} It through the app's translate function.\n\t\t */\n\t\ttr(value) {\n\t\t\treturn typeof value === 'string' && value !== '' ? this.cnTranslate(value) : (value || '')\n\t\t},\n\n\t\t/**\n\t\t * @param {unknown} a A value.\n\t\t * @param {unknown} b Another.\n\t\t * @return {boolean} Whether they count as the same setting.\n\t\t */\n\t\tsame(a, b) {\n\t\t\tconst empty = (v) => v === null || v === undefined || v === ''\n\t\t\tif (empty(a) && empty(b)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn JSON.stringify(a) === JSON.stringify(b)\n\t\t},\n\n\t\t/**\n\t\t * Change a field's value; its error goes until the next save.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @param {unknown} value The value.\n\t\t * @return {void}\n\t\t */\n\t\tsetValue(field, value) {\n\t\t\tthis.form = { ...this.form, [field.key]: value }\n\t\t\tif (this.errors[field.key]) {\n\t\t\t\tconst { [field.key]: _gone, ...rest } = this.errors\n\t\t\t\tthis.errors = rest\n\t\t\t}\n\t\t\tthis.notice = null\n\t\t\tif (field.scope) {\n\t\t\t\tthis.load(true)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.autoSave) {\n\t\t\t\tclearTimeout(this.autoSaveTimer)\n\t\t\t\tconst typed = ['text', 'textarea', 'lines', 'number', 'secret', 'password', undefined].includes(field.type)\n\t\t\t\tthis.autoSaveTimer = setTimeout(() => this.save(), typed ? 600 : 0)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run an action field: put a random value in its `fill` field, or post\n\t\t * its `send` fields to its `url` and show the answer's sentence.\n\t\t *\n\t\t * @param {object} field The action field.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-status-note-and-an-action-sit-between-the-fields\n\t\t */\n\t\tasync runAction(field) {\n\t\t\tconst setState = (state) => {\n\t\t\t\tthis.actionStates = { ...this.actionStates, [field.key]: state }\n\t\t\t}\n\t\t\tif (field.fill && field.fill.key) {\n\t\t\t\tconst target = this.fields.find((candidate) => candidate && candidate.key === field.fill.key)\n\t\t\t\tif (target) {\n\t\t\t\t\tthis.setValue(target, randomHex(field.fill.bytes))\n\t\t\t\t}\n\t\t\t\tsetState({ busy: false, result: field.successText ? { type: 'success', text: this.tr(field.successText) } : null })\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!field.url) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (field.confirm && !(await this.confirmAction(field))) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetState({ busy: true, result: null })\n\t\t\tconst data = { ...(field.params && typeof field.params === 'object' ? field.params : {}) }\n\t\t\tfor (const key of Array.isArray(field.send) ? field.send : []) {\n\t\t\t\tconst sent = this.fields.find((candidate) => candidate && candidate.key === key)\n\t\t\t\tif (!(sent?.type === 'secret' && isEmpty(this.form[key]))) {\n\t\t\t\t\tdata[key] = this.form[key]\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst url = this.resolveUrl(field.url)\n\t\t\t\tconst response = await axios.request({ url: prefixUrl(url), method: String(field.method || 'POST').toLowerCase(), data, ...ocsConfig(url) })\n\t\t\t\tconst answer = response?.data ?? {}\n\t\t\t\tconst said = literalFirst(answer, field.resultPath || 'message')\n\t\t\t\tconst ok = field.okPath ? isOn(literalFirst(answer, field.okPath)) : true\n\t\t\t\tconst fallback = !ok && field.failureText ? field.failureText : field.successText\n\t\t\t\tconst text = typeof said === 'string' && said !== ''\n\t\t\t\t\t? said\n\t\t\t\t\t: (interpolate(this.tr(fallback || ''), (name) => literalFirst(answer, name)) || t('nextcloud-vue', 'Done.'))\n\t\t\t\tsetState({ busy: false, result: { type: ok ? 'success' : 'error', text } })\n\t\t\t\tif (ok && field.reload) {\n\t\t\t\t\tawait this.load(true)\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tsetState({ busy: false, result: { type: 'error', text: refusalMessage(error) } })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Read the settings and fill the fields; a secret's value is never put\n\t\t * in the form, only whether one is stored.\n\t\t *\n\t\t * @param {boolean} quiet Read again without the loading state, keeping the form on screen.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync load(quiet = false) {\n\t\t\tif (quiet !== true) {\n\t\t\t\tthis.loading = true\n\t\t\t}\n\t\t\tthis.loadError = ''\n\t\t\ttry {\n\t\t\t\t// One GET per distinct read target; the section's own target must\n\t\t\t\t// answer, a field's own target may fail on its own.\n\t\t\t\t// An action's url is where it posts, never a value to read.\n\t\t\t\tconst targets = [...new Set(this.fields\n\t\t\t\t\t.filter((field) => field && field.key && field.type !== 'action' && field.type !== 'heading')\n\t\t\t\t\t.map((field) => this.readUrlOf(field))\n\t\t\t\t\t.filter(Boolean))]\n\t\t\t\tconst answers = {}\n\t\t\t\tconst failures = {}\n\t\t\t\tawait Promise.all(targets.map(async (target) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst response = await axios.get(prefixUrl(target), ocsConfig(target))\n\t\t\t\t\t\tanswers[target] = response?.data ?? {}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tfailures[target] = error\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t\t\tif (this.readTarget && failures[this.readTarget]) {\n\t\t\t\t\tthrow failures[this.readTarget]\n\t\t\t\t}\n\t\t\t\tconst form = {}\n\t\t\t\tconst stored = {}\n\t\t\t\tconst unreadable = {}\n\t\t\t\tconst scope = this.scopeValues\n\t\t\t\tconst own = this.readTarget ? answers[this.readTarget] : null\n\t\t\t\tthis.values = (own && this.valuesPath ? literalFirst(own, this.valuesPath) : own) || {}\n\t\t\t\tfor (const field of this.fields || []) {\n\t\t\t\t\tif (!field || !field.key || field.type === 'heading' || field.type === 'action') {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif (field.scope) {\n\t\t\t\t\t\tform[field.key] = scope[field.key] ?? ''\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst target = this.readUrlOf(field)\n\t\t\t\t\tif (target && failures[target]) {\n\t\t\t\t\t\tunreadable[field.key] = t('nextcloud-vue', 'This value could not be loaded: {reason}', { reason: serverErrorMessage(failures[target]) })\n\t\t\t\t\t}\n\t\t\t\t\tconst answer = target ? answers[target] : null\n\t\t\t\t\tconst raw = this.readValue(field, answer)\n\t\t\t\t\tif (field.type === 'secret') {\n\t\t\t\t\t\tconst flag = field.setKey ? this.readValue({ ...field, key: field.setKey, valuePath: field.setKey }, answer) : raw\n\t\t\t\t\t\tstored[field.key] = field.setKey ? isOn(flag) : !isEmpty(flag) && flag !== false\n\t\t\t\t\t\tform[field.key] = ''\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tform[field.key] = this.formValue(field, raw)\n\t\t\t\t}\n\t\t\t\tthis.form = form\n\t\t\t\tthis.baseline = { ...form }\n\t\t\t\tthis.storedSecrets = stored\n\t\t\t\tthis.unreadable = unreadable\n\t\t\t\tthis.errors = {}\n\t\t\t} catch (error) {\n\t\t\t\tthis.loadError = t('nextcloud-vue', 'The settings could not be loaded: {reason}', { reason: serverErrorMessage(error) })\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A stored value as the field edits it: `default` for a missing or empty\n\t\t * value, a switch as on or off, a list as one entry per line.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @param {unknown} raw The stored value.\n\t\t * @return {unknown}\n\t\t */\n\t\tformValue(field, raw) {\n\t\t\tconst value = isEmpty(raw) && field.default !== undefined ? field.default : raw\n\t\t\tif (field.type === 'switch' || field.type === 'boolean') {\n\t\t\t\treturn isEmpty(value) ? false : isOn(value)\n\t\t\t}\n\t\t\tif (field.type === 'lines') {\n\t\t\t\treturn linesText(value)\n\t\t\t}\n\t\t\tif (this.isList(field)) {\n\t\t\t\treturn choiceList(value)\n\t\t\t}\n\t\t\tif (field.type === 'pairs') {\n\t\t\t\treturn Object.entries(storedObject(value).object).map(([key, entry]) => ({ key, value: entry }))\n\t\t\t}\n\t\t\tif (field.type === 'week-hours') {\n\t\t\t\treturn JSON.parse(JSON.stringify(storedObject(value).object))\n\t\t\t}\n\t\t\treturn value === undefined ? '' : value\n\t\t},\n\n\t\t/**\n\t\t * A form value as it is saved: a switch as its `trueValue`/`falseValue`,\n\t\t * a lines field as a list (or JSON text with `saveAs: 'json'`).\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @param {unknown} value The form value.\n\t\t * @return {unknown}\n\t\t */\n\t\tsavedValue(field, value) {\n\t\t\tif ((field.type === 'switch' || field.type === 'boolean') && (field.trueValue !== undefined || field.falseValue !== undefined)) {\n\t\t\t\treturn value ? (field.trueValue ?? true) : (field.falseValue ?? false)\n\t\t\t}\n\t\t\tif (field.type === 'lines') {\n\t\t\t\tconst list = linesList(value)\n\t\t\t\treturn field.saveAs === 'json' ? JSON.stringify(list) : list\n\t\t\t}\n\t\t\tif (this.isList(field)) {\n\t\t\t\tconst list = Array.isArray(value) ? value : []\n\t\t\t\tif (field.saveAs === 'json') {\n\t\t\t\t\treturn JSON.stringify(list)\n\t\t\t\t}\n\t\t\t\treturn field.saveAs === 'csv' ? list.join(',') : list\n\t\t\t}\n\t\t\tif (field.type === 'pairs') {\n\t\t\t\tconst object = {}\n\t\t\t\tfor (const row of Array.isArray(value) ? value : []) {\n\t\t\t\t\tconst key = String(row?.key ?? '').trim()\n\t\t\t\t\tif (key !== '') {\n\t\t\t\t\t\tobject[key] = field.valueType === 'number' && !isEmpty(row.value) ? Number(row.value) : row.value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn field.saveAs === 'json' ? JSON.stringify(object) : object\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\t/**\n\t\t * Where a field is read: its own `url`, else the section's.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @return {string}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-field-can-read-and-save-elsewhere\n\t\t */\n\t\treadUrlOf(field) {\n\t\t\treturn field.url ? this.resolveUrl(field.url) : this.readTarget\n\t\t},\n\n\t\t/**\n\t\t * A field's value in its read answer: at its `valuePath` (a field with its\n\t\t * own `url`), else at the section's `valuesPath`, then its `key`. A key\n\t\t * the answer holds as written wins over reading it as a dotted path.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @param {object|null} data The answer of the field's read target.\n\t\t * @return {unknown}\n\t\t */\n\t\treadValue(field, data) {\n\t\t\tif (!data || typeof data !== 'object') {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (field.url) {\n\t\t\t\treturn literalFirst(data, field.valuePath || field.key)\n\t\t\t}\n\t\t\tconst values = (this.valuesPath ? literalFirst(data, this.valuesPath) : data) || {}\n\t\t\tconst parts = pathParts(field)\n\t\t\tif (parts) {\n\t\t\t\treturn readPath(storedObject(literalFirst(values, parts.root)).object, parts.rest)\n\t\t\t}\n\t\t\treturn literalFirst(values, field.key)\n\t\t},\n\n\t\t/**\n\t\t * Check the fields: required, pattern, and a number's min and max.\n\t\t *\n\t\t * @return {object} Field key to message; empty when all pass.\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-failing-field-says-why\n\t\t */\n\t\tvalidate() {\n\t\t\tconst errors = {}\n\t\t\tfor (const field of this.resolvedFields) {\n\t\t\t\tconst value = this.form[field.key]\n\t\t\t\tconst empty = value === null || value === undefined || value === '' || (Array.isArray(value) && value.length === 0)\n\t\t\t\tif (['switch', 'boolean', 'image', ...VALUELESS_TYPES].includes(field.type) || field.scope || this.unreadable[field.key] || !this.isVisible(field)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.required && empty && !(field.type === 'secret' && field.secretSet)) {\n\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} is required.', { field: field.label })\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (empty) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.type === 'week-hours') {\n\t\t\t\t\tconst late = Object.values(value).some((hours) => hours && !(TIME.test(hours.opens || '') && TIME.test(hours.closes || '') && hours.opens < hours.closes))\n\t\t\t\t\tif (late) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field}: a day closes before it opens, or a time is missing.', { field: field.label })\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.type === 'pairs') {\n\t\t\t\t\tconst rows = value.filter((row) => String(row?.key ?? '').trim() !== '')\n\t\t\t\t\tconst keys = rows.map((row) => String(row.key).trim())\n\t\t\t\t\tconst twice = keys.find((key, at) => keys.indexOf(key) !== at)\n\t\t\t\t\tconst badKey = field.pattern ? keys.find((key) => !new RegExp(field.pattern).test(key)) : undefined\n\t\t\t\t\tconst badValue = field.valueAbove !== undefined\n\t\t\t\t\t\t? rows.find((row) => isEmpty(row.value) || Number.isNaN(Number(row.value)) || Number(row.value) <= field.valueAbove)\n\t\t\t\t\t\t: undefined\n\t\t\t\t\tif (twice) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} holds {key} twice.', { field: field.label, key: twice })\n\t\t\t\t\t} else if (badKey !== undefined) {\n\t\t\t\t\t\terrors[field.key] = field.patternMessage ? this.tr(field.patternMessage) : t('nextcloud-vue', '{field} is not in the right form.', { field: field.label })\n\t\t\t\t\t} else if (badValue) {\n\t\t\t\t\t\terrors[field.key] = field.valueMessage ? this.tr(field.valueMessage) : t('nextcloud-vue', 'The value for {key} must be above {min}.', { key: String(badValue.key).trim(), min: field.valueAbove })\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (this.isList(field)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.pattern && !new RegExp(field.pattern).test(String(value))) {\n\t\t\t\t\terrors[field.key] = field.patternMessage ? this.tr(field.patternMessage) : t('nextcloud-vue', '{field} is not in the right form.', { field: field.label })\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.type === 'number') {\n\t\t\t\t\tconst number = Number(value)\n\t\t\t\t\tif (Number.isNaN(number)) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} must be a number.', { field: field.label })\n\t\t\t\t\t} else if (field.integer && !Number.isInteger(number)) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} must be a whole number.', { field: field.label })\n\t\t\t\t\t} else if (field.min !== undefined && number < field.min) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} must be at least {min}.', { field: field.label, min: field.min })\n\t\t\t\t\t} else if (field.max !== undefined && number > field.max) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} must be at most {max}.', { field: field.label, max: field.max })\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn errors\n\t\t},\n\n\t\t/**\n\t\t * Save the section's fields in one request, after checking them. A\n\t\t * secret is sent only when something was typed.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-one-save-per-section-with-a-dirty-state\n\t\t */\n\t\tasync save() {\n\t\t\tif (this.saving) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.errors = this.validate()\n\t\t\tconst failing = Object.keys(this.errors)\n\t\t\tif (failing.length > 0) {\n\t\t\t\tthis.notice = { type: 'error', text: t('nextcloud-vue', 'Check the marked fields.') }\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tconst el = this.$el?.querySelector?.('[aria-invalid=\"true\"], .cn-settings-field__error')\n\t\t\t\t\tconst control = el?.closest?.('.cn-settings-field')?.querySelector?.('input, textarea, [role=\"combobox\"]')\n\t\t\t\t\tcontrol?.focus?.()\n\t\t\t\t})\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// The changed fields, one request per save target, each carrying its\n\t\t\t// own fields under their `saveKey`. A secret goes only when typed; an\n\t\t\t// image is uploaded on its own; a field that could not be read is left out.\n\t\t\tconst groups = new Map()\n\t\t\tfor (const field of this.resolvedFields) {\n\t\t\t\tconst value = this.form[field.key]\n\t\t\t\tconst clearing = field.type === 'secret' && this.clearSecrets[field.key] === true\n\t\t\t\tif (field.type === 'image' || field.scope || VALUELESS_TYPES.includes(field.type) || this.unreadable[field.key] || (!clearing && !this.saveAll && this.same(value, this.baseline[field.key]))) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.type === 'secret' && !clearing && (value === '' || value === null || value === undefined)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst url = this.resolveUrl(field.saveUrl || field.url) || this.writeTarget\n\t\t\t\tconst method = String(field.saveMethod || (field.saveUrl || field.url ? 'POST' : this.saveMethod)).toLowerCase()\n\t\t\t\tconst id = `${method} ${url}`\n\t\t\t\tif (!groups.has(id)) {\n\t\t\t\t\tgroups.set(id, { url, method, fields: [], data: {} })\n\t\t\t\t}\n\t\t\t\tconst group = groups.get(id)\n\t\t\t\tgroup.fields.push(field)\n\t\t\t\tObject.assign(group.data, field.saveParams || {})\n\t\t\t\tconst parts = pathParts(field)\n\t\t\t\tif (parts) {\n\t\t\t\t\tgroup.data[parts.root] = this.jsonSettingWith(parts.root)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (clearing) {\n\t\t\t\t\tgroup.data[field.clearKey || field.saveKey || field.key] = field.clearKey ? true : ''\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tgroup.data[field.saveKey || field.key] = this.savedValue(field, value)\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tthis.notice = null\n\t\t\tconst failed = []\n\t\t\tconst sent = {}\n\t\t\tfor (const group of groups.values()) {\n\t\t\t\ttry {\n\t\t\t\t\tawait axios.request({ url: prefixUrl(group.url), method: group.method, data: group.data, ...ocsConfig(group.url) })\n\t\t\t\t\tObject.assign(sent, group.data)\n\t\t\t\t\tthis.keepJsonSettings(group)\n\t\t\t\t\tthis.acceptSaved(group.fields)\n\t\t\t\t} catch (error) {\n\t\t\t\t\tfailed.push({ group, error })\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (failed.length === 0 && groups.size > 0 && this.reloadAfterSave) {\n\t\t\t\tawait this.load(true)\n\t\t\t}\n\t\t\tthis.saving = false\n\t\t\tif (failed.length === 0) {\n\t\t\t\tif (groups.size === 0) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.notice = { type: 'success', text: this.savedMessage ? interpolate(this.tr(this.savedMessage), (name) => this.valueOf(name)) : t('nextcloud-vue', 'Saved.') }\n\t\t\t\t/**\n\t\t\t\t * @event saved The section saved. Payload: what was sent, by save key.\n\t\t\t\t */\n\t\t\t\tthis.$emit('saved', sent)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst reasons = failed.map(({ group, error }) => (groups.size > 1\n\t\t\t\t? t('nextcloud-vue', '{fields}: {reason}', { fields: group.fields.map((field) => field.label).join(', '), reason: refusalMessage(error) })\n\t\t\t\t: refusalMessage(error)))\n\t\t\tthis.notice = { type: 'error', text: t('nextcloud-vue', 'The settings could not be saved: {reason}', { reason: reasons.join('; ') }) }\n\t\t\t/**\n\t\t\t * @event save-error A save request failed. Payload: the first error.\n\t\t\t */\n\t\t\tthis.$emit('save-error', failed[0].error)\n\t\t},\n\n\t\t/**\n\t\t * Keep the JSON-valued settings a save sent as the values read, so the\n\t\t * next save starts from them.\n\t\t *\n\t\t * @param {{fields: Array<object>, data: object}} group The saved request.\n\t\t * @return {void}\n\t\t */\n\t\tkeepJsonSettings(group) {\n\t\t\tconst roots = group.fields.map((field) => pathParts(field)?.root).filter(Boolean)\n\t\t\tif (roots.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst values = { ...this.values }\n\t\t\tfor (const root of roots) {\n\t\t\t\tvalues[root] = group.data[root]\n\t\t\t}\n\t\t\tthis.values = values\n\t\t},\n\n\t\t/**\n\t\t * A JSON-valued setting as it is saved: the value read, with every\n\t\t * field whose `path` lies inside it set from the form; JSON text when\n\t\t * it was read as text.\n\t\t *\n\t\t * @param {string} root The setting's key.\n\t\t * @return {object|string}\n\t\t * @spec openspec/changes/settings-fields-lists/specs/settings-fields-section/spec.md#requirement-a-field-can-edit-one-key-of-a-json-setting\n\t\t */\n\t\tjsonSettingWith(root) {\n\t\t\tconst stored = storedObject(literalFirst(this.values, root))\n\t\t\tconst object = JSON.parse(JSON.stringify(stored.object))\n\t\t\tfor (const field of this.resolvedFields) {\n\t\t\t\tconst parts = pathParts(field)\n\t\t\t\tif (!parts || parts.root !== root) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst keys = parts.rest.split('.')\n\t\t\t\tlet node = object\n\t\t\t\tfor (const key of keys.slice(0, -1)) {\n\t\t\t\t\tnode[key] = node[key] && typeof node[key] === 'object' ? node[key] : {}\n\t\t\t\t\tnode = node[key]\n\t\t\t\t}\n\t\t\t\tnode[keys[keys.length - 1]] = this.savedValue(field, this.form[field.key])\n\t\t\t}\n\t\t\treturn stored.text ? JSON.stringify(object) : object\n\t\t},\n\n\t\t/**\n\t\t * Take saved fields as the new baseline; a saved secret reads as stored.\n\t\t *\n\t\t * @param {Array<object>} fields The fields that saved.\n\t\t * @return {void}\n\t\t */\n\t\tacceptSaved(fields) {\n\t\t\tconst form = { ...this.form }\n\t\t\tconst baseline = { ...this.baseline }\n\t\t\tconst stored = { ...this.storedSecrets }\n\t\t\tconst clearing = { ...this.clearSecrets }\n\t\t\tfor (const field of fields) {\n\t\t\t\tif (field.type === 'secret') {\n\t\t\t\t\tstored[field.key] = clearing[field.key] !== true\n\t\t\t\t\tdelete clearing[field.key]\n\t\t\t\t\tform[field.key] = ''\n\t\t\t\t}\n\t\t\t\tbaseline[field.key] = form[field.key]\n\t\t\t}\n\t\t\tthis.form = form\n\t\t\tthis.baseline = baseline\n\t\t\tthis.storedSecrets = stored\n\t\t\tthis.clearSecrets = clearing\n\t\t},\n\n\t\t/**\n\t\t * Mark a stored secret for removal on the next save, or keep it.\n\t\t *\n\t\t * @param {object} field The secret field.\n\t\t * @param {boolean} on Whether to remove the stored value.\n\t\t * @return {void}\n\t\t */\n\t\tsetClearing(field, on) {\n\t\t\tconst next = { ...this.clearSecrets }\n\t\t\tif (on) {\n\t\t\t\tnext[field.key] = true\n\t\t\t\tthis.form = { ...this.form, [field.key]: '' }\n\t\t\t} else {\n\t\t\t\tdelete next[field.key]\n\t\t\t}\n\t\t\tthis.clearSecrets = next\n\t\t\tthis.notice = null\n\t\t},\n\n\t\t/**\n\t\t * Ask before an action with `confirm`; closing the question is a no.\n\t\t *\n\t\t * @param {object} field The action field.\n\t\t * @return {Promise<boolean>} Whether to go on.\n\t\t */\n\t\tasync confirmAction(field) {\n\t\t\ttry {\n\t\t\t\treturn (await showConfirmation({\n\t\t\t\t\tname: field.label,\n\t\t\t\t\ttext: this.tr(field.confirm),\n\t\t\t\t\tlabelConfirm: this.tr(field.confirmLabel || '') || field.label,\n\t\t\t\t\tlabelReject: t('nextcloud-vue', 'Cancel'),\n\t\t\t\t})) === true\n\t\t\t} catch {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * An image field uploaded a file: its new value is the baseline too.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @param {string} value The new image url.\n\t\t * @return {void}\n\t\t */\n\t\tonUploaded(field, value) {\n\t\t\tthis.form = { ...this.form, [field.key]: value }\n\t\t\tthis.baseline = { ...this.baseline, [field.key]: value }\n\t\t\tthis.notice = { type: 'success', text: t('nextcloud-vue', 'Saved.') }\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-settings-fields {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n\tcontainer-type: inline-size;\n}\n\n.cn-settings-fields__grid {\n\tdisplay: grid;\n\tgrid-template-columns: minmax(0, 1fr);\n\tgap: 16px 20px;\n}\n\n/* Two to four columns where the card is wide enough; stacked otherwise\n (DqInstellingenAlgemeen \"Huisstijl\" draws four).\n @spec openspec/changes/settings-fields-four-columns-and-note/specs/settings-fields-four-columns-and-note/spec.md */\n@container (min-width: 520px) {\n\t.cn-settings-fields__grid--2,\n\t.cn-settings-fields__grid--3,\n\t.cn-settings-fields__grid--4 {\n\t\tgrid-template-columns: repeat(2, minmax(0, 1fr));\n\t}\n}\n\n@container (min-width: 780px) {\n\t.cn-settings-fields__grid--3,\n\t.cn-settings-fields__grid--4 {\n\t\tgrid-template-columns: repeat(3, minmax(0, 1fr));\n\t}\n}\n\n@container (min-width: 960px) {\n\t.cn-settings-fields__grid--4 {\n\t\tgrid-template-columns: repeat(4, minmax(0, 1fr));\n\t}\n}\n\n.cn-settings-fields__field--wide {\n\tgrid-column: 1 / -1;\n}\n\n.cn-settings-fields__inline-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tgap: 12px;\n}\n\n.cn-settings-fields__inline-row > .cn-settings-fields__grid {\n\tflex: 0 1 50%;\n\tmin-width: min(100%, 280px);\n}\n\n/* The button lines up with the control, under a label that sits above it\n in the board look (look-board.css sets the offset). */\n.cn-settings-fields__inline-save {\n\tmargin-block-start: var(--cn-settings-fields-label-offset, 0);\n}\n\n.cn-settings-fields__advanced {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: flex-start;\n\tgap: 12px;\n}\n\n.cn-settings-fields__advanced > .cn-settings-fields__grid {\n\talign-self: stretch;\n}\n\n.cn-settings-fields__hints-toggle {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n}\n\n.cn-settings-fields__save {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: flex-end;\n\tgap: 12px;\n}\n\n.cn-settings-fields__dirty {\n\tfont-size: 14px;\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["_createBlock","_mergeProps","_createElementBlock","_Fragment","_createElementVNode","_normalizeClass","_renderList","_createTextVNode","_createVNode","_openBlock","_toDisplayString"],"mappings":";;;;AAyB2B,EAAA,KAAK,EAAC,kCAAG;;;;AAY9B,EAAA,KAAG,EAAC,gCAAW;AACf,EAAA,aAAS,EAAC,+BAAsB;;AAe7B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,iCAA4B,GAAA;;;AA+BF,EAAA,KAAK,EAAC,8BAAK;;;;;AAwC/B,EAAA,KAAA,EAAA,oDAAA;;;;AACJ,EAAA,KAAA,EAAA,2BAAA;AAAA,EAAA,aAAA,EAAA,0BAAA;;;;;;;;;;;uBAlHdA,oCACI,MAAI,CAAA,IAAA,GAAA,KAAA,GAAA,mBAAA,CAAA,EADRC,UAEO,OAAI,CAAA,IAAA,GAAA,EAAA,KAAA,EAAA,kCAAA,EAAA,GAAI,QAAA,CAAA,YAAA,EAAA,eACL,EAAC,4BAAC,EAAA,CAAA,EAAA;qBACb,MAKW;OALD,MAAA,CAAA,IAAA;wBAAVC,kBAKW,CAAAC,QAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,EAAA;aAJW,KAAO,CAAA,OAAA;8BAA5BH,WAAuC,CAAA,wBAAA,EAAA;;AAAR,kBAAA,IAAI,EAAE,EAAE;AAAA,kBAAA,aAAA,EAAA,4BAAA;;iBAChB,KAAE,CAAA,SAAA,KAAA,EAAA;gCAAzBA,WAEa,CAAA,qBAAA,EAAA;;AAFY,oBAAA,IAAA,EAAA,OAAA;AAAA,oBAAA,aAAA,EAAA,+BAAA;;qCACxB,MAAQ;sDAAL,KAAK,CAAA,SAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;AAGA,MAAA,CAAA,CAAA,KAAA,CAAA,OAAA,IAAA,KAAA,C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A,CAAA,KAAA,CAAA,CAAA;;;;4BAhBL,KAAG,CAAA,YAAA,CAAA;;;;aAoBL,KAAA,CAAA,MAAA;8BAAZL,WAKO,CAAA,qBAAA,EAAA;;;kBAHL,IAAI,EAAE,KAAM,CAAA,MAAA,CAAC,IAAI,KAAA,OAAA,GAAA,OAAA,GAAA,QAAA;AAClB,kBAAA,aAAW,EAAC,2BAA2B;;mCACtC,MAAgB;gEAAR,CAAC,IAAI,CAAA,EAAA,CAAA,YAAA;;;;;cAGH,MAAM,CAAA,QAAA,IAAA,QAAA,CAAA,SAAA,IAAA,CAAA,QAAA,CAAA,UAAA;AAAhB,iBAAAS,SAAA,EAAA,EAAAP,kBAAA,QAAA;mBACW,QAAC,CAAA,KAAA;sDAEN,CAAA,MAAA,YAAA,EAAAQ,eAAA,CADH,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,iBAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;2BAGG,EAAC,SAAS;AACjB,oBAAA,IAAI,EAAC,QAAK;oBACT,QAAQ,EAAE,KAAM,CAAA,MAAA,IAAA,CAAK,QAAA,CAAA,KAAA;AACtB,oBAAA,aAAS,EAAA,yBAAA;;qCAGF;AAAA,sBAAAH,eAAA,CAAA;;;;qBAFJ,KAAA,CAAA,MAAA;;gCAAA,MAAA;sCACF,MAAE;4BAAFC,WAAE,CAAA,wBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnSettingsFieldsSection.vue3.js","sources":["../../../../src/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue?vue&type=template&id=336ee94a&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<component\n\t\t:is=\"bare ? 'div' : 'CnSettingsSection'\"\n\t\tv-bind=\"bare ? { class: 'cn-settings-fields-section--bare' } : sectionProps\"\n\t\tdata-testid=\"cn-settings-fields-section\">\n\t\t<template v-if=\"bare\">\n\t\t\t<NcLoadingIcon v-if=\"loading\" :size=\"24\" data-testid=\"cn-settings-fields-loading\" />\n\t\t\t<NcNoteCard v-else-if=\"loadError !== ''\" type=\"error\" data-testid=\"cn-settings-fields-load-error\">\n\t\t\t\t{{ loadError }}\n\t\t\t</NcNoteCard>\n\t\t</template>\n\t\t<form v-if=\"!loading && loadError === ''\"\n\t\t\tclass=\"cn-settings-fields\"\n\t\t\tnovalidate\n\t\t\t@submit.prevent=\"save\">\n\t\t\t<div v-if=\"hintsToggle\" class=\"cn-settings-fields__hints-toggle\">\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t:aria-expanded=\"showHints ? 'true' : 'false'\"\n\t\t\t\t\tdata-testid=\"cn-settings-fields-hints-toggle\"\n\t\t\t\t\t@click=\"showHints = !showHints\">\n\t\t\t\t\t{{ showHints ? t('nextcloud-vue', 'Hide the explanations') : t('nextcloud-vue', 'Show the explanations') }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<!-- `saveInline`: the save button beside the form instead of\n\t\t\t under it (DqBeheerinstellingen Serviceaccount). -->\n\t\t\t<div v-if=\"inlineSave\"\n\t\t\t\tclass=\"cn-settings-fields__inline-row\"\n\t\t\t\tdata-testid=\"cn-settings-fields-inline-row\">\n\t\t\t\t<div class=\"cn-settings-fields__grid\" :class=\"`cn-settings-fields__grid--${columnCount}`\">\n\t\t\t\t\t<CnSettingsField\n\t\t\t\t\t\tv-for=\"field in mainFields\"\n\t\t\t\t\t\t:key=\"field.key\"\n\t\t\t\t\t\tclass=\"cn-settings-fields__field\"\n\t\t\t\t\t\t:class=\"{ 'cn-settings-fields__field--wide': field.wide || isFullWidth(field) }\"\n\t\t\t\t\t\t:field=\"field\"\n\t\t\t\t\t\t:modelValue=\"form[field.key]\"\n\t\t\t\t\t\t:error=\"errors[field.key] || unreadable[field.key] || ''\"\n\t\t\t\t\t\t:hint=\"field.hint\"\n\t\t\t\t\t\t@update:modelValue=\"setValue(field, $event)\"\n\t\t\t\t\t\t@uploaded=\"onUploaded(field, $event)\"\n\t\t\t\t\t\t@action=\"runAction(field)\" />\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cn-settings-fields__inline-save\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\t:variant=\"saveVariant\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t:disabled=\"saveDisabled\"\n\t\t\t\t\t\tdata-testid=\"cn-settings-fields-save\">\n\t\t\t\t\t\t<template v-if=\"saving\" #icon>\n\t\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ resolvedSaveLabel }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div v-else class=\"cn-settings-fields__grid\" :class=\"`cn-settings-fields__grid--${columnCount}`\">\n\t\t\t\t<CnSettingsField\n\t\t\t\t\tv-for=\"field in mainFields\"\n\t\t\t\t\t:key=\"field.key\"\n\t\t\t\t\tclass=\"cn-settings-fields__field\"\n\t\t\t\t\t:class=\"{ 'cn-settings-fields__field--wide': field.wide || isFullWidth(field) }\"\n\t\t\t\t\t:field=\"field\"\n\t\t\t\t\t:modelValue=\"form[field.key]\"\n\t\t\t\t\t:error=\"errors[field.key] || unreadable[field.key] || ''\"\n\t\t\t\t\t:hint=\"field.hint\"\n\t\t\t\t\t@update:modelValue=\"setValue(field, $event)\"\n\t\t\t\t\t@uploaded=\"onUploaded(field, $event)\"\n\t\t\t\t\t@clear=\"setClearing(field, $event)\"\n\t\t\t\t\t@action=\"runAction(field)\" />\n\t\t\t</div>\n\n\t\t\t<!-- The fields marked `advanced`, behind one disclosure after the\n\t\t\t rest (DqBeheerinstellingen Zaak-e-mail). Saved with the rest. -->\n\t\t\t<div v-if=\"advancedFields.length > 0\" class=\"cn-settings-fields__advanced\">\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t:aria-expanded=\"showAdvanced ? 'true' : 'false'\"\n\t\t\t\t\t:aria-controls=\"advancedId\"\n\t\t\t\t\tdata-testid=\"cn-settings-fields-advanced-toggle\"\n\t\t\t\t\t@click=\"showAdvanced = !showAdvanced\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<ChevronUp v-if=\"showAdvanced\" :size=\"20\" />\n\t\t\t\t\t\t<ChevronDown v-else :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ resolvedAdvancedLabel }}\n\t\t\t\t</NcButton>\n\t\t\t\t<div v-show=\"showAdvanced\"\n\t\t\t\t\t:id=\"advancedId\"\n\t\t\t\t\tclass=\"cn-settings-fields__grid\"\n\t\t\t\t\t:class=\"`cn-settings-fields__grid--${columnCount}`\"\n\t\t\t\t\tdata-testid=\"cn-settings-fields-advanced\">\n\t\t\t\t\t<CnSettingsField\n\t\t\t\t\t\tv-for=\"field in advancedFields\"\n\t\t\t\t\t\t:key=\"field.key\"\n\t\t\t\t\t\tclass=\"cn-settings-fields__field\"\n\t\t\t\t\t\t:class=\"{ 'cn-settings-fields__field--wide': field.wide || isFullWidth(field) }\"\n\t\t\t\t\t\t:field=\"field\"\n\t\t\t\t\t\t:modelValue=\"form[field.key]\"\n\t\t\t\t\t\t:error=\"errors[field.key] || unreadable[field.key] || ''\"\n\t\t\t\t\t\t:hint=\"field.hint\"\n\t\t\t\t\t\t@update:modelValue=\"setValue(field, $event)\"\n\t\t\t\t\t\t@uploaded=\"onUploaded(field, $event)\"\n\t\t\t\t\t\t@action=\"runAction(field)\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<NcNoteCard v-if=\"notice\"\n\t\t\t\t:type=\"notice.type\"\n\t\t\t\t:role=\"notice.type === 'error' ? 'alert' : 'status'\"\n\t\t\t\tdata-testid=\"cn-settings-fields-notice\">\n\t\t\t\t{{ notice.text }}\n\t\t\t</NcNoteCard>\n\n\t\t\t<div v-if=\"!autoSave && hasInputs && !inlineSave\" class=\"cn-settings-section__save cn-settings-fields__save\">\n\t\t\t\t<span v-if=\"dirty\" class=\"cn-settings-fields__dirty\" data-testid=\"cn-settings-fields-dirty\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Unsaved changes') }}\n\t\t\t\t</span>\n\t\t\t\t<NcButton\n\t\t\t\t\t:variant=\"saveVariant\"\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t:disabled=\"saveDisabled\"\n\t\t\t\t\tdata-testid=\"cn-settings-fields-save\">\n\t\t\t\t\t<template v-if=\"saving\" #icon>\n\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ resolvedSaveLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</form>\n\t</component>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { showConfirmation } from '@nextcloud/dialogs'\nimport { getCanonicalLocale, translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcLoadingIcon, NcNoteCard } from '@nextcloud/vue'\nimport ChevronDown from 'vue-material-design-icons/ChevronDown.vue'\nimport ChevronUp from 'vue-material-design-icons/ChevronUp.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { serverErrorMessage } from '../../utils/serverErrorMessage.js'\nimport { CnSettingsField } from '../CnSettingsField/index.js'\nimport { CnSettingsSection } from '../CnSettingsSection/index.js'\n\n/**\n * A value by key: the key as written when the object holds it (a flat map\n * with dotted keys such as `integration.brk.mode`), else as a dotted path.\n *\n * @param {object} data The object.\n * @param {string} key The key or dotted path.\n * @return {unknown}\n */\nfunction literalFirst(data, key) {\n\tif (data && typeof data === 'object' && Object.hasOwn(data, key)) {\n\t\treturn data[key]\n\t}\n\treturn readPath(data, key)\n}\n\n/**\n * The request options for a target: an OCS endpoint (`/ocs/...`) needs the\n * `OCS-APIRequest` header; `prefixUrl` already serves it outside index.php.\n *\n * @param {string} url The target.\n * @return {object}\n */\nfunction ocsConfig(url) {\n\treturn /^\\/ocs\\//.test(String(url)) ? { headers: { 'OCS-APIRequest': 'true' } } : {}\n}\n\n/** Types that hold no value of their own: never read into the form's dirty state, checked or saved. */\n/** A time of day, `HH:MM`. */\nconst TIME = /^([01]\\d|2[0-3]):[0-5]\\d$/\n\nconst VALUELESS_TYPES = ['heading', 'status', 'action', 'note']\n\n/** Types whose value is a list of choices (a `select` with `multiple` too). */\nconst LIST_TYPES = ['checkboxes']\n\n/** Types drawn across the whole grid. */\nconst FULL_WIDTH_TYPES = ['heading', 'status']\n\n/**\n * Whether a stored value reads as on: a boolean, or `1`, `true`, `yes` or `on`.\n *\n * @param {unknown} value The stored value.\n * @return {boolean}\n */\nfunction isOn(value) {\n\tif (typeof value === 'boolean') {\n\t\treturn value\n\t}\n\treturn ['1', 'true', 'yes', 'on'].includes(String(value ?? '').trim().toLowerCase())\n}\n\n/**\n * @param {unknown} value A value.\n * @return {boolean} Whether it is null, undefined or an empty string.\n */\nfunction isEmpty(value) {\n\treturn value === null || value === undefined || value === ''\n}\n\n/**\n * Put `{name}` placeholders' values in a text; an unknown name stays as written.\n *\n * @param {string} text The text.\n * @param {(name: string) => unknown} lookup The value of a name.\n * @return {string}\n */\nfunction interpolate(text, lookup) {\n\treturn String(text || '').replace(/\\{([A-Za-z0-9_.-]+)(\\|date)?\\}/g, (whole, name, format) => {\n\t\tconst value = lookup(name)\n\t\tif (isEmpty(value) || typeof value === 'object') {\n\t\t\treturn whole\n\t\t}\n\t\tif (format === '|date') {\n\t\t\tconst date = new Date(String(value))\n\t\t\treturn Number.isNaN(date.getTime()) ? String(value) : date.toLocaleDateString(getCanonicalLocale() || undefined, { day: 'numeric', month: 'long', year: 'numeric' })\n\t\t}\n\t\treturn String(value)\n\t})\n}\n\n/**\n * A random value of `bytes` bytes as hexadecimal, from the browser's\n * cryptographic random source.\n *\n * @param {number} bytes How many bytes.\n * @return {string}\n */\nfunction randomHex(bytes) {\n\tconst values = new Uint8Array(Math.max(1, Number(bytes) || 32))\n\tglobalThis.crypto.getRandomValues(values)\n\treturn Array.from(values, (byte) => byte.toString(16).padStart(2, '0')).join('')\n}\n\n/**\n * The text of a lines field: one entry per line, from a list or a JSON list.\n *\n * @param {unknown} raw The stored value.\n * @return {string}\n */\nfunction linesText(raw) {\n\tlet list = raw\n\tif (typeof raw === 'string') {\n\t\ttry {\n\t\t\tlist = JSON.parse(raw)\n\t\t} catch {\n\t\t\treturn raw\n\t\t}\n\t}\n\treturn Array.isArray(list) ? list.map((entry) => String(entry).trim()).filter(Boolean).join('\\n') : ''\n}\n\n/**\n * The entries of a lines field's text, trimmed, without empty lines or repeats.\n *\n * @param {unknown} text The text.\n * @return {Array<string>}\n */\nfunction linesList(text) {\n\treturn [...new Set(String(text || '').split('\\n').map((line) => line.trim()).filter(Boolean))]\n}\n\n/**\n * A multi-choice value as a list: a list, a JSON list, or comma text.\n *\n * @param {unknown} raw The stored value.\n * @return {Array}\n */\nfunction choiceList(raw) {\n\tif (Array.isArray(raw)) {\n\t\treturn raw\n\t}\n\tif (typeof raw !== 'string' || raw.trim() === '') {\n\t\treturn []\n\t}\n\ttry {\n\t\tconst parsed = JSON.parse(raw)\n\t\tif (Array.isArray(parsed)) {\n\t\t\treturn parsed\n\t\t}\n\t} catch {\n\t\t// Not JSON: comma text.\n\t}\n\treturn raw.split(',').map((entry) => entry.trim()).filter(Boolean)\n}\n\n/**\n * An object stored as an object or as JSON text, and whether it was text.\n *\n * @param {unknown} raw The stored value.\n * @return {{object: object, text: boolean}}\n */\nfunction storedObject(raw) {\n\tif (typeof raw === 'string') {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(raw || '{}')\n\t\t\treturn { object: parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {}, text: true }\n\t\t} catch {\n\t\t\treturn { object: {}, text: true }\n\t\t}\n\t}\n\treturn { object: raw && typeof raw === 'object' && !Array.isArray(raw) ? raw : {}, text: false }\n}\n\n/**\n * A field's `path` split into the setting that holds JSON and the key inside it.\n *\n * @param {object} field The field.\n * @return {{root: string, rest: string}|null}\n */\nfunction pathParts(field) {\n\tconst path = typeof field.path === 'string' ? field.path : ''\n\tconst dot = path.indexOf('.')\n\treturn dot > 0 ? { root: path.slice(0, dot), rest: path.slice(dot + 1) } : null\n}\n\n/**\n * The sentence a refused request came back with: the body's `message` when\n * there is one (a refusal names its rule under `error` and says it under\n * `message`), else the clearest message available.\n *\n * @param {unknown} error The rejected value.\n * @return {string}\n */\nfunction refusalMessage(error) {\n\tconst message = error?.response?.data?.message\n\treturn typeof message === 'string' && message.trim() !== '' && message.length <= 400 && !/^\\s*</.test(message)\n\t\t? message.trim()\n\t\t: serverErrorMessage(error)\n}\n\n/**\n * Up to two initials of a name, for an image field without an image.\n *\n * @param {unknown} name The name.\n * @return {string}\n */\nfunction initialsOf(name) {\n\treturn String(name || '').trim().split(/\\s+/).filter(Boolean).slice(0, 2).map((word) => word[0].toUpperCase()).join('')\n}\n\n/**\n * CnSettingsFieldsSection - a settings section declared as fields: it reads\n * the app's settings, draws the fields in one to four columns, and saves\n * them with ONE Save button for the section.\n *\n * It reads `GET url` (default `/apps/<appId>/api/settings`) and writes the\n * section's fields with `PUT saveUrl` (default the same url). The Save button\n * is on while something changed (\"Unsaved changes\"); a save checks the\n * fields first (required, pattern, min, max) and marks each failing field,\n * then says it saved or why it did not. A `secret` field never shows the\n * stored value: it says a value is stored, and is sent only when something\n * was typed.\n *\n * Besides value fields a section can hold a `heading`, a read-only `status`\n * note (static `text`, or `textMap` by the value read at its key, with `tone`\n * or `toneMap`) and an `action` button (it posts to its `url`, or with `fill`\n * puts a random value in another field, and shows the server's sentence). A\n * field with `visibleWhen` shows only while its condition holds. With\n * `hintsToggle` the hints fold away behind one button.\n *\n * It renders inside CnAdminSettingsShell and CnSettingsPage, in the default\n * and the board look; with `bare` it draws no card of its own (for a host\n * that already gives the section its title, such as a settings dialog).\n *\n * ```vue\n * <CnSettingsFieldsSection\n * app-id=\"myapp\"\n * name=\"Connection\"\n * :columns=\"2\"\n * :fields=\"[\n * { key: 'baseUrl', label: 'Server address', required: true, pattern: '^https://', patternMessage: 'Starts with https://' },\n * { key: 'apiKey', label: 'API key', type: 'secret' },\n * { key: 'mode', label: 'Mode', type: 'select', options: [{ value: 'live', label: 'Live' }, { value: 'test', label: 'Test' }] },\n * { key: 'enabled', label: 'Enabled', type: 'switch', hint: 'Off stops every call.' },\n * ]\" />\n * ```\n */\nexport default {\n\tname: 'CnSettingsFieldsSection',\n\n\tcomponents: { ChevronDown, ChevronUp, CnSettingsField, CnSettingsSection, NcButton, NcLoadingIcon, NcNoteCard },\n\n\tinject: {\n\t\t/** The app's translate function; identity outside CnAppRoot. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The look the page is drawn in (a string or a ref). */\n\t\tcnLook: { default: 'nextcloud' },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The Save button's variant: `primary`, or `secondary` for a card\n\t\t * whose Save is one choice among others, as a board draws it\n\t\t * (DqBeheerinstellingen \"Dit account gebruiken\").\n\t\t */\n\t\tsaveVariant: {\n\t\t\ttype: String,\n\t\t\tdefault: 'primary',\n\t\t},\n\n\t\t/** The section title. */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** The line under the title. */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A longer explanation in its own block under the title. */\n\t\tdetailedDescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A documentation link beside the title. */\n\t\tdocUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Span the whole settings grid in the board look. */\n\t\twide: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The fields: `[{ key, label, type?, hint?, placeholder?, required?,\n\t\t * pattern?, patternMessage?, min?, max?, integer?, rows?, options?, optionsUrl?,\n\t\t * optionsPath?, optionLabel?, optionValue?, default?, readOnly?, wide?,\n\t\t * url?, valuePath?, saveUrl?, saveMethod?, saveKey?, saveParams?, uploadUrl?,\n\t\t * uploadField?, uploadParams?, uploadValuePath?, initials?, initialsFrom?,\n\t\t * visibleWhen?, trueValue?, falseValue?, setKey?, saveAs?, text?, textMap?,\n\t\t * tone?, toneMap?, method?, send?, resultPath?, okPath?, successText?, failureText?, fill?,\n\t\t * multiple?, keyLabel?, valueLabel?, valueType?, valueAbove?, valueMessage?, addLabel?,\n\t\t * path?, scope? }]`.\n\t\t * `type` is `text` (default), `textarea`, `number`, `switch`, `select`,\n\t\t * `radio`, `checkboxes`, `pairs`, `lines`, `secret`, `image`, `heading`,\n\t\t * `status`, `action` or `note`. A `note` is a labelled line of plain text\n\t\t * (`text`) that holds no value: a setting kept elsewhere, said where. A `checkboxes` field (or a `select` with\n\t\t * `multiple`) saves its choices as a list, or with `saveAs` `json` or\n\t\t * `csv` as JSON or comma text. A `pairs` field edits key-to-value rows\n\t\t * and saves them as one object (JSON text with `saveAs: 'json'`); its\n\t\t * `pattern` checks each key and `valueAbove` each value. A\n\t\t * field with `path: 'setting.key'` edits one key inside a JSON-valued\n\t\t * setting and saves the whole setting back. A field with `scope: true`\n\t\t * is never saved: its value fills `{key}` in the urls, and a change\n\t\t * reads the section again.\n\t\t * `default` stands in for a value that is missing or empty. A switch\n\t\t * reads `1`/`true`/`yes`/`on` as on and saves `trueValue`/`falseValue`\n\t\t * when declared. A secret says it is stored from `setKey` when the\n\t\t * server answers that under another key. A `lines` field edits a list\n\t\t * one entry per line and saves it as a list, or as JSON text with\n\t\t * `saveAs: 'json'`. `visibleWhen` is `{ key, equals?, notEquals?, in?,\n\t\t * empty? }` (or a list of them, all of which must hold) over the form\n\t\t * and the values read; a hidden field is not checked. An action posts\n\t\t * the `send` fields to `url` with `method` (default POST) and shows the\n\t\t * answer at `resultPath` (default `message`), as an error when `okPath`\n\t\t * reads false; without a sentence there it says `successText` (or\n\t\t * `failureText` when `okPath` reads false), `{name}` filled from the\n\t\t * answer; with `fill: { key, bytes }` it puts a random value in\n\t\t * that field instead. `key` names the setting; a dotted key reads a\n\t\t * nested value and is written as written. A field with its own `url`\n\t\t * is read there (at `valuePath`, default its key) and saved to its\n\t\t * `saveUrl` (default that `url`) with `saveMethod` (default POST) under\n\t\t * `saveKey` (default its key), with `saveParams` merged into the body,\n\t\t * so one section can hold the settings of several apps. A target under\n\t\t * `/ocs/` is sent the `OCS-APIRequest` header. An `image` uploads at once to `uploadUrl`. Labels,\n\t\t * hints, placeholders and messages go through the app's translate\n\t\t * function.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-section-declared-as-fields-reads-and-saves-the-apps-settings\n\t\t */\n\t\tfields: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * The row this card is opened from (CnSettingsSection `openedFrom`): the\n\t\t * card shows only while the page's hash names its `id`.\n\t\t *\n\t\t * @spec openspec/changes/settings-section-opened-from-row/specs/settings-section-opened-from-row/spec.md#requirement-a-settings-card-can-be-opened-from-a-row\n\t\t */\n\t\topenedFrom: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Columns of the field grid: 1 to 4. A narrow card stacks them. */\n\t\tcolumns: {\n\t\t\ttype: Number,\n\t\t\tdefault: 1,\n\t\t\tvalidator: (value) => [1, 2, 3, 4].includes(value),\n\t\t},\n\n\t\t/** The app id, for the default url `/apps/<appId>/api/settings`. */\n\t\tappId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Where the settings are read (`GET`); app-absolute or a full URL. */\n\t\turl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Where the section saves; defaults to `url`. */\n\t\tsaveUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The method of the save request. */\n\t\tsaveMethod: {\n\t\t\ttype: String,\n\t\t\tdefault: 'PUT',\n\t\t\tvalidator: (value) => ['PUT', 'POST', 'PATCH'].includes(String(value).toUpperCase()),\n\t\t},\n\n\t\t/** A dotted path to the values in the GET answer; empty reads the answer itself. */\n\t\tvaluesPath: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The Save button's label. Defaults to \"Save\". */\n\t\tsaveLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The note after a save. `{name}` takes the value of that field or of\n\t\t * that key in the values read. Defaults to \"Saved.\".\n\t\t */\n\t\tsavedMessage: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Read the values again after a save, for status notes the server works out. */\n\t\treloadAfterSave: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Send every field of the section on a save, not only the changed ones,\n\t\t * for an endpoint that replaces the whole record.\n\t\t */\n\t\tsaveAll: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Fold the hints, and status notes marked `foldable`, away behind one\n\t\t * \"Show the explanations\" button, for a long form.\n\t\t */\n\t\thintsToggle: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Save each change at once (a typed value after a pause), with no Save button. */\n\t\tautoSave: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Draw no card, title or description: the host already gives the section its own. */\n\t\tbare: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Draw the save button beside the form instead of under it, for a\n\t\t * one-field form (\"Use this account\").\n\t\t *\n\t\t * @spec openspec/changes/settings-fields-inline-save-and-advanced/specs/settings-fields-inline-save-and-advanced/spec.md#requirement-a-section-can-draw-its-save-button-beside-the-form\n\t\t */\n\t\tsaveInline: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The label of the disclosure the fields marked `advanced` sit behind.\n\t\t * Defaults to \"Advanced\".\n\t\t */\n\t\tadvancedLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['saved', 'save-error'],\n\n\tdata() {\n\t\treturn {\n\t\t\tform: {},\n\t\t\tbaseline: {},\n\t\t\tstoredSecrets: {},\n\t\t\t// Secret key to true while the admin asked to remove its stored value.\n\t\t\tclearSecrets: {},\n\t\t\t// Field key to the message of a read target that failed.\n\t\t\tunreadable: {},\n\t\t\terrors: {},\n\t\t\tloading: true,\n\t\t\tloadError: '',\n\t\t\tsaving: false,\n\t\t\tnotice: null,\n\t\t\t// The values the section's own read target answered, for status\n\t\t\t// notes, visibleWhen and placeholders that name a key no field holds.\n\t\t\tvalues: {},\n\t\t\tactionStates: {},\n\t\t\tshowHints: false,\n\t\t\tshowAdvanced: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether Save is unavailable: while saving, and, in the Nextcloud\n\t\t * look, while nothing changed. The boards draw a settings card's Save\n\t\t * ready to press (r31: every board settings card's \"Opslaan\" read\n\t\t * grey on live); pressing it with nothing changed sends nothing.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/board-settings-save-ready/specs/settings-board-look/spec.md\n\t\t */\n\t\tsaveDisabled() {\n\t\t\tconst look = this.cnLook && typeof this.cnLook === 'object' && 'value' in this.cnLook ? this.cnLook.value : this.cnLook\n\t\t\treturn this.saving || (!this.dirty && normalizeLook(look) !== 'board')\n\t\t},\n\n\t\t/** @return {number} The column count, 1 to 4. */\n\t\tcolumnCount() {\n\t\t\treturn [1, 2, 3, 4].includes(this.columns) ? this.columns : 1\n\t\t},\n\n\t\t/** @return {object} The props of the card around the form. */\n\t\tsectionProps() {\n\t\t\treturn {\n\t\t\t\tname: this.name,\n\t\t\t\tdescription: this.description,\n\t\t\t\tdetailedDescription: this.detailedDescription,\n\t\t\t\tdocUrl: this.docUrl,\n\t\t\t\twide: this.wide,\n\t\t\t\tloading: this.loading,\n\t\t\t\terror: this.loadError !== '',\n\t\t\t\terrorMessage: this.loadError,\n\t\t\t\tonRetry: this.load,\n\t\t\t\topenedFrom: this.openedFrom,\n\t\t\t}\n\t\t},\n\n\t\t/** @return {string} Where the settings are read: `url`, else the app's settings endpoint. */\n\t\treadTarget() {\n\t\t\treturn this.resolveUrl(this.url || (this.appId ? `/apps/${this.appId}/api/settings` : ''))\n\t\t},\n\n\t\t/** @return {string} Where the section saves: `saveUrl`, else the read target. */\n\t\twriteTarget() {\n\t\t\treturn this.saveUrl ? this.resolveUrl(this.saveUrl) : this.readTarget\n\t\t},\n\n\t\t/**\n\t\t * The values of the scope fields: the form's, else their `default`.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tscopeValues() {\n\t\t\tconst values = {}\n\t\t\tfor (const field of Array.isArray(this.fields) ? this.fields : []) {\n\t\t\t\tif (field && field.scope && field.key) {\n\t\t\t\t\tvalues[field.key] = isEmpty(this.form[field.key]) ? field.default : this.form[field.key]\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn values\n\t\t},\n\n\t\t/**\n\t\t * The declared fields with their text translated and a secret's stored state.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tresolvedFields() {\n\t\t\treturn (Array.isArray(this.fields) ? this.fields : [])\n\t\t\t\t.filter((field) => field && typeof field.key === 'string' && field.key !== '')\n\t\t\t\t.map((field) => ({\n\t\t\t\t\t...field,\n\t\t\t\t\tlabel: this.tr(field.label || field.key),\n\t\t\t\t\thint: this.hintsToggle && !this.showHints ? '' : this.tr(field.hint || ''),\n\t\t\t\t\tplaceholder: this.tr(field.placeholder || ''),\n\t\t\t\t\toptions: Array.isArray(field.options) ? field.options.map((option) => this.translateOption(option)) : field.options,\n\t\t\t\t\tsecretSet: field.type === 'secret' ? !!this.storedSecrets[field.key] : undefined,\n\t\t\t\t\tclearing: field.type === 'secret' ? !!this.clearSecrets[field.key] : undefined,\n\t\t\t\t\tinitials: field.type === 'image' ? initialsOf(field.initialsFrom ? this.form[field.initialsFrom] : field.initials) : undefined,\n\t\t\t\t\treadOnly: field.readOnly || !!this.unreadable[field.key],\n\t\t\t\t\t...(field.type === 'status' ? this.statusOf(field) : {}),\n\t\t\t\t\t...(field.type === 'action' ? { actionBusy: !!this.actionStates[field.key]?.busy, actionResult: this.actionStates[field.key]?.result || null } : {}),\n\t\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * The fields shown now: their `visibleWhen` holds, and a status note has text.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tvisibleFields() {\n\t\t\treturn this.resolvedFields.filter((field) => this.isVisible(field)\n\t\t\t\t&& !(field.type === 'status' && field.text === '')\n\t\t\t\t&& !(field.foldable && this.hintsToggle && !this.showHints))\n\t\t},\n\n\t\t/**\n\t\t * The visible fields drawn in the form itself: every one not marked `advanced`.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tmainFields() {\n\t\t\treturn this.visibleFields.filter((field) => field.advanced !== true)\n\t\t},\n\n\t\t/**\n\t\t * The visible fields marked `advanced`, drawn behind the disclosure.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t * @spec openspec/changes/settings-fields-inline-save-and-advanced/specs/settings-fields-inline-save-and-advanced/spec.md#requirement-advanced-fields-sit-behind-one-disclosure\n\t\t */\n\t\tadvancedFields() {\n\t\t\treturn this.visibleFields.filter((field) => field.advanced === true)\n\t\t},\n\n\t\t/** @return {string} The id the disclosure's button controls. */\n\t\tadvancedId() {\n\t\t\treturn `cn-settings-fields-advanced-${this.$.uid}`\n\t\t},\n\n\t\t/** @return {string} The disclosure's label, translated. */\n\t\tresolvedAdvancedLabel() {\n\t\t\treturn this.advancedLabel ? this.tr(this.advancedLabel) : t('nextcloud-vue', 'Advanced')\n\t\t},\n\n\t\t/** @return {boolean} Whether the save button stands beside the form. */\n\t\tinlineSave() {\n\t\t\treturn this.saveInline && !this.autoSave && this.hasInputs\n\t\t},\n\n\t\t/** @return {boolean} Whether the section holds a field with a value to save. */\n\t\thasInputs() {\n\t\t\treturn this.resolvedFields.some((field) => !VALUELESS_TYPES.includes(field.type) && !field.scope)\n\t\t},\n\n\t\t/**\n\t\t * Whether something changed since the last load or save.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-one-save-per-section-with-a-dirty-state\n\t\t */\n\t\tdirty() {\n\t\t\treturn Object.values(this.clearSecrets).some(Boolean) || this.resolvedFields.some((field) => field.type !== 'image' && !field.scope && !VALUELESS_TYPES.includes(field.type) && !this.same(this.form[field.key], this.baseline[field.key]))\n\t\t},\n\n\t\t/** @return {string} The Save button's label. */\n\t\tresolvedSaveLabel() {\n\t\t\treturn this.saveLabel ? this.tr(this.saveLabel) : t('nextcloud-vue', 'Save')\n\t\t},\n\t},\n\n\twatch: {\n\t\t/**\n\t\t * Open the advanced fields when one of them is refused, so its\n\t\t * message is not hidden.\n\t\t *\n\t\t * @param {object} errors Field key to message.\n\t\t */\n\t\terrors(errors) {\n\t\t\tif (this.advancedFields.some((field) => errors[field.key])) {\n\t\t\t\tthis.showAdvanced = true\n\t\t\t}\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.load()\n\t},\n\n\tbeforeUnmount() {\n\t\tclearTimeout(this.autoSaveTimer)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * @param {object} field A field.\n\t\t * @return {boolean} Whether it spans the whole grid.\n\t\t */\n\t\tisFullWidth(field) {\n\t\t\treturn FULL_WIDTH_TYPES.includes(field.type)\n\t\t},\n\n\t\t/**\n\t\t * A url with its `{key}` tokens filled from the scope fields.\n\t\t *\n\t\t * @param {string} url The declared url.\n\t\t * @return {string}\n\t\t * @spec openspec/changes/settings-fields-lists/specs/settings-fields-section/spec.md#requirement-a-scope-field-fills-the-url\n\t\t */\n\t\tresolveUrl(url) {\n\t\t\tif (!url || !String(url).includes('{')) {\n\t\t\t\treturn url || ''\n\t\t\t}\n\t\t\tconst scope = this.scopeValues\n\t\t\treturn interpolate(url, (name) => (Object.hasOwn(scope, name) ? encodeURIComponent(String(scope[name] ?? '')) : undefined))\n\t\t},\n\n\t\t/**\n\t\t * @param {object} field A field.\n\t\t * @return {boolean} Whether its value is a list of choices.\n\t\t */\n\t\tisList(field) {\n\t\t\treturn LIST_TYPES.includes(field.type) || (field.type === 'select' && field.multiple === true)\n\t\t},\n\n\t\t/**\n\t\t * @param {object|string|number} option A declared option.\n\t\t * @return {object|string|number} It with its label and description translated.\n\t\t */\n\t\ttranslateOption(option) {\n\t\t\tif (!option || typeof option !== 'object') {\n\t\t\t\treturn option\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...option,\n\t\t\t\t...(typeof option.label === 'string' ? { label: this.tr(option.label) } : {}),\n\t\t\t\t...(typeof option.description === 'string' ? { description: this.tr(option.description) } : {}),\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A value by name: the field's form value, else the value read at that key.\n\t\t *\n\t\t * @param {string} key The field key or a key in the values read.\n\t\t * @return {unknown}\n\t\t */\n\t\tvalueOf(key) {\n\t\t\treturn Object.hasOwn(this.form, key) ? this.form[key] : literalFirst(this.values, key)\n\t\t},\n\n\t\t/**\n\t\t * Whether a field's `visibleWhen` holds; a field without one is always shown.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-field-can-depend-on-another\n\t\t */\n\t\tisVisible(field) {\n\t\t\tconst conditions = Array.isArray(field.visibleWhen) ? field.visibleWhen : (field.visibleWhen ? [field.visibleWhen] : [])\n\t\t\treturn conditions.every((condition) => {\n\t\t\t\tconst value = this.valueOf(condition.key)\n\t\t\t\tif ('equals' in condition) {\n\t\t\t\t\treturn typeof condition.equals === 'boolean' ? isOn(value) === condition.equals : String(value ?? '') === String(condition.equals)\n\t\t\t\t}\n\t\t\t\tif ('notEquals' in condition) {\n\t\t\t\t\treturn typeof condition.notEquals === 'boolean' ? isOn(value) !== condition.notEquals : String(value ?? '') !== String(condition.notEquals)\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(condition.in)) {\n\t\t\t\t\treturn condition.in.map(String).includes(String(value ?? ''))\n\t\t\t\t}\n\t\t\t\tif ('empty' in condition) {\n\t\t\t\t\treturn isEmpty(value) === !!condition.empty\n\t\t\t\t}\n\t\t\t\treturn !isEmpty(value) && value !== false\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * A status note's text and tone: its static `text`, else its `textMap`\n\t\t * entry for the value read at its key (`*` for any other value), with\n\t\t * `{name}` placeholders filled; an empty text hides the note.\n\t\t *\n\t\t * @param {object} field The status field.\n\t\t * @return {{text: string, tone: string}}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-status-note-and-an-action-sit-between-the-fields\n\t\t */\n\t\tstatusOf(field) {\n\t\t\tconst value = this.form[field.key]\n\t\t\tconst key = isEmpty(value) ? '' : String(value)\n\t\t\tconst map = field.textMap && typeof field.textMap === 'object' ? field.textMap : null\n\t\t\tlet text = field.text ?? ''\n\t\t\tif (!field.text && map) {\n\t\t\t\ttext = Object.hasOwn(map, key) ? map[key] : (map['*'] ?? '')\n\t\t\t} else if (!field.text) {\n\t\t\t\ttext = key\n\t\t\t}\n\t\t\tconst tones = field.toneMap && typeof field.toneMap === 'object' ? field.toneMap : {}\n\t\t\treturn {\n\t\t\t\ttext: interpolate(this.tr(text), (name) => (name === 'value' ? value : this.valueOf(name))),\n\t\t\t\ttone: field.tone || (Object.hasOwn(tones, key) ? tones[key] : tones['*']) || 'info',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @param {string} value A declared string.\n\t\t * @return {string} It through the app's translate function.\n\t\t */\n\t\ttr(value) {\n\t\t\treturn typeof value === 'string' && value !== '' ? this.cnTranslate(value) : (value || '')\n\t\t},\n\n\t\t/**\n\t\t * @param {unknown} a A value.\n\t\t * @param {unknown} b Another.\n\t\t * @return {boolean} Whether they count as the same setting.\n\t\t */\n\t\tsame(a, b) {\n\t\t\tconst empty = (v) => v === null || v === undefined || v === ''\n\t\t\tif (empty(a) && empty(b)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn JSON.stringify(a) === JSON.stringify(b)\n\t\t},\n\n\t\t/**\n\t\t * Change a field's value; its error goes until the next save.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @param {unknown} value The value.\n\t\t * @return {void}\n\t\t */\n\t\tsetValue(field, value) {\n\t\t\tthis.form = { ...this.form, [field.key]: value }\n\t\t\tif (this.errors[field.key]) {\n\t\t\t\tconst { [field.key]: _gone, ...rest } = this.errors\n\t\t\t\tthis.errors = rest\n\t\t\t}\n\t\t\tthis.notice = null\n\t\t\tif (field.scope) {\n\t\t\t\tthis.load(true)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.autoSave) {\n\t\t\t\tclearTimeout(this.autoSaveTimer)\n\t\t\t\tconst typed = ['text', 'textarea', 'lines', 'number', 'secret', 'password', undefined].includes(field.type)\n\t\t\t\tthis.autoSaveTimer = setTimeout(() => this.save(), typed ? 600 : 0)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run an action field: put a random value in its `fill` field, or post\n\t\t * its `send` fields to its `url` and show the answer's sentence.\n\t\t *\n\t\t * @param {object} field The action field.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-status-note-and-an-action-sit-between-the-fields\n\t\t */\n\t\tasync runAction(field) {\n\t\t\tconst setState = (state) => {\n\t\t\t\tthis.actionStates = { ...this.actionStates, [field.key]: state }\n\t\t\t}\n\t\t\tif (field.fill && field.fill.key) {\n\t\t\t\tconst target = this.fields.find((candidate) => candidate && candidate.key === field.fill.key)\n\t\t\t\tif (target) {\n\t\t\t\t\tthis.setValue(target, randomHex(field.fill.bytes))\n\t\t\t\t}\n\t\t\t\tsetState({ busy: false, result: field.successText ? { type: 'success', text: this.tr(field.successText) } : null })\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!field.url) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (field.confirm && !(await this.confirmAction(field))) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetState({ busy: true, result: null })\n\t\t\tconst data = { ...(field.params && typeof field.params === 'object' ? field.params : {}) }\n\t\t\tfor (const key of Array.isArray(field.send) ? field.send : []) {\n\t\t\t\tconst sent = this.fields.find((candidate) => candidate && candidate.key === key)\n\t\t\t\tif (!(sent?.type === 'secret' && isEmpty(this.form[key]))) {\n\t\t\t\t\tdata[key] = this.form[key]\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst url = this.resolveUrl(field.url)\n\t\t\t\tconst response = await axios.request({ url: prefixUrl(url), method: String(field.method || 'POST').toLowerCase(), data, ...ocsConfig(url) })\n\t\t\t\tconst answer = response?.data ?? {}\n\t\t\t\tconst said = literalFirst(answer, field.resultPath || 'message')\n\t\t\t\tconst ok = field.okPath ? isOn(literalFirst(answer, field.okPath)) : true\n\t\t\t\tconst fallback = !ok && field.failureText ? field.failureText : field.successText\n\t\t\t\tconst text = typeof said === 'string' && said !== ''\n\t\t\t\t\t? said\n\t\t\t\t\t: (interpolate(this.tr(fallback || ''), (name) => literalFirst(answer, name)) || t('nextcloud-vue', 'Done.'))\n\t\t\t\tsetState({ busy: false, result: { type: ok ? 'success' : 'error', text } })\n\t\t\t\tif (ok && field.reload) {\n\t\t\t\t\tawait this.load(true)\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tsetState({ busy: false, result: { type: 'error', text: refusalMessage(error) } })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Read the settings and fill the fields; a secret's value is never put\n\t\t * in the form, only whether one is stored.\n\t\t *\n\t\t * @param {boolean} quiet Read again without the loading state, keeping the form on screen.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync load(quiet = false) {\n\t\t\tif (quiet !== true) {\n\t\t\t\tthis.loading = true\n\t\t\t}\n\t\t\tthis.loadError = ''\n\t\t\ttry {\n\t\t\t\t// One GET per distinct read target; the section's own target must\n\t\t\t\t// answer, a field's own target may fail on its own.\n\t\t\t\t// An action's url is where it posts, never a value to read.\n\t\t\t\tconst targets = [...new Set(this.fields\n\t\t\t\t\t.filter((field) => field && field.key && field.type !== 'action' && field.type !== 'heading')\n\t\t\t\t\t.map((field) => this.readUrlOf(field))\n\t\t\t\t\t.filter(Boolean))]\n\t\t\t\tconst answers = {}\n\t\t\t\tconst failures = {}\n\t\t\t\tawait Promise.all(targets.map(async (target) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst response = await axios.get(prefixUrl(target), ocsConfig(target))\n\t\t\t\t\t\tanswers[target] = response?.data ?? {}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tfailures[target] = error\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t\t\tif (this.readTarget && failures[this.readTarget]) {\n\t\t\t\t\tthrow failures[this.readTarget]\n\t\t\t\t}\n\t\t\t\tconst form = {}\n\t\t\t\tconst stored = {}\n\t\t\t\tconst unreadable = {}\n\t\t\t\tconst scope = this.scopeValues\n\t\t\t\tconst own = this.readTarget ? answers[this.readTarget] : null\n\t\t\t\tthis.values = (own && this.valuesPath ? literalFirst(own, this.valuesPath) : own) || {}\n\t\t\t\tfor (const field of this.fields || []) {\n\t\t\t\t\tif (!field || !field.key || field.type === 'heading' || field.type === 'action') {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif (field.scope) {\n\t\t\t\t\t\tform[field.key] = scope[field.key] ?? ''\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst target = this.readUrlOf(field)\n\t\t\t\t\tif (target && failures[target]) {\n\t\t\t\t\t\tunreadable[field.key] = t('nextcloud-vue', 'This value could not be loaded: {reason}', { reason: serverErrorMessage(failures[target]) })\n\t\t\t\t\t}\n\t\t\t\t\tconst answer = target ? answers[target] : null\n\t\t\t\t\tconst raw = this.readValue(field, answer)\n\t\t\t\t\tif (field.type === 'secret') {\n\t\t\t\t\t\tconst flag = field.setKey ? this.readValue({ ...field, key: field.setKey, valuePath: field.setKey }, answer) : raw\n\t\t\t\t\t\tstored[field.key] = field.setKey ? isOn(flag) : !isEmpty(flag) && flag !== false\n\t\t\t\t\t\tform[field.key] = ''\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tform[field.key] = this.formValue(field, raw)\n\t\t\t\t}\n\t\t\t\tthis.form = form\n\t\t\t\tthis.baseline = { ...form }\n\t\t\t\tthis.storedSecrets = stored\n\t\t\t\tthis.unreadable = unreadable\n\t\t\t\tthis.errors = {}\n\t\t\t} catch (error) {\n\t\t\t\tthis.loadError = t('nextcloud-vue', 'The settings could not be loaded: {reason}', { reason: serverErrorMessage(error) })\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A stored value as the field edits it: `default` for a missing or empty\n\t\t * value, a switch as on or off, a list as one entry per line.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @param {unknown} raw The stored value.\n\t\t * @return {unknown}\n\t\t */\n\t\tformValue(field, raw) {\n\t\t\tconst value = isEmpty(raw) && field.default !== undefined ? field.default : raw\n\t\t\tif (field.type === 'switch' || field.type === 'boolean') {\n\t\t\t\treturn isEmpty(value) ? false : isOn(value)\n\t\t\t}\n\t\t\tif (field.type === 'lines') {\n\t\t\t\treturn linesText(value)\n\t\t\t}\n\t\t\tif (this.isList(field)) {\n\t\t\t\treturn choiceList(value)\n\t\t\t}\n\t\t\tif (field.type === 'pairs') {\n\t\t\t\treturn Object.entries(storedObject(value).object).map(([key, entry]) => ({ key, value: entry }))\n\t\t\t}\n\t\t\tif (field.type === 'week-hours') {\n\t\t\t\treturn JSON.parse(JSON.stringify(storedObject(value).object))\n\t\t\t}\n\t\t\treturn value === undefined ? '' : value\n\t\t},\n\n\t\t/**\n\t\t * A form value as it is saved: a switch as its `trueValue`/`falseValue`,\n\t\t * a lines field as a list (or JSON text with `saveAs: 'json'`).\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @param {unknown} value The form value.\n\t\t * @return {unknown}\n\t\t */\n\t\tsavedValue(field, value) {\n\t\t\tif ((field.type === 'switch' || field.type === 'boolean') && (field.trueValue !== undefined || field.falseValue !== undefined)) {\n\t\t\t\treturn value ? (field.trueValue ?? true) : (field.falseValue ?? false)\n\t\t\t}\n\t\t\tif (field.type === 'lines') {\n\t\t\t\tconst list = linesList(value)\n\t\t\t\treturn field.saveAs === 'json' ? JSON.stringify(list) : list\n\t\t\t}\n\t\t\tif (this.isList(field)) {\n\t\t\t\tconst list = Array.isArray(value) ? value : []\n\t\t\t\tif (field.saveAs === 'json') {\n\t\t\t\t\treturn JSON.stringify(list)\n\t\t\t\t}\n\t\t\t\treturn field.saveAs === 'csv' ? list.join(',') : list\n\t\t\t}\n\t\t\tif (field.type === 'pairs') {\n\t\t\t\tconst object = {}\n\t\t\t\tfor (const row of Array.isArray(value) ? value : []) {\n\t\t\t\t\tconst key = String(row?.key ?? '').trim()\n\t\t\t\t\tif (key !== '') {\n\t\t\t\t\t\tobject[key] = field.valueType === 'number' && !isEmpty(row.value) ? Number(row.value) : row.value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn field.saveAs === 'json' ? JSON.stringify(object) : object\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\t/**\n\t\t * Where a field is read: its own `url`, else the section's.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @return {string}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-field-can-read-and-save-elsewhere\n\t\t */\n\t\treadUrlOf(field) {\n\t\t\treturn field.url ? this.resolveUrl(field.url) : this.readTarget\n\t\t},\n\n\t\t/**\n\t\t * A field's value in its read answer: at its `valuePath` (a field with its\n\t\t * own `url`), else at the section's `valuesPath`, then its `key`. A key\n\t\t * the answer holds as written wins over reading it as a dotted path.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @param {object|null} data The answer of the field's read target.\n\t\t * @return {unknown}\n\t\t */\n\t\treadValue(field, data) {\n\t\t\tif (!data || typeof data !== 'object') {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (field.url) {\n\t\t\t\treturn literalFirst(data, field.valuePath || field.key)\n\t\t\t}\n\t\t\tconst values = (this.valuesPath ? literalFirst(data, this.valuesPath) : data) || {}\n\t\t\tconst parts = pathParts(field)\n\t\t\tif (parts) {\n\t\t\t\treturn readPath(storedObject(literalFirst(values, parts.root)).object, parts.rest)\n\t\t\t}\n\t\t\treturn literalFirst(values, field.key)\n\t\t},\n\n\t\t/**\n\t\t * Check the fields: required, pattern, and a number's min and max.\n\t\t *\n\t\t * @return {object} Field key to message; empty when all pass.\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-a-failing-field-says-why\n\t\t */\n\t\tvalidate() {\n\t\t\tconst errors = {}\n\t\t\tfor (const field of this.resolvedFields) {\n\t\t\t\tconst value = this.form[field.key]\n\t\t\t\tconst empty = value === null || value === undefined || value === '' || (Array.isArray(value) && value.length === 0)\n\t\t\t\tif (['switch', 'boolean', 'image', ...VALUELESS_TYPES].includes(field.type) || field.scope || this.unreadable[field.key] || !this.isVisible(field)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.required && empty && !(field.type === 'secret' && field.secretSet)) {\n\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} is required.', { field: field.label })\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (empty) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.type === 'week-hours') {\n\t\t\t\t\tconst late = Object.values(value).some((hours) => hours && !(TIME.test(hours.opens || '') && TIME.test(hours.closes || '') && hours.opens < hours.closes))\n\t\t\t\t\tif (late) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field}: a day closes before it opens, or a time is missing.', { field: field.label })\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.type === 'pairs') {\n\t\t\t\t\tconst rows = value.filter((row) => String(row?.key ?? '').trim() !== '')\n\t\t\t\t\tconst keys = rows.map((row) => String(row.key).trim())\n\t\t\t\t\tconst twice = keys.find((key, at) => keys.indexOf(key) !== at)\n\t\t\t\t\tconst badKey = field.pattern ? keys.find((key) => !new RegExp(field.pattern).test(key)) : undefined\n\t\t\t\t\tconst badValue = field.valueAbove !== undefined\n\t\t\t\t\t\t? rows.find((row) => isEmpty(row.value) || Number.isNaN(Number(row.value)) || Number(row.value) <= field.valueAbove)\n\t\t\t\t\t\t: undefined\n\t\t\t\t\tif (twice) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} holds {key} twice.', { field: field.label, key: twice })\n\t\t\t\t\t} else if (badKey !== undefined) {\n\t\t\t\t\t\terrors[field.key] = field.patternMessage ? this.tr(field.patternMessage) : t('nextcloud-vue', '{field} is not in the right form.', { field: field.label })\n\t\t\t\t\t} else if (badValue) {\n\t\t\t\t\t\terrors[field.key] = field.valueMessage ? this.tr(field.valueMessage) : t('nextcloud-vue', 'The value for {key} must be above {min}.', { key: String(badValue.key).trim(), min: field.valueAbove })\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (this.isList(field)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.pattern && !new RegExp(field.pattern).test(String(value))) {\n\t\t\t\t\terrors[field.key] = field.patternMessage ? this.tr(field.patternMessage) : t('nextcloud-vue', '{field} is not in the right form.', { field: field.label })\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.type === 'number') {\n\t\t\t\t\tconst number = Number(value)\n\t\t\t\t\tif (Number.isNaN(number)) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} must be a number.', { field: field.label })\n\t\t\t\t\t} else if (field.integer && !Number.isInteger(number)) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} must be a whole number.', { field: field.label })\n\t\t\t\t\t} else if (field.min !== undefined && number < field.min) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} must be at least {min}.', { field: field.label, min: field.min })\n\t\t\t\t\t} else if (field.max !== undefined && number > field.max) {\n\t\t\t\t\t\terrors[field.key] = t('nextcloud-vue', '{field} must be at most {max}.', { field: field.label, max: field.max })\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn errors\n\t\t},\n\n\t\t/**\n\t\t * Save the section's fields in one request, after checking them. A\n\t\t * secret is sent only when something was typed.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/settings-fields-section/specs/settings-fields-section/spec.md#requirement-one-save-per-section-with-a-dirty-state\n\t\t */\n\t\tasync save() {\n\t\t\tif (this.saving) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.errors = this.validate()\n\t\t\tconst failing = Object.keys(this.errors)\n\t\t\tif (failing.length > 0) {\n\t\t\t\tthis.notice = { type: 'error', text: t('nextcloud-vue', 'Check the marked fields.') }\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tconst el = this.$el?.querySelector?.('[aria-invalid=\"true\"], .cn-settings-field__error')\n\t\t\t\t\tconst control = el?.closest?.('.cn-settings-field')?.querySelector?.('input, textarea, [role=\"combobox\"]')\n\t\t\t\t\tcontrol?.focus?.()\n\t\t\t\t})\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// The changed fields, one request per save target, each carrying its\n\t\t\t// own fields under their `saveKey`. A secret goes only when typed; an\n\t\t\t// image is uploaded on its own; a field that could not be read is left out.\n\t\t\tconst groups = new Map()\n\t\t\tfor (const field of this.resolvedFields) {\n\t\t\t\tconst value = this.form[field.key]\n\t\t\t\tconst clearing = field.type === 'secret' && this.clearSecrets[field.key] === true\n\t\t\t\tif (field.type === 'image' || field.scope || VALUELESS_TYPES.includes(field.type) || this.unreadable[field.key] || (!clearing && !this.saveAll && this.same(value, this.baseline[field.key]))) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.type === 'secret' && !clearing && (value === '' || value === null || value === undefined)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst url = this.resolveUrl(field.saveUrl || field.url) || this.writeTarget\n\t\t\t\tconst method = String(field.saveMethod || (field.saveUrl || field.url ? 'POST' : this.saveMethod)).toLowerCase()\n\t\t\t\tconst id = `${method} ${url}`\n\t\t\t\tif (!groups.has(id)) {\n\t\t\t\t\tgroups.set(id, { url, method, fields: [], data: {} })\n\t\t\t\t}\n\t\t\t\tconst group = groups.get(id)\n\t\t\t\tgroup.fields.push(field)\n\t\t\t\tObject.assign(group.data, field.saveParams || {})\n\t\t\t\tconst parts = pathParts(field)\n\t\t\t\tif (parts) {\n\t\t\t\t\tgroup.data[parts.root] = this.jsonSettingWith(parts.root)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (clearing) {\n\t\t\t\t\tgroup.data[field.clearKey || field.saveKey || field.key] = field.clearKey ? true : ''\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tgroup.data[field.saveKey || field.key] = this.savedValue(field, value)\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tthis.notice = null\n\t\t\tconst failed = []\n\t\t\tconst sent = {}\n\t\t\tfor (const group of groups.values()) {\n\t\t\t\ttry {\n\t\t\t\t\tawait axios.request({ url: prefixUrl(group.url), method: group.method, data: group.data, ...ocsConfig(group.url) })\n\t\t\t\t\tObject.assign(sent, group.data)\n\t\t\t\t\tthis.keepJsonSettings(group)\n\t\t\t\t\tthis.acceptSaved(group.fields)\n\t\t\t\t} catch (error) {\n\t\t\t\t\tfailed.push({ group, error })\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (failed.length === 0 && groups.size > 0 && this.reloadAfterSave) {\n\t\t\t\tawait this.load(true)\n\t\t\t}\n\t\t\tthis.saving = false\n\t\t\tif (failed.length === 0) {\n\t\t\t\tif (groups.size === 0) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.notice = { type: 'success', text: this.savedMessage ? interpolate(this.tr(this.savedMessage), (name) => this.valueOf(name)) : t('nextcloud-vue', 'Saved.') }\n\t\t\t\t/**\n\t\t\t\t * @event saved The section saved. Payload: what was sent, by save key.\n\t\t\t\t */\n\t\t\t\tthis.$emit('saved', sent)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst reasons = failed.map(({ group, error }) => (groups.size > 1\n\t\t\t\t? t('nextcloud-vue', '{fields}: {reason}', { fields: group.fields.map((field) => field.label).join(', '), reason: refusalMessage(error) })\n\t\t\t\t: refusalMessage(error)))\n\t\t\tthis.notice = { type: 'error', text: t('nextcloud-vue', 'The settings could not be saved: {reason}', { reason: reasons.join('; ') }) }\n\t\t\t/**\n\t\t\t * @event save-error A save request failed. Payload: the first error.\n\t\t\t */\n\t\t\tthis.$emit('save-error', failed[0].error)\n\t\t},\n\n\t\t/**\n\t\t * Keep the JSON-valued settings a save sent as the values read, so the\n\t\t * next save starts from them.\n\t\t *\n\t\t * @param {{fields: Array<object>, data: object}} group The saved request.\n\t\t * @return {void}\n\t\t */\n\t\tkeepJsonSettings(group) {\n\t\t\tconst roots = group.fields.map((field) => pathParts(field)?.root).filter(Boolean)\n\t\t\tif (roots.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst values = { ...this.values }\n\t\t\tfor (const root of roots) {\n\t\t\t\tvalues[root] = group.data[root]\n\t\t\t}\n\t\t\tthis.values = values\n\t\t},\n\n\t\t/**\n\t\t * A JSON-valued setting as it is saved: the value read, with every\n\t\t * field whose `path` lies inside it set from the form; JSON text when\n\t\t * it was read as text.\n\t\t *\n\t\t * @param {string} root The setting's key.\n\t\t * @return {object|string}\n\t\t * @spec openspec/changes/settings-fields-lists/specs/settings-fields-section/spec.md#requirement-a-field-can-edit-one-key-of-a-json-setting\n\t\t */\n\t\tjsonSettingWith(root) {\n\t\t\tconst stored = storedObject(literalFirst(this.values, root))\n\t\t\tconst object = JSON.parse(JSON.stringify(stored.object))\n\t\t\tfor (const field of this.resolvedFields) {\n\t\t\t\tconst parts = pathParts(field)\n\t\t\t\tif (!parts || parts.root !== root) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst keys = parts.rest.split('.')\n\t\t\t\tlet node = object\n\t\t\t\tfor (const key of keys.slice(0, -1)) {\n\t\t\t\t\tnode[key] = node[key] && typeof node[key] === 'object' ? node[key] : {}\n\t\t\t\t\tnode = node[key]\n\t\t\t\t}\n\t\t\t\tnode[keys[keys.length - 1]] = this.savedValue(field, this.form[field.key])\n\t\t\t}\n\t\t\treturn stored.text ? JSON.stringify(object) : object\n\t\t},\n\n\t\t/**\n\t\t * Take saved fields as the new baseline; a saved secret reads as stored.\n\t\t *\n\t\t * @param {Array<object>} fields The fields that saved.\n\t\t * @return {void}\n\t\t */\n\t\tacceptSaved(fields) {\n\t\t\tconst form = { ...this.form }\n\t\t\tconst baseline = { ...this.baseline }\n\t\t\tconst stored = { ...this.storedSecrets }\n\t\t\tconst clearing = { ...this.clearSecrets }\n\t\t\tfor (const field of fields) {\n\t\t\t\tif (field.type === 'secret') {\n\t\t\t\t\tstored[field.key] = clearing[field.key] !== true\n\t\t\t\t\tdelete clearing[field.key]\n\t\t\t\t\tform[field.key] = ''\n\t\t\t\t}\n\t\t\t\tbaseline[field.key] = form[field.key]\n\t\t\t}\n\t\t\tthis.form = form\n\t\t\tthis.baseline = baseline\n\t\t\tthis.storedSecrets = stored\n\t\t\tthis.clearSecrets = clearing\n\t\t},\n\n\t\t/**\n\t\t * Mark a stored secret for removal on the next save, or keep it.\n\t\t *\n\t\t * @param {object} field The secret field.\n\t\t * @param {boolean} on Whether to remove the stored value.\n\t\t * @return {void}\n\t\t */\n\t\tsetClearing(field, on) {\n\t\t\tconst next = { ...this.clearSecrets }\n\t\t\tif (on) {\n\t\t\t\tnext[field.key] = true\n\t\t\t\tthis.form = { ...this.form, [field.key]: '' }\n\t\t\t} else {\n\t\t\t\tdelete next[field.key]\n\t\t\t}\n\t\t\tthis.clearSecrets = next\n\t\t\tthis.notice = null\n\t\t},\n\n\t\t/**\n\t\t * Ask before an action with `confirm`; closing the question is a no.\n\t\t *\n\t\t * @param {object} field The action field.\n\t\t * @return {Promise<boolean>} Whether to go on.\n\t\t */\n\t\tasync confirmAction(field) {\n\t\t\ttry {\n\t\t\t\treturn (await showConfirmation({\n\t\t\t\t\tname: field.label,\n\t\t\t\t\ttext: this.tr(field.confirm),\n\t\t\t\t\tlabelConfirm: this.tr(field.confirmLabel || '') || field.label,\n\t\t\t\t\tlabelReject: t('nextcloud-vue', 'Cancel'),\n\t\t\t\t})) === true\n\t\t\t} catch {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * An image field uploaded a file: its new value is the baseline too.\n\t\t *\n\t\t * @param {object} field The field.\n\t\t * @param {string} value The new image url.\n\t\t * @return {void}\n\t\t */\n\t\tonUploaded(field, value) {\n\t\t\tthis.form = { ...this.form, [field.key]: value }\n\t\t\tthis.baseline = { ...this.baseline, [field.key]: value }\n\t\t\tthis.notice = { type: 'success', text: t('nextcloud-vue', 'Saved.') }\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-settings-fields {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n\tcontainer-type: inline-size;\n}\n\n.cn-settings-fields__grid {\n\tdisplay: grid;\n\tgrid-template-columns: minmax(0, 1fr);\n\tgap: 16px 20px;\n}\n\n/* Two to four columns where the card is wide enough; stacked otherwise\n (DqInstellingenAlgemeen \"Huisstijl\" draws four).\n @spec openspec/changes/settings-fields-four-columns-and-note/specs/settings-fields-four-columns-and-note/spec.md */\n@container (min-width: 520px) {\n\t.cn-settings-fields__grid--2,\n\t.cn-settings-fields__grid--3,\n\t.cn-settings-fields__grid--4 {\n\t\tgrid-template-columns: repeat(2, minmax(0, 1fr));\n\t}\n}\n\n@container (min-width: 780px) {\n\t.cn-settings-fields__grid--3,\n\t.cn-settings-fields__grid--4 {\n\t\tgrid-template-columns: repeat(3, minmax(0, 1fr));\n\t}\n}\n\n@container (min-width: 960px) {\n\t.cn-settings-fields__grid--4 {\n\t\tgrid-template-columns: repeat(4, minmax(0, 1fr));\n\t}\n}\n\n.cn-settings-fields__field--wide {\n\tgrid-column: 1 / -1;\n}\n\n.cn-settings-fields__inline-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tgap: 12px;\n}\n\n.cn-settings-fields__inline-row > .cn-settings-fields__grid {\n\tflex: 0 1 50%;\n\tmin-width: min(100%, 280px);\n}\n\n/* The button lines up with the control, under a label that sits above it\n in the board look (look-board.css sets the offset). */\n.cn-settings-fields__inline-save {\n\tmargin-block-start: var(--cn-settings-fields-label-offset, 0);\n}\n\n.cn-settings-fields__advanced {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: flex-start;\n\tgap: 12px;\n}\n\n.cn-settings-fields__advanced > .cn-settings-fields__grid {\n\talign-self: stretch;\n}\n\n.cn-settings-fields__hints-toggle {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n}\n\n.cn-settings-fields__save {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: flex-end;\n\tgap: 12px;\n}\n\n.cn-settings-fields__dirty {\n\tfont-size: 14px;\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["_createBlock","_mergeProps","_createElementBlock","_Fragment","_createElementVNode","_normalizeClass","_renderList","_createTextVNode","_createVNode","_openBlock","_toDisplayString"],"mapp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kBAAA,aAAW,EAAC,2BAA2B;;mCACtC,MAAgB;gEAAR,CAAC,IAAI,CAAA,EAAA,CAAA,YAAA;;;;;cAGH,MAAQ,CAAA,QAAA,IAAG,QAAA,CAAA,SAAA,IAAA,CAAA,QAAA,CAAA,UAAA;AAArB,iBAAAS,SAAA,EAAA,EAAAP,kBAAA,QAAA;mBACW,QAAC,CAAA,KAAA;sDAEN,CAAA,MAAA,YAAA,EAAAQ,eAAA,CADH,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,iBAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;AAGH,oBAAA,OAAO,EAAE,MAAW,CAAA,WAAA;AACrB,oBAAA,IAAI,EAAC,QAAK;AACT,oBAAA,QAAQ,EAAE,QAAW,CAAA,YAAA;AACtB,oBAAA,aAAS,EAAA,yBAAA;;qCAGF;AAAA,sBAAAH,eAAA,CAAA;;;;qBAFJ,KAAA,CAAA,MAAA;;gCAAA,MAAA;sCACF,MAAE;4BAAFC,WAAE,CAAA,wBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnStepper.vue2.js","sources":["../../../../src/components/CnStepper/CnStepper.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<ol class=\"cn-stepper cn-wizard-dialog__progress\"\n\t\t:class=\"[{ 'cn-stepper--board': isBoard }, lookClass]\"\n\t\t:aria-label=\"ariaLabel\"\n\t\tdata-testid=\"cn-stepper\">\n\t\t<li v-for=\"(step, idx) in steps\"\n\t\t\t:key=\"step.id\"\n\t\t\tclass=\"cn-stepper__item cn-wizard-dialog__progress-item\"\n\t\t\t:class=\"{\n\t\t\t\t'cn-stepper__item--done': idx < currentIndex,\n\t\t\t\t'cn-stepper__item--current': idx === currentIndex,\n\t\t\t\t'cn-stepper__item--upcoming': idx > currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--active': idx === currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--done': idx < currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--clickable': isJumpable(idx),\n\t\t\t}\"\n\t\t\t:aria-current=\"idx === currentIndex ? 'step' : undefined\"\n\t\t\t:data-step-id=\"step.id\">\n\t\t\t<component :is=\"isJumpable(idx) ? 'button' : 'span'\"\n\t\t\t\tclass=\"cn-stepper__step\"\n\t\t\t\t:type=\"isJumpable(idx) ? 'button' : undefined\"\n\t\t\t\t@click=\"isJumpable(idx) ? onJump(step.id) : null\">\n\t\t\t\t<span class=\"cn-stepper__dot cn-wizard-dialog__progress-dot\" aria-hidden=\"true\">\n\t\t\t\t\t<template v-if=\"idx < currentIndex\">\n\t\t\t\t\t\t<Check v-if=\"isBoard\"\n\t\t\t\t\t\t\tclass=\"cn-stepper__check cn-wizard-dialog__progress-check\"\n\t\t\t\t\t\t\t:size=\"16\" />\n\t\t\t\t\t\t<span v-else class=\"cn-wizard-dialog__progress-check\">✓</span>\n\t\t\t\t\t</template>\n\t\t\t\t\t<span v-else>{{ idx + 1 }}</span>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"cn-stepper__label cn-wizard-dialog__progress-label\">{{ step.label }}</span>\n\t\t\t\t<span v-if=\"idx < currentIndex\" class=\"cn-stepper__sr\">{{ ', ' + completedLabel }}</span>\n\t\t\t</component>\n\t\t\t<span v-if=\"idx < steps.length - 1\"\n\t\t\t\tclass=\"cn-stepper__connector cn-wizard-dialog__progress-connector\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'cn-stepper__connector--done': idx < currentIndex,\n\t\t\t\t\t'cn-wizard-dialog__progress-connector--done': idx < currentIndex,\n\t\t\t\t}\"\n\t\t\t\taria-hidden=\"true\" />\n\t\t</li>\n\t</ol>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport Check from 'vue-material-design-icons/Check.vue'\nimport { useLook } from '../../composables/useLook.js'\n\n/**\n * CnStepper (internal) - the step indicator of a wizard: an ordered list, the\n * current step marked with `aria-current=\"step\"`, finished steps as real\n * buttons only when `allowJumpBack` is set.\n *\n * In the board look (`look=\"board\"`, else the injected `cnLook`) it draws 28px\n * circles with the label beside them, a green check on a finished step, a\n * filled circle on the current one, an outlined circle on the rest and a 2px\n * connector coloured by state. In the Nextcloud look it draws the stacked\n * stepper CnWizardDialog always had, with the same class names.\n *\n * @spec openspec/changes/screens-wizard-parity/specs/wizard-dialog/spec.md#requirement-the-board-stepper\n * @event jump Emitted with a finished step's id when its button is pressed.\n *\n * @event jump Emitted with the step id when a finished step button is pressed.\n */\nexport default {\n\tname: 'CnStepper',\n\n\tcomponents: { Check },\n\n\tprops: {\n\t\t/** The steps: `{ id, label }`. */\n\t\tsteps: { type: Array, required: true },\n\t\t/** Index of the current step. */\n\t\tcurrentIndex: { type: Number, default: 0 },\n\t\t/** Let a finished step be pressed to go back to it. */\n\t\tallowJumpBack: { type: Boolean, default: false },\n\t\t/** The look; unset follows the injected `cnLook`. */\n\t\tlook: { type: String, default: undefined },\n\t\t/** Accessible name of the list. */\n\t\tariaLabel: { type: String, default: () => t('nextcloud-vue', 'Steps') },\n\t\t/** Visually hidden text after a finished step's label. */\n\t\tcompletedLabel: { type: String, default: () => t('nextcloud-vue', 'completed') },\n\t},\n\n\temits: ['jump'],\n\n\tsetup(props) {\n\t\tconst { isBoard, lookClass } = useLook(props)\n\t\treturn { isBoard, lookClass }\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Forward a press on a finished step.\n\t\t *\n\t\t * @param {string} id The step id.\n\t\t */\n\t\tonJump(id) {\n\t\t\t/**\n\t\t\t * @event jump Emitted with the step id when a finished step button is pressed.\n\t\t\t */\n\t\t\tthis.$emit('jump', id)\n\t\t},\n\n\t\tisJumpable(idx) {\n\t\t\treturn this.allowJumpBack && idx < this.currentIndex\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* The Nextcloud look: the stacked stepper, unchanged. */\n.cn-stepper {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tjustify-content: center;\n\tgap: 0;\n\tpadding: 8px 0 4px;\n\tmargin: 0 0 20px;\n\tlist-style: none;\n}\n\n.cn-stepper__item {\n\tposition: relative;\n\tflex: 1 1 0;\n\tmin-width: 0;\n\tmax-width: 180px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\ttext-align: center;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.8125rem;\n}\n\n.cn-stepper__step {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 6px;\n\tmax-width: 100%;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tbackground: none;\n\tcolor: inherit;\n\tfont: inherit;\n}\n\n/* Nextcloud's server.css gives every plain button a 3px margin and the\n clickable-area height (`button:not(.button-vue, …):not(…)`, 0,2,1), which\n made a done step 40px tall around its 28px circle. Two classes outrank it. */\n.cn-stepper button.cn-stepper__step {\n\tmargin: 0;\n\tmin-height: 0;\n}\n\nbutton.cn-stepper__step {\n\tcursor: pointer;\n}\n\n.cn-stepper__dot {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 34px;\n\theight: 34px;\n\tborder-radius: 50%;\n\tborder: 2px solid var(--color-border-dark);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttransition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;\n\tz-index: 1;\n}\n\n.cn-wizard-dialog__progress-check {\n\tfont-size: 16px;\n\tline-height: 1;\n}\n\n.cn-stepper__label {\n\tmax-width: 100%;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-stepper__connector {\n\tposition: absolute;\n\ttop: 17px;\n\tleft: calc(50% + 21px);\n\tright: calc(-50% + 21px);\n\theight: 2px;\n\tbackground: var(--color-border-dark);\n}\n\n.cn-stepper__connector--done {\n\tbackground: var(--color-primary-element);\n}\n\n.cn-stepper__item--current .cn-stepper__dot,\n.cn-stepper__item--done .cn-stepper__dot {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text, #fff);\n}\n\n.cn-stepper__item--current .cn-stepper__label {\n\tcolor: var(--color-main-text);\n\tfont-weight: 600;\n}\n\n.cn-stepper__item--done .cn-stepper__label {\n\tcolor: var(--color-main-text);\n}\n\n.cn-stepper__item--done button.cn-stepper__step:hover .cn-stepper__label {\n\tcolor: var(--color-primary-element);\n}\n\n.cn-stepper__sr {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tclip-path: inset(50%);\n\twhite-space: nowrap;\n}\n\n/* The board look: one row, 28px circles, the label beside the circle. */\n/* The board leaves 16px between the stepper and the step's body (DqInstellen). */\n.cn-stepper--board {\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: flex-start;\n\tgap: 8px;\n\tpadding: 0;\n\tmargin: 0 0 16px;\n}\n\n.cn-stepper--board .cn-stepper__item {\n\tflex: 0 1 auto;\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 8px;\n\tmax-width: none;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__item:not(:last-child) {\n\tflex: 1 1 auto;\n}\n\n.cn-stepper--board .cn-stepper__step {\n\tflex-direction: row;\n\tgap: 8px;\n}\n\n.cn-stepper--board .cn-stepper__dot {\n\tflex: 0 0 auto;\n\twidth: 28px;\n\theight: 28px;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__label {\n\toverflow: visible;\n\ttext-overflow: clip;\n\twhite-space: nowrap;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__connector {\n\tposition: static;\n\tflex: 1 1 24px;\n\tmin-width: 16px;\n\theight: 2px;\n\tbackground: var(--color-border);\n}\n\n.cn-stepper--board .cn-stepper__connector--done {\n\tbackground: var(--color-success);\n}\n\n/* Done: filled success circle, 16px check, secondary label. */\n.cn-stepper--board .cn-stepper__item--done .cn-stepper__dot {\n\tborder-color: var(--color-success);\n\tbackground: var(--color-success);\n\tcolor: var(--color-success-text, #fff);\n}\n\n.cn-stepper--board .cn-stepper__item--done .cn-stepper__label {\n\tcolor: var(--cn-board-text-soft, var(--color-main-text));\n\tfont-weight: 400;\n}\n\n/* Current: filled primary, number 14/700, label 14/700 in the main text colour. */\n.cn-stepper--board .cn-stepper__item--current .cn-stepper__dot {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text, #fff);\n\tfont-weight: 700;\n}\n\n.cn-stepper--board .cn-stepper__item--current .cn-stepper__label {\n\tcolor: var(--color-main-text);\n\tfont-weight: 700;\n}\n\n/* Upcoming: 2px outline, number 14/600, label in the max-contrast tone. */\n.cn-stepper--board .cn-stepper__item--upcoming .cn-stepper__dot {\n\tborder: 2px solid var(--color-border-dark);\n\tbackground: transparent;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 600;\n}\n\n.cn-stepper--board .cn-stepper__item--upcoming .cn-stepper__label {\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["t"],"mappings":";;;;AAsDA;AACC;AACA;AACA;AACA;AACA;;;;;AAKA;;;AAGA;AACA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,WAAW;;AAEjB,CAAA,UAAU,EAAE,EAAE,OAAO;;AAErB,CAAA,KAAK,EAAE;;AAEN,EAAA,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM;;AAEtC,EAAA,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;AAC1C;AACA,EAAA,aAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;AAChD;AACA,EAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW;;AAE1C,EAAA,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAMA,SAAC,CAAC,eAAe,EAAE,OAAO,CAAA,EAAG;;AAEvE,EAAA,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAMA,SAAC,CAAC,eAAe,EAAE,WAAW,GAAG;EAChF;;AAED,CAAA,KAAK,EAAE,CAAC,MAAM,CAAC;;CAEf,KAAK,CAAC,KAAK,EAAE;AACZ,EAAA,MAAM,EAAE,OAAO,EAAE,SAAU,EAAA,GAAI,OAAO,CAAC,KAAK,EAAA;EAC5C,OAAO,EAAE,OAAO,EAAE,SAAU,EAAA;EAC5B;;AAED,CAAA,OAAO,EAAE;AACR;;AAEC;;;EAGD,MAAM,CAAC,EAAE,EAAE;AACV;AACC;;AAED,GAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAA;GACrB;;AAED,EAAA,UAAU,CAAC,GAAG,EAAE;GACf,OAAO,IAAI,CAAC,iBAAiB,GAAE,GAAI,IAAI,CAAC,YAAW;GACnD;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnStepper.vue2.js","sources":["../../../../src/components/CnStepper/CnStepper.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<ol class=\"cn-stepper cn-wizard-dialog__progress\"\n\t\t:class=\"[{ 'cn-stepper--board': isBoard }, lookClass]\"\n\t\t:aria-label=\"ariaLabel\"\n\t\tdata-testid=\"cn-stepper\">\n\t\t<li v-for=\"(step, idx) in steps\"\n\t\t\t:key=\"step.id\"\n\t\t\tclass=\"cn-stepper__item cn-wizard-dialog__progress-item\"\n\t\t\t:class=\"{\n\t\t\t\t'cn-stepper__item--done': idx < currentIndex,\n\t\t\t\t'cn-stepper__item--current': idx === currentIndex,\n\t\t\t\t'cn-stepper__item--upcoming': idx > currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--active': idx === currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--done': idx < currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--clickable': isJumpable(idx),\n\t\t\t}\"\n\t\t\t:aria-current=\"idx === currentIndex ? 'step' : undefined\"\n\t\t\t:data-step-id=\"step.id\">\n\t\t\t<component :is=\"isJumpable(idx) ? 'button' : 'span'\"\n\t\t\t\tclass=\"cn-stepper__step\"\n\t\t\t\t:type=\"isJumpable(idx) ? 'button' : undefined\"\n\t\t\t\t@click=\"isJumpable(idx) ? onJump(step.id) : null\">\n\t\t\t\t<span class=\"cn-stepper__dot cn-wizard-dialog__progress-dot\" aria-hidden=\"true\">\n\t\t\t\t\t<template v-if=\"idx < currentIndex\">\n\t\t\t\t\t\t<Check v-if=\"isBoard\"\n\t\t\t\t\t\t\tclass=\"cn-stepper__check cn-wizard-dialog__progress-check\"\n\t\t\t\t\t\t\t:size=\"16\" />\n\t\t\t\t\t\t<span v-else class=\"cn-wizard-dialog__progress-check\">✓</span>\n\t\t\t\t\t</template>\n\t\t\t\t\t<span v-else>{{ idx + 1 }}</span>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"cn-stepper__label cn-wizard-dialog__progress-label\">{{ step.label }}</span>\n\t\t\t\t<span v-if=\"idx < currentIndex\" class=\"cn-stepper__sr\">{{ ', ' + completedLabel }}</span>\n\t\t\t</component>\n\t\t\t<span v-if=\"idx < steps.length - 1\"\n\t\t\t\tclass=\"cn-stepper__connector cn-wizard-dialog__progress-connector\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'cn-stepper__connector--done': idx < currentIndex,\n\t\t\t\t\t'cn-wizard-dialog__progress-connector--done': idx < currentIndex,\n\t\t\t\t}\"\n\t\t\t\taria-hidden=\"true\" />\n\t\t</li>\n\t</ol>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport Check from 'vue-material-design-icons/Check.vue'\nimport { useLook } from '../../composables/useLook.js'\n\n/**\n * CnStepper (internal) - the step indicator of a wizard: an ordered list, the\n * current step marked with `aria-current=\"step\"`, finished steps as real\n * buttons only when `allowJumpBack` is set.\n *\n * In the board look (`look=\"board\"`, else the injected `cnLook`) it draws 28px\n * circles with the label beside them, a green check on a finished step, a\n * filled circle on the current one, an outlined circle on the rest and a 2px\n * connector coloured by state. In the Nextcloud look it draws the stacked\n * stepper CnWizardDialog always had, with the same class names.\n *\n * @spec openspec/changes/screens-wizard-parity/specs/wizard-dialog/spec.md#requirement-the-board-stepper\n * @event jump Emitted with a finished step's id when its button is pressed.\n *\n * @event jump Emitted with the step id when a finished step button is pressed.\n */\nexport default {\n\tname: 'CnStepper',\n\n\tcomponents: { Check },\n\n\tprops: {\n\t\t/** The steps: `{ id, label }`. */\n\t\tsteps: { type: Array, required: true },\n\t\t/** Index of the current step. */\n\t\tcurrentIndex: { type: Number, default: 0 },\n\t\t/** Let a finished step be pressed to go back to it. */\n\t\tallowJumpBack: { type: Boolean, default: false },\n\t\t/** The look; unset follows the injected `cnLook`. */\n\t\tlook: { type: String, default: undefined },\n\t\t/** Accessible name of the list. */\n\t\tariaLabel: { type: String, default: () => t('nextcloud-vue', 'Steps') },\n\t\t/** Visually hidden text after a finished step's label. */\n\t\tcompletedLabel: { type: String, default: () => t('nextcloud-vue', 'completed') },\n\t},\n\n\temits: ['jump'],\n\n\tsetup(props) {\n\t\tconst { isBoard, lookClass } = useLook(props)\n\t\treturn { isBoard, lookClass }\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Forward a press on a finished step.\n\t\t *\n\t\t * @param {string} id The step id.\n\t\t */\n\t\tonJump(id) {\n\t\t\t/**\n\t\t\t * @event jump Emitted with the step id when a finished step button is pressed.\n\t\t\t */\n\t\t\tthis.$emit('jump', id)\n\t\t},\n\n\t\tisJumpable(idx) {\n\t\t\treturn this.allowJumpBack && idx < this.currentIndex\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* The Nextcloud look: the stacked stepper, unchanged. */\n.cn-stepper {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tjustify-content: center;\n\tgap: 0;\n\tpadding: 8px 0 4px;\n\tmargin: 0 0 20px;\n\tlist-style: none;\n}\n\n.cn-stepper__item {\n\tposition: relative;\n\tflex: 1 1 0;\n\tmin-width: 0;\n\tmax-width: 180px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\ttext-align: center;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.8125rem;\n}\n\n.cn-stepper__step {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 6px;\n\tmax-width: 100%;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tbackground: none;\n\tcolor: inherit;\n\tfont: inherit;\n}\n\n/* Nextcloud's server.css gives every plain button a 3px margin and the\n clickable-area height (`button:not(.button-vue, …):not(…)`, 0,2,1), which\n made a done step 40px tall around its 28px circle. Two classes outrank it. */\n.cn-stepper button.cn-stepper__step {\n\tmargin: 0;\n\tmin-height: 0;\n}\n\nbutton.cn-stepper__step {\n\tcursor: pointer;\n}\n\n.cn-stepper__dot {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 34px;\n\theight: 34px;\n\tborder-radius: 50%;\n\tborder: 2px solid var(--color-border-dark);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttransition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;\n\tz-index: 1;\n}\n\n.cn-wizard-dialog__progress-check {\n\tfont-size: 16px;\n\tline-height: 1;\n}\n\n.cn-stepper__label {\n\tmax-width: 100%;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-stepper__connector {\n\tposition: absolute;\n\ttop: 17px;\n\tleft: calc(50% + 21px);\n\tright: calc(-50% + 21px);\n\theight: 2px;\n\tbackground: var(--color-border-dark);\n}\n\n.cn-stepper__connector--done {\n\tbackground: var(--color-primary-element);\n}\n\n.cn-stepper__item--current .cn-stepper__dot,\n.cn-stepper__item--done .cn-stepper__dot {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text, #fff);\n}\n\n.cn-stepper__item--current .cn-stepper__label {\n\tcolor: var(--color-main-text);\n\tfont-weight: 600;\n}\n\n.cn-stepper__item--done .cn-stepper__label {\n\tcolor: var(--color-main-text);\n}\n\n.cn-stepper__item--done button.cn-stepper__step:hover .cn-stepper__label {\n\tcolor: var(--color-primary-element);\n}\n\n.cn-stepper__sr {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tclip-path: inset(50%);\n\twhite-space: nowrap;\n}\n\n/* The board look: one row, 28px circles, the label beside the circle. */\n/* The board leaves 16px between the stepper and the step's body (DqInstellen). */\n.cn-stepper--board {\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: flex-start;\n\tgap: 8px;\n\tpadding: 0;\n\tmargin: 0 0 16px;\n}\n\n.cn-stepper--board .cn-stepper__item {\n\tflex: 0 1 auto;\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 8px;\n\tmax-width: none;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__item:not(:last-child) {\n\tflex: 1 1 auto;\n}\n\n.cn-stepper--board .cn-stepper__step {\n\tflex-direction: row;\n\tgap: 8px;\n}\n\n.cn-stepper--board .cn-stepper__dot {\n\tflex: 0 0 auto;\n\twidth: 28px;\n\theight: 28px;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__label {\n\toverflow: visible;\n\ttext-overflow: clip;\n\twhite-space: nowrap;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__connector {\n\tposition: static;\n\tflex: 1 1 24px;\n\tmin-width: 16px;\n\theight: 2px;\n\tbackground: var(--color-border);\n}\n\n.cn-stepper--board .cn-stepper__connector--done {\n\tbackground: var(--color-success);\n}\n\n/* Done: filled success circle, 16px white check, label in the main text. */\n.cn-stepper--board .cn-stepper__item--done .cn-stepper__dot {\n\tborder-color: var(--color-success);\n\tbackground: var(--color-success);\n\t/* A white check on the green, as the board draws it (DqInstellen); the\n\t theme's success text tone is a dark green meant for a light ground. */\n\tcolor: var(--color-primary-element-text, #fff);\n}\n\n.cn-stepper--board .cn-stepper__item--done .cn-stepper__label {\n\tcolor: var(--color-main-text);\n\tfont-weight: 400;\n}\n\n/* Current: filled primary, number 14/700, label 14/700 in the main text colour. */\n.cn-stepper--board .cn-stepper__item--current .cn-stepper__dot {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text, #fff);\n\tfont-weight: 700;\n}\n\n.cn-stepper--board .cn-stepper__item--current .cn-stepper__label {\n\tcolor: var(--color-main-text);\n\tfont-weight: 700;\n}\n\n/* Upcoming: 2px outline, number 14/700, label in the max-contrast tone. */\n.cn-stepper--board .cn-stepper__item--upcoming .cn-stepper__dot {\n\tborder: 2px solid var(--color-border-dark);\n\tbackground: transparent;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 700;\n}\n\n.cn-stepper--board .cn-stepper__item--upcoming .cn-stepper__label {\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["t"],"mappings":";;;;AAsDA;AACC;AACA;AACA;AACA;AACA;;;;;AAKA;;;AAGA;AACA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,WAAW;;AAEjB,CAAA,UAAU,EAAE,EAAE,OAAO;;AAErB,CAAA,KAAK,EAAE;;AAEN,EAAA,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM;;AAEtC,EAAA,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;AAC1C;AACA,EAAA,aAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;AAChD;AACA,EAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW;;AAE1C,EAAA,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAMA,SAAC,CAAC,eAAe,EAAE,OAAO,CAAA,EAAG;;AAEvE,EAAA,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAMA,SAAC,CAAC,eAAe,EAAE,WAAW,GAAG;EAChF;;AAED,CAAA,KAAK,EAAE,CAAC,MAAM,CAAC;;CAEf,KAAK,CAAC,KAAK,EAAE;AACZ,EAAA,MAAM,EAAE,OAAO,EAAE,SAAU,EAAA,GAAI,OAAO,CAAC,KAAK,EAAA;EAC5C,OAAO,EAAE,OAAO,EAAE,SAAU,EAAA;EAC5B;;AAED,CAAA,OAAO,EAAE;AACR;;AAEC;;;EAGD,MAAM,CAAC,EAAE,EAAE;AACV;AACC;;AAED,GAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAA;GACrB;;AAED,EAAA,UAAU,CAAC,GAAG,EAAE;GACf,OAAO,IAAI,CAAC,iBAAiB,GAAE,GAAI,IAAI,CAAC,YAAW;GACnD;EACD;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnStepper.vue3.js","sources":["../../../../src/components/CnStepper/CnStepper.vue?vue&type=template&id=3d784176&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<ol class=\"cn-stepper cn-wizard-dialog__progress\"\n\t\t:class=\"[{ 'cn-stepper--board': isBoard }, lookClass]\"\n\t\t:aria-label=\"ariaLabel\"\n\t\tdata-testid=\"cn-stepper\">\n\t\t<li v-for=\"(step, idx) in steps\"\n\t\t\t:key=\"step.id\"\n\t\t\tclass=\"cn-stepper__item cn-wizard-dialog__progress-item\"\n\t\t\t:class=\"{\n\t\t\t\t'cn-stepper__item--done': idx < currentIndex,\n\t\t\t\t'cn-stepper__item--current': idx === currentIndex,\n\t\t\t\t'cn-stepper__item--upcoming': idx > currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--active': idx === currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--done': idx < currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--clickable': isJumpable(idx),\n\t\t\t}\"\n\t\t\t:aria-current=\"idx === currentIndex ? 'step' : undefined\"\n\t\t\t:data-step-id=\"step.id\">\n\t\t\t<component :is=\"isJumpable(idx) ? 'button' : 'span'\"\n\t\t\t\tclass=\"cn-stepper__step\"\n\t\t\t\t:type=\"isJumpable(idx) ? 'button' : undefined\"\n\t\t\t\t@click=\"isJumpable(idx) ? onJump(step.id) : null\">\n\t\t\t\t<span class=\"cn-stepper__dot cn-wizard-dialog__progress-dot\" aria-hidden=\"true\">\n\t\t\t\t\t<template v-if=\"idx < currentIndex\">\n\t\t\t\t\t\t<Check v-if=\"isBoard\"\n\t\t\t\t\t\t\tclass=\"cn-stepper__check cn-wizard-dialog__progress-check\"\n\t\t\t\t\t\t\t:size=\"16\" />\n\t\t\t\t\t\t<span v-else class=\"cn-wizard-dialog__progress-check\">✓</span>\n\t\t\t\t\t</template>\n\t\t\t\t\t<span v-else>{{ idx + 1 }}</span>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"cn-stepper__label cn-wizard-dialog__progress-label\">{{ step.label }}</span>\n\t\t\t\t<span v-if=\"idx < currentIndex\" class=\"cn-stepper__sr\">{{ ', ' + completedLabel }}</span>\n\t\t\t</component>\n\t\t\t<span v-if=\"idx < steps.length - 1\"\n\t\t\t\tclass=\"cn-stepper__connector cn-wizard-dialog__progress-connector\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'cn-stepper__connector--done': idx < currentIndex,\n\t\t\t\t\t'cn-wizard-dialog__progress-connector--done': idx < currentIndex,\n\t\t\t\t}\"\n\t\t\t\taria-hidden=\"true\" />\n\t\t</li>\n\t</ol>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport Check from 'vue-material-design-icons/Check.vue'\nimport { useLook } from '../../composables/useLook.js'\n\n/**\n * CnStepper (internal) - the step indicator of a wizard: an ordered list, the\n * current step marked with `aria-current=\"step\"`, finished steps as real\n * buttons only when `allowJumpBack` is set.\n *\n * In the board look (`look=\"board\"`, else the injected `cnLook`) it draws 28px\n * circles with the label beside them, a green check on a finished step, a\n * filled circle on the current one, an outlined circle on the rest and a 2px\n * connector coloured by state. In the Nextcloud look it draws the stacked\n * stepper CnWizardDialog always had, with the same class names.\n *\n * @spec openspec/changes/screens-wizard-parity/specs/wizard-dialog/spec.md#requirement-the-board-stepper\n * @event jump Emitted with a finished step's id when its button is pressed.\n *\n * @event jump Emitted with the step id when a finished step button is pressed.\n */\nexport default {\n\tname: 'CnStepper',\n\n\tcomponents: { Check },\n\n\tprops: {\n\t\t/** The steps: `{ id, label }`. */\n\t\tsteps: { type: Array, required: true },\n\t\t/** Index of the current step. */\n\t\tcurrentIndex: { type: Number, default: 0 },\n\t\t/** Let a finished step be pressed to go back to it. */\n\t\tallowJumpBack: { type: Boolean, default: false },\n\t\t/** The look; unset follows the injected `cnLook`. */\n\t\tlook: { type: String, default: undefined },\n\t\t/** Accessible name of the list. */\n\t\tariaLabel: { type: String, default: () => t('nextcloud-vue', 'Steps') },\n\t\t/** Visually hidden text after a finished step's label. */\n\t\tcompletedLabel: { type: String, default: () => t('nextcloud-vue', 'completed') },\n\t},\n\n\temits: ['jump'],\n\n\tsetup(props) {\n\t\tconst { isBoard, lookClass } = useLook(props)\n\t\treturn { isBoard, lookClass }\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Forward a press on a finished step.\n\t\t *\n\t\t * @param {string} id The step id.\n\t\t */\n\t\tonJump(id) {\n\t\t\t/**\n\t\t\t * @event jump Emitted with the step id when a finished step button is pressed.\n\t\t\t */\n\t\t\tthis.$emit('jump', id)\n\t\t},\n\n\t\tisJumpable(idx) {\n\t\t\treturn this.allowJumpBack && idx < this.currentIndex\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* The Nextcloud look: the stacked stepper, unchanged. */\n.cn-stepper {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tjustify-content: center;\n\tgap: 0;\n\tpadding: 8px 0 4px;\n\tmargin: 0 0 20px;\n\tlist-style: none;\n}\n\n.cn-stepper__item {\n\tposition: relative;\n\tflex: 1 1 0;\n\tmin-width: 0;\n\tmax-width: 180px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\ttext-align: center;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.8125rem;\n}\n\n.cn-stepper__step {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 6px;\n\tmax-width: 100%;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tbackground: none;\n\tcolor: inherit;\n\tfont: inherit;\n}\n\n/* Nextcloud's server.css gives every plain button a 3px margin and the\n clickable-area height (`button:not(.button-vue, …):not(…)`, 0,2,1), which\n made a done step 40px tall around its 28px circle. Two classes outrank it. */\n.cn-stepper button.cn-stepper__step {\n\tmargin: 0;\n\tmin-height: 0;\n}\n\nbutton.cn-stepper__step {\n\tcursor: pointer;\n}\n\n.cn-stepper__dot {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 34px;\n\theight: 34px;\n\tborder-radius: 50%;\n\tborder: 2px solid var(--color-border-dark);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttransition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;\n\tz-index: 1;\n}\n\n.cn-wizard-dialog__progress-check {\n\tfont-size: 16px;\n\tline-height: 1;\n}\n\n.cn-stepper__label {\n\tmax-width: 100%;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-stepper__connector {\n\tposition: absolute;\n\ttop: 17px;\n\tleft: calc(50% + 21px);\n\tright: calc(-50% + 21px);\n\theight: 2px;\n\tbackground: var(--color-border-dark);\n}\n\n.cn-stepper__connector--done {\n\tbackground: var(--color-primary-element);\n}\n\n.cn-stepper__item--current .cn-stepper__dot,\n.cn-stepper__item--done .cn-stepper__dot {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text, #fff);\n}\n\n.cn-stepper__item--current .cn-stepper__label {\n\tcolor: var(--color-main-text);\n\tfont-weight: 600;\n}\n\n.cn-stepper__item--done .cn-stepper__label {\n\tcolor: var(--color-main-text);\n}\n\n.cn-stepper__item--done button.cn-stepper__step:hover .cn-stepper__label {\n\tcolor: var(--color-primary-element);\n}\n\n.cn-stepper__sr {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tclip-path: inset(50%);\n\twhite-space: nowrap;\n}\n\n/* The board look: one row, 28px circles, the label beside the circle. */\n/* The board leaves 16px between the stepper and the step's body (DqInstellen). */\n.cn-stepper--board {\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: flex-start;\n\tgap: 8px;\n\tpadding: 0;\n\tmargin: 0 0 16px;\n}\n\n.cn-stepper--board .cn-stepper__item {\n\tflex: 0 1 auto;\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 8px;\n\tmax-width: none;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__item:not(:last-child) {\n\tflex: 1 1 auto;\n}\n\n.cn-stepper--board .cn-stepper__step {\n\tflex-direction: row;\n\tgap: 8px;\n}\n\n.cn-stepper--board .cn-stepper__dot {\n\tflex: 0 0 auto;\n\twidth: 28px;\n\theight: 28px;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__label {\n\toverflow: visible;\n\ttext-overflow: clip;\n\twhite-space: nowrap;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__connector {\n\tposition: static;\n\tflex: 1 1 24px;\n\tmin-width: 16px;\n\theight: 2px;\n\tbackground: var(--color-border);\n}\n\n.cn-stepper--board .cn-stepper__connector--done {\n\tbackground: var(--color-success);\n}\n\n/* Done: filled success circle, 16px check, secondary label. */\n.cn-stepper--board .cn-stepper__item--done .cn-stepper__dot {\n\tborder-color: var(--color-success);\n\tbackground: var(--color-success);\n\tcolor: var(--color-success-text, #fff);\n}\n\n.cn-stepper--board .cn-stepper__item--done .cn-stepper__label {\n\tcolor: var(--cn-board-text-soft, var(--color-main-text));\n\tfont-weight: 400;\n}\n\n/* Current: filled primary, number 14/700, label 14/700 in the main text colour. */\n.cn-stepper--board .cn-stepper__item--current .cn-stepper__dot {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text, #fff);\n\tfont-weight: 700;\n}\n\n.cn-stepper--board .cn-stepper__item--current .cn-stepper__label {\n\tcolor: var(--color-main-text);\n\tfont-weight: 700;\n}\n\n/* Upcoming: 2px outline, number 14/600, label in the max-contrast tone. */\n.cn-stepper--board .cn-stepper__item--upcoming .cn-stepper__dot {\n\tborder: 2px solid var(--color-border-dark);\n\tbackground: transparent;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 600;\n}\n\n.cn-stepper--board .cn-stepper__item--upcoming .cn-stepper__label {\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["_normalizeClass","_openBlock","_createElementBlock","_renderList","_createBlock","_resolveDynamicComponent","_Fragment","_createElementVNode","_toDisplayString"],"mappings":";;;;;AA8BU,EAAA,KAAK,EAAC,gDAAG;AAAA,EAAA,aAAA,EAAA,MAAA;;;;AAKA,EAAA,KAAK,EAAC,kCAAkC;;;AAIjD,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,oDAAoD,GAAA;;;AACxD,EAAA,KAAA,EAAA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CASjC;+BAAA,kBAAA,EAAA;AAPU,cAAA,CAAA,GAAG,GAAG,MAAY,CAAA,YAAA;kDAKvB,CAAAC,QAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,EAAA;qBAJD,MAAA,CAAA,OAAA;sCAATF,WAEI,CAAA,gBAAA,EAAA;;AADH,0BAAA,KAAK,EAAC,oDAAwB;AAC7B,0BAAA,IAAE,EAAA,EAAA;;sCACJF,kBAA8D,CAAA,MAAA,EAA9D,UAA8D,EAAR,GAAC,CAAA,CAAA;;AAExD,mBAAAD,SAAA,EAAA,EAAAC,kBAAA,CAAS,oCAAA,GAAA,GAAA,CAAA,CAAA,EAAA,CAAA,YAAA,CAAA;;AAEV,YAAAK,kBAAA,CAAiE,MAAjE,EAAA,UAAiE,EAAAC,eAAA,CAAA,IAAA,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;AACzD,YAAA,CAAA,GAAA,GAAA,MAAA,CAAA,YAAA;8BAARN,kBAAQ,CAAA,MAAA,EAAR,UAAQ,EAAAM,eAAA,CAAA,IAAA,GAAA,MAAA,CAAA,cAAA,CAAA,EAAA,CAAA,YAAA;;;;;SAEG,GAAG,GAAG,MAAK,CAAA,KAAA,CAAC,MAAM,GAAA,CAAA;;;AAC7B,cAAA,KAAC,kBAAA,4DAAA,EAAA;AACmB,KAAA,6BAAA,EAAA,GAAA,GAAA,MAAA,CAAA,YAAA;AAAA,KAAA,4CAAA,EAAA,GAAA,GAAA,MAAA,CAAA,YAAA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnStepper.vue3.js","sources":["../../../../src/components/CnStepper/CnStepper.vue?vue&type=template&id=485ec8e1&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<ol class=\"cn-stepper cn-wizard-dialog__progress\"\n\t\t:class=\"[{ 'cn-stepper--board': isBoard }, lookClass]\"\n\t\t:aria-label=\"ariaLabel\"\n\t\tdata-testid=\"cn-stepper\">\n\t\t<li v-for=\"(step, idx) in steps\"\n\t\t\t:key=\"step.id\"\n\t\t\tclass=\"cn-stepper__item cn-wizard-dialog__progress-item\"\n\t\t\t:class=\"{\n\t\t\t\t'cn-stepper__item--done': idx < currentIndex,\n\t\t\t\t'cn-stepper__item--current': idx === currentIndex,\n\t\t\t\t'cn-stepper__item--upcoming': idx > currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--active': idx === currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--done': idx < currentIndex,\n\t\t\t\t'cn-wizard-dialog__progress-item--clickable': isJumpable(idx),\n\t\t\t}\"\n\t\t\t:aria-current=\"idx === currentIndex ? 'step' : undefined\"\n\t\t\t:data-step-id=\"step.id\">\n\t\t\t<component :is=\"isJumpable(idx) ? 'button' : 'span'\"\n\t\t\t\tclass=\"cn-stepper__step\"\n\t\t\t\t:type=\"isJumpable(idx) ? 'button' : undefined\"\n\t\t\t\t@click=\"isJumpable(idx) ? onJump(step.id) : null\">\n\t\t\t\t<span class=\"cn-stepper__dot cn-wizard-dialog__progress-dot\" aria-hidden=\"true\">\n\t\t\t\t\t<template v-if=\"idx < currentIndex\">\n\t\t\t\t\t\t<Check v-if=\"isBoard\"\n\t\t\t\t\t\t\tclass=\"cn-stepper__check cn-wizard-dialog__progress-check\"\n\t\t\t\t\t\t\t:size=\"16\" />\n\t\t\t\t\t\t<span v-else class=\"cn-wizard-dialog__progress-check\">✓</span>\n\t\t\t\t\t</template>\n\t\t\t\t\t<span v-else>{{ idx + 1 }}</span>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"cn-stepper__label cn-wizard-dialog__progress-label\">{{ step.label }}</span>\n\t\t\t\t<span v-if=\"idx < currentIndex\" class=\"cn-stepper__sr\">{{ ', ' + completedLabel }}</span>\n\t\t\t</component>\n\t\t\t<span v-if=\"idx < steps.length - 1\"\n\t\t\t\tclass=\"cn-stepper__connector cn-wizard-dialog__progress-connector\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'cn-stepper__connector--done': idx < currentIndex,\n\t\t\t\t\t'cn-wizard-dialog__progress-connector--done': idx < currentIndex,\n\t\t\t\t}\"\n\t\t\t\taria-hidden=\"true\" />\n\t\t</li>\n\t</ol>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport Check from 'vue-material-design-icons/Check.vue'\nimport { useLook } from '../../composables/useLook.js'\n\n/**\n * CnStepper (internal) - the step indicator of a wizard: an ordered list, the\n * current step marked with `aria-current=\"step\"`, finished steps as real\n * buttons only when `allowJumpBack` is set.\n *\n * In the board look (`look=\"board\"`, else the injected `cnLook`) it draws 28px\n * circles with the label beside them, a green check on a finished step, a\n * filled circle on the current one, an outlined circle on the rest and a 2px\n * connector coloured by state. In the Nextcloud look it draws the stacked\n * stepper CnWizardDialog always had, with the same class names.\n *\n * @spec openspec/changes/screens-wizard-parity/specs/wizard-dialog/spec.md#requirement-the-board-stepper\n * @event jump Emitted with a finished step's id when its button is pressed.\n *\n * @event jump Emitted with the step id when a finished step button is pressed.\n */\nexport default {\n\tname: 'CnStepper',\n\n\tcomponents: { Check },\n\n\tprops: {\n\t\t/** The steps: `{ id, label }`. */\n\t\tsteps: { type: Array, required: true },\n\t\t/** Index of the current step. */\n\t\tcurrentIndex: { type: Number, default: 0 },\n\t\t/** Let a finished step be pressed to go back to it. */\n\t\tallowJumpBack: { type: Boolean, default: false },\n\t\t/** The look; unset follows the injected `cnLook`. */\n\t\tlook: { type: String, default: undefined },\n\t\t/** Accessible name of the list. */\n\t\tariaLabel: { type: String, default: () => t('nextcloud-vue', 'Steps') },\n\t\t/** Visually hidden text after a finished step's label. */\n\t\tcompletedLabel: { type: String, default: () => t('nextcloud-vue', 'completed') },\n\t},\n\n\temits: ['jump'],\n\n\tsetup(props) {\n\t\tconst { isBoard, lookClass } = useLook(props)\n\t\treturn { isBoard, lookClass }\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Forward a press on a finished step.\n\t\t *\n\t\t * @param {string} id The step id.\n\t\t */\n\t\tonJump(id) {\n\t\t\t/**\n\t\t\t * @event jump Emitted with the step id when a finished step button is pressed.\n\t\t\t */\n\t\t\tthis.$emit('jump', id)\n\t\t},\n\n\t\tisJumpable(idx) {\n\t\t\treturn this.allowJumpBack && idx < this.currentIndex\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* The Nextcloud look: the stacked stepper, unchanged. */\n.cn-stepper {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tjustify-content: center;\n\tgap: 0;\n\tpadding: 8px 0 4px;\n\tmargin: 0 0 20px;\n\tlist-style: none;\n}\n\n.cn-stepper__item {\n\tposition: relative;\n\tflex: 1 1 0;\n\tmin-width: 0;\n\tmax-width: 180px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\ttext-align: center;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.8125rem;\n}\n\n.cn-stepper__step {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 6px;\n\tmax-width: 100%;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tbackground: none;\n\tcolor: inherit;\n\tfont: inherit;\n}\n\n/* Nextcloud's server.css gives every plain button a 3px margin and the\n clickable-area height (`button:not(.button-vue, …):not(…)`, 0,2,1), which\n made a done step 40px tall around its 28px circle. Two classes outrank it. */\n.cn-stepper button.cn-stepper__step {\n\tmargin: 0;\n\tmin-height: 0;\n}\n\nbutton.cn-stepper__step {\n\tcursor: pointer;\n}\n\n.cn-stepper__dot {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 34px;\n\theight: 34px;\n\tborder-radius: 50%;\n\tborder: 2px solid var(--color-border-dark);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttransition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;\n\tz-index: 1;\n}\n\n.cn-wizard-dialog__progress-check {\n\tfont-size: 16px;\n\tline-height: 1;\n}\n\n.cn-stepper__label {\n\tmax-width: 100%;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-stepper__connector {\n\tposition: absolute;\n\ttop: 17px;\n\tleft: calc(50% + 21px);\n\tright: calc(-50% + 21px);\n\theight: 2px;\n\tbackground: var(--color-border-dark);\n}\n\n.cn-stepper__connector--done {\n\tbackground: var(--color-primary-element);\n}\n\n.cn-stepper__item--current .cn-stepper__dot,\n.cn-stepper__item--done .cn-stepper__dot {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text, #fff);\n}\n\n.cn-stepper__item--current .cn-stepper__label {\n\tcolor: var(--color-main-text);\n\tfont-weight: 600;\n}\n\n.cn-stepper__item--done .cn-stepper__label {\n\tcolor: var(--color-main-text);\n}\n\n.cn-stepper__item--done button.cn-stepper__step:hover .cn-stepper__label {\n\tcolor: var(--color-primary-element);\n}\n\n.cn-stepper__sr {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tclip-path: inset(50%);\n\twhite-space: nowrap;\n}\n\n/* The board look: one row, 28px circles, the label beside the circle. */\n/* The board leaves 16px between the stepper and the step's body (DqInstellen). */\n.cn-stepper--board {\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: flex-start;\n\tgap: 8px;\n\tpadding: 0;\n\tmargin: 0 0 16px;\n}\n\n.cn-stepper--board .cn-stepper__item {\n\tflex: 0 1 auto;\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 8px;\n\tmax-width: none;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__item:not(:last-child) {\n\tflex: 1 1 auto;\n}\n\n.cn-stepper--board .cn-stepper__step {\n\tflex-direction: row;\n\tgap: 8px;\n}\n\n.cn-stepper--board .cn-stepper__dot {\n\tflex: 0 0 auto;\n\twidth: 28px;\n\theight: 28px;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__label {\n\toverflow: visible;\n\ttext-overflow: clip;\n\twhite-space: nowrap;\n\tfont-size: 14px;\n}\n\n.cn-stepper--board .cn-stepper__connector {\n\tposition: static;\n\tflex: 1 1 24px;\n\tmin-width: 16px;\n\theight: 2px;\n\tbackground: var(--color-border);\n}\n\n.cn-stepper--board .cn-stepper__connector--done {\n\tbackground: var(--color-success);\n}\n\n/* Done: filled success circle, 16px white check, label in the main text. */\n.cn-stepper--board .cn-stepper__item--done .cn-stepper__dot {\n\tborder-color: var(--color-success);\n\tbackground: var(--color-success);\n\t/* A white check on the green, as the board draws it (DqInstellen); the\n\t theme's success text tone is a dark green meant for a light ground. */\n\tcolor: var(--color-primary-element-text, #fff);\n}\n\n.cn-stepper--board .cn-stepper__item--done .cn-stepper__label {\n\tcolor: var(--color-main-text);\n\tfont-weight: 400;\n}\n\n/* Current: filled primary, number 14/700, label 14/700 in the main text colour. */\n.cn-stepper--board .cn-stepper__item--current .cn-stepper__dot {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text, #fff);\n\tfont-weight: 700;\n}\n\n.cn-stepper--board .cn-stepper__item--current .cn-stepper__label {\n\tcolor: var(--color-main-text);\n\tfont-weight: 700;\n}\n\n/* Upcoming: 2px outline, number 14/700, label in the max-contrast tone. */\n.cn-stepper--board .cn-stepper__item--upcoming .cn-stepper__dot {\n\tborder: 2px solid var(--color-border-dark);\n\tbackground: transparent;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 700;\n}\n\n.cn-stepper--board .cn-stepper__item--upcoming .cn-stepper__label {\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["_normalizeClass","_openBlock","_createElementBlock","_renderList","_createBlock","_resolveDynamicComponent","_Fragment","_createElementVNode","_toDisplayString"],"mappings":";;;;;AA8BU,EAAA,KAAK,EAAC,gDAAG;AAAA,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-v-
|
|
5
|
+
script.__scopeId = "data-v-702cb3dc";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|