@nextcloud/vue 8.0.0-beta.9 → 8.0.1
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/CHANGELOG.md +52 -2
- package/dist/Components/NcActionButton.cjs +23 -12
- package/dist/Components/NcActionButton.cjs.map +1 -1
- package/dist/Components/NcActionButton.mjs +21 -9
- package/dist/Components/NcActionButton.mjs.map +1 -1
- package/dist/Components/NcActionInput.cjs +1 -1
- package/dist/Components/NcActionInput.mjs +1 -1
- package/dist/Components/NcActionLink.cjs +1 -1
- package/dist/Components/NcActionLink.mjs +1 -1
- package/dist/Components/NcActionRouter.cjs +1 -1
- package/dist/Components/NcActionRouter.mjs +1 -1
- package/dist/Components/NcActionText.cjs +1 -1
- package/dist/Components/NcActionText.mjs +1 -1
- package/dist/Components/NcActionTextEditable.cjs +10 -10
- package/dist/Components/NcActionTextEditable.cjs.map +1 -1
- package/dist/Components/NcActionTextEditable.mjs +1 -1
- package/dist/Components/NcActions.cjs +55 -52
- package/dist/Components/NcActions.cjs.map +1 -1
- package/dist/Components/NcActions.mjs +44 -41
- package/dist/Components/NcActions.mjs.map +1 -1
- package/dist/Components/NcAppContent.cjs +19 -20
- package/dist/Components/NcAppContent.cjs.map +1 -1
- package/dist/Components/NcAppContent.mjs +8 -8
- package/dist/Components/NcAppContent.mjs.map +1 -1
- package/dist/Components/NcAppNavigation.cjs +58 -27
- package/dist/Components/NcAppNavigation.cjs.map +1 -1
- package/dist/Components/NcAppNavigation.mjs +67 -34
- package/dist/Components/NcAppNavigation.mjs.map +1 -1
- package/dist/Components/NcAppNavigationItem.cjs +166 -62
- package/dist/Components/NcAppNavigationItem.cjs.map +1 -1
- package/dist/Components/NcAppNavigationItem.mjs +145 -43
- package/dist/Components/NcAppNavigationItem.mjs.map +1 -1
- package/dist/Components/NcAppNavigationNew.cjs +6 -6
- package/dist/Components/NcAppNavigationNew.cjs.map +1 -1
- package/dist/Components/NcAppNavigationNew.mjs +17 -17
- package/dist/Components/NcAppNavigationNew.mjs.map +1 -1
- package/dist/Components/NcAppNavigationNewItem.cjs +7 -7
- package/dist/Components/NcAppNavigationNewItem.cjs.map +1 -1
- package/dist/Components/NcAppNavigationNewItem.mjs +5 -5
- package/dist/Components/NcAppNavigationNewItem.mjs.map +1 -1
- package/dist/Components/NcAppNavigationSettings.cjs +46 -14
- package/dist/Components/NcAppNavigationSettings.cjs.map +1 -1
- package/dist/Components/NcAppNavigationSettings.mjs +48 -16
- package/dist/Components/NcAppNavigationSettings.mjs.map +1 -1
- package/dist/Components/NcAppNavigationToggle.cjs +1 -1
- package/dist/Components/NcAppNavigationToggle.mjs +1 -1
- package/dist/Components/NcAppSettingsDialog.cjs +75 -54
- package/dist/Components/NcAppSettingsDialog.cjs.map +1 -1
- package/dist/Components/NcAppSettingsDialog.mjs +79 -57
- package/dist/Components/NcAppSettingsDialog.mjs.map +1 -1
- package/dist/Components/NcAppSettingsSection.cjs +29 -10
- package/dist/Components/NcAppSettingsSection.cjs.map +1 -1
- package/dist/Components/NcAppSettingsSection.mjs +29 -10
- package/dist/Components/NcAppSettingsSection.mjs.map +1 -1
- package/dist/Components/NcAppSidebar.cjs +99 -33
- package/dist/Components/NcAppSidebar.cjs.map +1 -1
- package/dist/Components/NcAppSidebar.mjs +156 -92
- package/dist/Components/NcAppSidebar.mjs.map +1 -1
- package/dist/Components/NcAppSidebarTab.cjs +7 -7
- package/dist/Components/NcAppSidebarTab.cjs.map +1 -1
- package/dist/Components/NcAppSidebarTab.mjs +6 -6
- package/dist/Components/NcAppSidebarTab.mjs.map +1 -1
- package/dist/Components/NcAvatar.cjs +1 -1
- package/dist/Components/NcAvatar.mjs +1 -1
- package/dist/Components/NcBreadcrumb.cjs +10 -10
- package/dist/Components/NcBreadcrumb.cjs.map +1 -1
- package/dist/Components/NcBreadcrumb.mjs +1 -1
- package/dist/Components/NcBreadcrumbs.cjs +85 -53
- package/dist/Components/NcBreadcrumbs.cjs.map +1 -1
- package/dist/Components/NcBreadcrumbs.mjs +91 -60
- package/dist/Components/NcBreadcrumbs.mjs.map +1 -1
- package/dist/Components/NcButton.cjs +25 -25
- package/dist/Components/NcButton.cjs.map +1 -1
- package/dist/Components/NcButton.mjs +25 -25
- package/dist/Components/NcButton.mjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.cjs +305 -67
- package/dist/Components/NcCheckboxRadioSwitch.cjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +307 -75
- package/dist/Components/NcCheckboxRadioSwitch.mjs.map +1 -1
- package/dist/Components/NcColorPicker.cjs +18 -18
- package/dist/Components/NcColorPicker.cjs.map +1 -1
- package/dist/Components/NcColorPicker.mjs +17 -17
- package/dist/Components/NcColorPicker.mjs.map +1 -1
- package/dist/Components/NcCounterBubble.cjs +6 -6
- package/dist/Components/NcCounterBubble.cjs.map +1 -1
- package/dist/Components/NcCounterBubble.mjs +2 -2
- package/dist/Components/NcCounterBubble.mjs.map +1 -1
- package/dist/Components/NcDashboardWidget.cjs +30 -30
- package/dist/Components/NcDashboardWidget.cjs.map +1 -1
- package/dist/Components/NcDashboardWidget.mjs +3 -3
- package/dist/Components/NcDashboardWidgetItem.cjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.mjs +1 -1
- package/dist/Components/NcDateTime.cjs +1 -1
- package/dist/Components/NcDateTime.mjs +1 -1
- package/dist/Components/NcDateTimePicker.cjs +109 -44
- package/dist/Components/NcDateTimePicker.cjs.map +1 -1
- package/dist/Components/NcDateTimePicker.mjs +115 -52
- package/dist/Components/NcDateTimePicker.mjs.map +1 -1
- package/dist/Components/NcDateTimePickerNative.cjs +1 -1
- package/dist/Components/NcDateTimePickerNative.mjs +1 -1
- package/dist/Components/NcDialogButton.cjs +11 -11
- package/dist/Components/NcDialogButton.cjs.map +1 -1
- package/dist/Components/NcDialogButton.mjs +14 -14
- package/dist/Components/NcDialogButton.mjs.map +1 -1
- package/dist/Components/NcEmojiPicker.cjs +1 -1
- package/dist/Components/NcEmojiPicker.mjs +1 -1
- package/dist/Components/NcEmptyContent.cjs +14 -14
- package/dist/Components/NcEmptyContent.cjs.map +1 -1
- package/dist/Components/NcEmptyContent.mjs +7 -7
- package/dist/Components/NcEmptyContent.mjs.map +1 -1
- package/dist/Components/NcInputField.cjs +16 -16
- package/dist/Components/NcInputField.cjs.map +1 -1
- package/dist/Components/NcInputField.mjs +5 -5
- package/dist/Components/NcInputField.mjs.map +1 -1
- package/dist/Components/NcListItem.cjs +3 -3
- package/dist/Components/NcListItem.cjs.map +1 -1
- package/dist/Components/NcListItem.mjs +3 -3
- package/dist/Components/NcListItem.mjs.map +1 -1
- package/dist/Components/NcListItemIcon.cjs +1 -1
- package/dist/Components/NcListItemIcon.mjs +1 -1
- package/dist/Components/NcModal.cjs +165 -68
- package/dist/Components/NcModal.cjs.map +1 -1
- package/dist/Components/NcModal.mjs +129 -35
- package/dist/Components/NcModal.mjs.map +1 -1
- package/dist/Components/NcNoteCard.cjs +146 -18
- package/dist/Components/NcNoteCard.cjs.map +1 -1
- package/dist/Components/NcNoteCard.mjs +146 -21
- package/dist/Components/NcNoteCard.mjs.map +1 -1
- package/dist/Components/NcPasswordField.cjs +84 -20
- package/dist/Components/NcPasswordField.cjs.map +1 -1
- package/dist/Components/NcPasswordField.mjs +104 -42
- package/dist/Components/NcPasswordField.mjs.map +1 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs +48 -31
- package/dist/Components/NcRelatedResourcesPanel.cjs.map +1 -1
- package/dist/Components/NcRelatedResourcesPanel.mjs +31 -14
- package/dist/Components/NcRelatedResourcesPanel.mjs.map +1 -1
- package/dist/Components/NcRichContenteditable.cjs +22 -18
- package/dist/Components/NcRichContenteditable.cjs.map +1 -1
- package/dist/Components/NcRichContenteditable.mjs +32 -28
- package/dist/Components/NcRichContenteditable.mjs.map +1 -1
- package/dist/Components/NcRichText.cjs +1 -1
- package/dist/Components/NcRichText.mjs +3 -3
- package/dist/Components/NcSelect.cjs +80 -57
- package/dist/Components/NcSelect.cjs.map +1 -1
- package/dist/Components/NcSelect.mjs +75 -50
- package/dist/Components/NcSelect.mjs.map +1 -1
- package/dist/Components/NcSelectTags.cjs +2 -2
- package/dist/Components/NcSelectTags.cjs.map +1 -1
- package/dist/Components/NcSelectTags.mjs +4 -4
- package/dist/Components/NcSelectTags.mjs.map +1 -1
- package/dist/Components/NcSettingsInputText.cjs +1 -1
- package/dist/Components/NcSettingsInputText.mjs +1 -1
- package/dist/Components/NcSettingsSection.cjs +46 -14
- package/dist/Components/NcSettingsSection.cjs.map +1 -1
- package/dist/Components/NcSettingsSection.mjs +44 -12
- package/dist/Components/NcSettingsSection.mjs.map +1 -1
- package/dist/Components/NcSettingsSelectGroup.cjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.mjs +1 -1
- package/dist/Components/NcTextArea.cjs +14 -14
- package/dist/Components/NcTextArea.cjs.map +1 -1
- package/dist/Components/NcTextArea.mjs +6 -6
- package/dist/Components/NcTextArea.mjs.map +1 -1
- package/dist/Components/NcTextField.cjs +51 -19
- package/dist/Components/NcTextField.cjs.map +1 -1
- package/dist/Components/NcTextField.mjs +59 -28
- package/dist/Components/NcTextField.mjs.map +1 -1
- package/dist/Components/NcTimezonePicker.cjs +32 -24
- package/dist/Components/NcTimezonePicker.cjs.map +1 -1
- package/dist/Components/NcTimezonePicker.mjs +36 -27
- package/dist/Components/NcTimezonePicker.mjs.map +1 -1
- package/dist/Components/NcUserBubble.cjs +24 -20
- package/dist/Components/NcUserBubble.cjs.map +1 -1
- package/dist/Components/NcUserBubble.mjs +25 -20
- package/dist/Components/NcUserBubble.mjs.map +1 -1
- package/dist/assets/{NcAppNavigationToggle-2cc5b864.css → NcAppNavigationToggle-9e170630.css} +3 -2
- package/dist/assets/{NcInputConfirmCancel-2ba60a52.css → NcInputConfirmCancel-45d1d76b.css} +7 -7
- package/dist/assets/{index-af72a30b.css → index-05760fea.css} +5 -1
- package/dist/assets/{index-30e099f7.css → index-0ac09203.css} +3 -3
- package/dist/assets/{index-eea65531.css → index-0e9b11c7.css} +20 -16
- package/dist/assets/{index-7813bab3.css → index-17673ea1.css} +7 -9
- package/dist/assets/{index-1151d229.css → index-1f25a3c0.css} +3 -3
- package/dist/assets/{index-9dcf6260.css → index-2e5e3b55.css} +30 -30
- package/dist/assets/{index-ed4adf1d.css → index-4271da53.css} +18 -17
- package/dist/assets/{index-abb90c97.css → index-4e03d941.css} +48 -48
- package/dist/assets/{index-4b75fe20.css → index-55600948.css} +11 -11
- package/dist/assets/{index-236620b0.css → index-6899d75b.css} +29 -29
- package/dist/assets/{index-5ee8a575.css → index-73ded07b.css} +63 -63
- package/dist/assets/{index-1beccc92.css → index-750c02cc.css} +28 -10
- package/dist/assets/{index-9e9587e1.css → index-77a548be.css} +4 -4
- package/dist/assets/{index-c5ae3bc4.css → index-7d211db9.css} +11 -11
- package/dist/assets/{index-8304db49.css → index-802d2118.css} +5 -1
- package/dist/assets/{index-a2d55f92.css → index-9176105d.css} +41 -41
- package/dist/assets/index-93bc89ef.css +197 -0
- package/dist/assets/{index-50b0766d.css → index-a0532427.css} +55 -70
- package/dist/assets/{index-e828b286.css → index-ab715d82.css} +4 -4
- package/dist/assets/{index-9e44e336.css → index-c221fe05.css} +9 -9
- package/dist/assets/{index-c6f0da2e.css → index-c239a2fc.css} +14 -8
- package/dist/assets/{index-73867d38.css → index-d3702c91.css} +5 -1
- package/dist/assets/{index-4a775ba1.css → index-d812ed9e.css} +43 -43
- package/dist/assets/{index-793eae6b.css → index-d9ae9479.css} +6 -6
- package/dist/assets/{index-f85aa003.css → index-db5a8b1c.css} +22 -10
- package/dist/assets/{index-574438d6.css → index-dea0aef3.css} +10 -10
- package/dist/assets/{index-0adc989c.css → index-ebbb7829.css} +9 -13
- package/dist/assets/{index-c06ad941.css → index-fbc0b606.css} +58 -42
- package/dist/chunks/AlertCircleOutline-7085c10f.cjs +35 -0
- package/dist/chunks/AlertCircleOutline-7085c10f.cjs.map +1 -0
- package/dist/chunks/AlertCircleOutline-b73838e0.mjs +37 -0
- package/dist/chunks/AlertCircleOutline-b73838e0.mjs.map +1 -0
- package/dist/chunks/ArrowLeft-2f9b9323.cjs +35 -0
- package/dist/chunks/ArrowLeft-2f9b9323.cjs.map +1 -0
- package/dist/chunks/ArrowLeft-3779ba88.mjs +37 -0
- package/dist/chunks/ArrowLeft-3779ba88.mjs.map +1 -0
- package/dist/chunks/ArrowRight-7315f6c1.cjs +35 -0
- package/dist/chunks/ArrowRight-7315f6c1.cjs.map +1 -0
- package/dist/chunks/ArrowRight-74a9fcb2.mjs +37 -0
- package/dist/chunks/ArrowRight-74a9fcb2.mjs.map +1 -0
- package/dist/chunks/Check-2ea0a88a.mjs +37 -0
- package/dist/chunks/Check-2ea0a88a.mjs.map +1 -0
- package/dist/chunks/Check-be8cd6af.cjs +35 -0
- package/dist/chunks/Check-be8cd6af.cjs.map +1 -0
- package/dist/chunks/ChevronDown-a72d365d.mjs +37 -0
- package/dist/chunks/ChevronDown-a72d365d.mjs.map +1 -0
- package/dist/chunks/ChevronDown-dc32e51d.cjs +35 -0
- package/dist/chunks/ChevronDown-dc32e51d.cjs.map +1 -0
- package/dist/chunks/ChevronRight-1a6a6cf2.mjs +37 -0
- package/dist/chunks/ChevronRight-1a6a6cf2.mjs.map +1 -0
- package/dist/chunks/ChevronRight-a4c1e0d3.cjs +35 -0
- package/dist/chunks/ChevronRight-a4c1e0d3.cjs.map +1 -0
- package/dist/chunks/Close-271f72e2.mjs +37 -0
- package/dist/chunks/Close-271f72e2.mjs.map +1 -0
- package/dist/chunks/Close-98cb6f12.cjs +35 -0
- package/dist/chunks/Close-98cb6f12.cjs.map +1 -0
- package/dist/chunks/DotsHorizontal-0ee7d901.mjs +37 -0
- package/dist/chunks/DotsHorizontal-0ee7d901.mjs.map +1 -0
- package/dist/chunks/DotsHorizontal-ac96129a.cjs +35 -0
- package/dist/chunks/DotsHorizontal-ac96129a.cjs.map +1 -0
- package/dist/chunks/NcAppNavigationToggle-60664a28.cjs +113 -0
- package/dist/chunks/NcAppNavigationToggle-60664a28.cjs.map +1 -0
- package/dist/chunks/NcAppNavigationToggle-82764816.mjs +118 -0
- package/dist/chunks/NcAppNavigationToggle-82764816.mjs.map +1 -0
- package/dist/chunks/NcInputConfirmCancel-262d455f.cjs +90 -0
- package/dist/chunks/{NcInputConfirmCancel-44052477.mjs.map → NcInputConfirmCancel-262d455f.cjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-44052477.mjs → NcInputConfirmCancel-906c7816.mjs} +11 -11
- package/dist/chunks/{NcInputConfirmCancel-6bea0fdc.cjs.map → NcInputConfirmCancel-906c7816.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-8fda53c8.mjs → NcRichText-1e8fd02d.mjs} +1 -1
- package/dist/chunks/{NcRichText-8fda53c8.mjs.map → NcRichText-1e8fd02d.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-332fe454.cjs → NcRichText-ae95c854.cjs} +1 -1
- package/dist/chunks/{NcRichText-332fe454.cjs.map → NcRichText-ae95c854.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-fdd3309c.mjs → NcSettingsSelectGroup-ae323579.mjs} +2 -2
- package/dist/chunks/{NcSettingsSelectGroup-fdd3309c.mjs.map → NcSettingsSelectGroup-ae323579.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-a5ff8c36.cjs → NcSettingsSelectGroup-e8f9f9fe.cjs} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-a5ff8c36.cjs.map → NcSettingsSelectGroup-e8f9f9fe.cjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-9519afcc.mjs → ScopeComponent-1ab1ebb9.mjs} +1 -1
- package/dist/chunks/{ScopeComponent-9519afcc.mjs.map → ScopeComponent-1ab1ebb9.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-e060526a.cjs → ScopeComponent-50287dad.cjs} +1 -1
- package/dist/chunks/{ScopeComponent-e060526a.cjs.map → ScopeComponent-50287dad.cjs.map} +1 -1
- package/dist/chunks/{index-032137a6.cjs → index-e06b96d3.cjs} +56 -47
- package/dist/chunks/index-e06b96d3.cjs.map +1 -0
- package/dist/chunks/{index-fb2ee22c.mjs → index-fbf943b3.mjs} +93 -84
- package/dist/chunks/index-fbf943b3.mjs.map +1 -0
- package/dist/chunks/{l10n-9aa6482d.mjs → l10n-9fc9974f.mjs} +1 -1
- package/dist/chunks/{l10n-9aa6482d.mjs.map → l10n-9fc9974f.mjs.map} +1 -1
- package/dist/chunks/{l10n-c7bd0ea6.cjs → l10n-ec2d3010.cjs} +1 -1
- package/dist/chunks/{l10n-c7bd0ea6.cjs.map → l10n-ec2d3010.cjs.map} +1 -1
- package/dist/chunks/l10n-f491109d.cjs +29 -0
- package/dist/chunks/l10n-f491109d.cjs.map +1 -0
- package/dist/chunks/l10n-f692947e.mjs +31 -0
- package/dist/chunks/l10n-f692947e.mjs.map +1 -0
- package/dist/chunks/{referencePickerModal-443a4c57.mjs → referencePickerModal-6bc8f6b9.mjs} +156 -124
- package/dist/chunks/referencePickerModal-6bc8f6b9.mjs.map +1 -0
- package/dist/chunks/{referencePickerModal-279a483d.cjs → referencePickerModal-e033bf2c.cjs} +144 -111
- package/dist/chunks/referencePickerModal-e033bf2c.cjs.map +1 -0
- package/dist/index.cjs +4 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +26 -30
- package/dist/index.mjs.map +1 -1
- package/dist/vendor.LICENSE.txt +5 -1
- package/package.json +3 -3
- package/dist/assets/index-d646553d.css +0 -41
- package/dist/chunks/NcAppNavigationToggle-841d3015.cjs +0 -49
- package/dist/chunks/NcAppNavigationToggle-841d3015.cjs.map +0 -1
- package/dist/chunks/NcAppNavigationToggle-e358aa47.mjs +0 -55
- package/dist/chunks/NcAppNavigationToggle-e358aa47.mjs.map +0 -1
- package/dist/chunks/NcInputConfirmCancel-6bea0fdc.cjs +0 -90
- package/dist/chunks/index-032137a6.cjs.map +0 -1
- package/dist/chunks/index-fb2ee22c.mjs.map +0 -1
- package/dist/chunks/l10n-05a09c66.mjs +0 -31
- package/dist/chunks/l10n-05a09c66.mjs.map +0 -1
- package/dist/chunks/l10n-b1d264c7.cjs +0 -29
- package/dist/chunks/l10n-b1d264c7.cjs.map +0 -1
- package/dist/chunks/referencePickerModal-279a483d.cjs.map +0 -1
- package/dist/chunks/referencePickerModal-443a4c57.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcAppSettingsDialog.cjs","sources":["../../src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<docs>\nJust nest the `AppSettingSections` component into `NcAppSettingsDialog`,\nproviding the section's name prop. You can put your settings within each\n`NcAppSettingsSection` component.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"settingsOpen = true\">Show Settings</NcButton>\n\t\t<NcAppSettingsDialog :open.sync=\"settingsOpen\" :show-navigation=\"true\" name=\"Application settings\">\n\t\t\t<NcAppSettingsSection id=\"asci-name-1\" name=\"Example name 1\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-2\" name=\"Example name 2\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-3\" name=\"Example name 3\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-4\" name=\"Example name 4\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-5\" name=\"Example name 5\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-6\" name=\"Example name 6\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-7\" name=\"Example name 7\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-8\" name=\"Example name 8\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-9\" name=\"Example name 9\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-10\" name=\"Example name 10\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t</NcAppSettingsDialog>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tsettingsOpen: false,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcDialog v-if=\"open\"\n\t\tv-bind=\"dialogProperties\"\n\t\t@update:open=\"handleCloseModal\">\n\t\t<template #navigation=\"{ isCollapsed }\">\n\t\t\t<ul :aria-label=\"settingsNavigationAriaLabel\"\n\t\t\t\t:class=\"{ 'navigation-list': true, 'navigation-list--collapsed': isCollapsed }\"\n\t\t\t\trole=\"tablist\">\n\t\t\t\t<li v-for=\"item in getNavigationItems\" :key=\"item.id\">\n\t\t\t\t\t<a :aria-selected=\"item.id === selectedSection\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'navigation-list__link': true,\n\t\t\t\t\t\t\t'navigation-list__link--active': item.id === selectedSection,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t@click=\"handleSettingsNavigationClick(item.id)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSettingsNavigationClick(item.id)\">{{ item.name }}</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</template>\n\t\t<div ref=\"settingsScroller\">\n\t\t\t<slot />\n\t\t</div>\n\t</NcDialog>\n</template>\n\n<script>\nimport NcDialog from '../NcDialog/index.js'\nimport isMobile from '../../mixins/isMobile/index.js'\nimport { t } from '../../l10n.js'\n\nimport debounce from 'debounce'\n\nexport default {\n\n\tname: 'NcAppSettingsDialog',\n\n\tcomponents: {\n\t\tNcDialog,\n\t},\n\n\tmixins: [isMobile],\n\n\tprops: {\n\t\t/**\n\t\t * Determines the open / closed state of the modal\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Shows the navigation on desktop if true\n\t\t */\n\t\tshowNavigation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the popover container\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: String,\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Name of the settings\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Additional elements to add to the focus trap\n\t\t */\n\t\tadditionalTrapElements: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t},\n\n\temits: ['update:open'],\n\n\tdata() {\n\t\treturn {\n\t\t\tselectedSection: '',\n\t\t\tlinkClicked: false,\n\t\t\taddedScrollListener: false,\n\t\t\tscroller: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tdialogProperties() {\n\t\t\treturn {\n\t\t\t\tadditionalTrapElements: this.additionalTrapElements,\n\t\t\t\tclass: 'app-settings',\n\t\t\t\tcontainer: this.container,\n\t\t\t\tcontentClasses: 'app-settings__content',\n\t\t\t\tsize: 'large',\n\t\t\t\tname: this.name,\n\t\t\t\tnavigationClasses: 'app-settings__navigation',\n\t\t\t}\n\t\t},\n\n\t\thasNavigation() {\n\t\t\tif (this.isMobile || !this.showNavigation) {\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\treturn true\n\t\t\t}\n\t\t},\n\n\t\tsettingsNavigationAriaLabel() {\n\t\t\treturn t('Settings navigation')\n\t\t},\n\n\t\tgetNavigationItems() {\n\t\t\treturn this.getSettingsNavigation(this.$slots.default)\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Select first settings section\n\t\tthis.selectedSection = this.$slots.default[0].componentOptions.propsData.id\n\t},\n\n\tupdated() {\n\t\t// Check that the scroller element has been mounted\n\t\tif (!this.$refs.settingsScroller) {\n\t\t\treturn\n\t\t}\n\t\t// Get the scroller element\n\t\tthis.scroller = this.$refs.settingsScroller\n\t\tif (!this.addedScrollListener) {\n\t\t\tthis.scroller.addEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = true\n\t\t}\n\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Builds the settings navigation menu\n\t\t *\n\t\t * @param {object} slots The default slots object passed from the render function.\n\t\t * @return {Array} the navigation items\n\t\t */\n\t\tgetSettingsNavigation(slots) {\n\t\t\t// Array of navigationitems strings\n\t\t\tconst navigationItems = slots.filter(vNode => vNode.componentOptions).map(vNode => {\n\t\t\t\treturn {\n\t\t\t\t\tid: vNode.componentOptions.propsData?.id,\n\t\t\t\t\tname: vNode.componentOptions.propsData?.name,\n\t\t\t\t}\n\t\t\t})\n\t\t\tconst navigationNames = slots.map(item => item.name)\n\t\t\tconst navigationIds = slots.map(item => item.id)\n\n\t\t\t// Check for the uniqueness of section names\n\t\t\tnavigationItems.forEach((element, index) => {\n\t\t\t\tconst newNamesArray = [...navigationNames]\n\t\t\t\tconst newIdArray = [...navigationIds]\n\t\t\t\tnewNamesArray.splice(index, 1)\n\t\t\t\tnewIdArray.splice(index, 1)\n\t\t\t\tif (newNamesArray.includes(element.name)) {\n\t\t\t\t\tthrow new Error(`Duplicate section name found: ${element}. Settings navigation sections must have unique section names.`)\n\t\t\t\t}\n\t\t\t\tif (newIdArray.includes(element.id)) {\n\t\t\t\t\tthrow new Error(`Duplicate section id found: ${element}. Settings navigation sections must have unique section ids.`)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn navigationItems\n\t\t},\n\n\t\t/**\n\t\t * Scrolls the content to the selected settings section.absolute\n\t\t *\n\t\t * @param {string} item the ID of the section\n\t\t */\n\t\thandleSettingsNavigationClick(item) {\n\t\t\tthis.linkClicked = true\n\t\t\tdocument.getElementById('settings-section_' + item).scrollIntoView({\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tinline: 'nearest',\n\t\t\t})\n\t\t\tthis.selectedSection = item\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.linkClicked = false\n\t\t\t}, 1000)\n\t\t},\n\n\t\thandleCloseModal(isOpen) {\n\t\t\tif (isOpen) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.$emit('update:open', false)\n\t\t\t// Remove scroll listener each time the modal is closed\n\t\t\tthis.scroller.removeEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = false\n\t\t\tthis.scroller.scrollTop = 0\n\t\t},\n\n\t\thandleScroll() {\n\t\t\tif (!this.linkClicked) {\n\t\t\t\tthis.unfocusNavigationItem()\n\t\t\t}\n\t\t},\n\n\t\t// Remove selected section once the user starts scrolling\n\t\tunfocusNavigationItem: debounce(function() {\n\t\t\tthis.selectedSection = ''\n\t\t\tif (document.activeElement.className.includes('navigation-list__link')) {\n\t\t\t\tdocument.activeElement.blur()\n\t\t\t}\n\t\t}, 300),\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n.app-settings {\n\t&__navigation {\n\t\tmin-width: 200px;\n\t\tmargin-right: 20px;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\tposition: relative;\n\t\theight: 100%;\n\t}\n\t&__content {\n\t\tmax-width: 100vw;\n\t\toverflow-y: auto;\n\t\toverflow-x: hidden;\n\t\tpadding: 24px;\n\t\twidth: 100%;\n\t}\n}\n\n.navigation-list {\n\theight: 100%;\n\tbox-sizing: border-box;\n\toverflow-y: auto;\n\tpadding: 12px;\n\n\t&--collapsed {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tgap: 6px;\n\t}\n\n\t&__link {\n\t\tdisplay: block;\n\t\tfont-size: 16px;\n\t\theight: $clickable-area;\n\t\tmargin: 4px 0;\n\t\tline-height: $clickable-area;\n\t\tborder-radius: var(--border-radius-pill);\n\t\tfont-weight: bold;\n\t\tpadding: 0 20px;\n\t\tcursor: pointer;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t}\n\t\t&--active {\n\t\t\tbackground-color: var(--color-primary-element-light) !important;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","Components_NcDialog","Mixins_isMobile","l10n","slots","navigationItems","vNode","_a","_b","navigationNames","item","navigationIds","element","index","newNamesArray","newIdArray","isOpen","debounce__default"],"mappings":";;AAgHA,MAAAA,IAAA;AAAA,EAEA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAA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,cAAA,KAAA;AAAA,IAEA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcAppSettingsDialog.cjs","sources":["../../src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<docs>\nJust nest the `AppSettingSections` component into `NcAppSettingsDialog`,\nproviding the section's name prop. You can put your settings within each\n`NcAppSettingsSection` component.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"settingsOpen = true\">Show Settings</NcButton>\n\t\t<NcAppSettingsDialog :open.sync=\"settingsOpen\" :show-navigation=\"true\" name=\"Application settings\">\n\t\t\t<NcAppSettingsSection id=\"asci-name-1\" name=\"Example name 1\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-2\" name=\"Example name 2\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-3\" name=\"Example name 3\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-4\" name=\"Example name 4\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-5\" name=\"Example name 5\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-6\" name=\"Example name 6\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-7\" name=\"Example name 7\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-8\" name=\"Example name 8\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-9\" name=\"Example name 9\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-10\" name=\"Example name 10\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t</NcAppSettingsDialog>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tsettingsOpen: false,\n\t\t}\n\t},\n}\n</script>\n```\n\nYou can also add icons to the section navigation:\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"settingsOpen = true\">Show Settings</NcButton>\n\t\t<NcAppSettingsDialog :open.sync=\"settingsOpen\" :show-navigation=\"true\" name=\"Application settings\">\n\t\t\t<NcAppSettingsSection id=\"asci-name-1\" name=\"Instagram\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Instagram :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<p style=\"height: 100vh;\">\n\t\t\t\t\tInstagram setting\n\t\t\t\t</p>\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-2\" name=\"Mastodon\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Mastodon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<p style=\"height: 100vh;\">\n\t\t\t\t\tMastodon setting\n\t\t\t\t</p>\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-3\" name=\"Twitch\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Twitch :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<p style=\"height: 100vh;\">\n\t\t\t\t\tTwitch setting\n\t\t\t\t</p>\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-4\" name=\"Twitter\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Twitter :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tTwitter setting\n\t\t\t</NcAppSettingsSection>\n\t\t</NcAppSettingsDialog>\n\t</div>\n</template>\n\n<script>\nimport Instagram from 'vue-material-design-icons/Instagram.vue'\nimport Mastodon from 'vue-material-design-icons/Mastodon.vue'\nimport Twitch from 'vue-material-design-icons/Twitch.vue'\nimport Twitter from 'vue-material-design-icons/Twitter.vue'\n\nexport default {\n\tcomponents: {\n\t\tInstagram,\n\t\tMastodon,\n\t\tTwitch,\n\t\tTwitter,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tsettingsOpen: false,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcDialog v-if=\"open\"\n\t\tv-bind=\"dialogProperties\"\n\t\t@update:open=\"handleCloseModal\">\n\t\t<template #navigation=\"{ isCollapsed }\">\n\t\t\t<ul :aria-label=\"settingsNavigationAriaLabel\"\n\t\t\t\t:class=\"{ 'navigation-list': true, 'navigation-list--collapsed': isCollapsed }\"\n\t\t\t\trole=\"tablist\">\n\t\t\t\t<li v-for=\"section in sections\" :key=\"section.id\">\n\t\t\t\t\t<a :aria-selected=\"section.id === selectedSection\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'navigation-list__link': true,\n\t\t\t\t\t\t\t'navigation-list__link--active': section.id === selectedSection,\n\t\t\t\t\t\t\t'navigation-list__link--icon': hasNavigationIcons,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t@click=\"handleSettingsNavigationClick(section.id)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSettingsNavigationClick(section.id)\">\n\t\t\t\t\t\t<div v-if=\"hasNavigationIcons\" class=\"navigation-list__link-icon\">\n\t\t\t\t\t\t\t<NcVNodes v-if=\"section.icon\" :vnodes=\"section.icon\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class=\"navigation-list__link-text\">\n\t\t\t\t\t\t\t{{ section.name }}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</template>\n\t\t<div ref=\"settingsScroller\">\n\t\t\t<slot />\n\t\t</div>\n\t</NcDialog>\n</template>\n\n<script>\nimport NcDialog from '../NcDialog/index.js'\nimport NcVNodes from '../NcVNodes/index.js'\nimport isMobile from '../../mixins/isMobile/index.js'\nimport { t } from '../../l10n.js'\n\nimport debounce from 'debounce'\n\nexport default {\n\n\tname: 'NcAppSettingsDialog',\n\n\tcomponents: {\n\t\tNcDialog,\n\t\tNcVNodes,\n\t},\n\n\tmixins: [isMobile],\n\tprovide() {\n\t\treturn {\n\t\t\tregisterSection: this.registerSection,\n\t\t\tunregisterSection: this.registerSection,\n\t\t}\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Determines the open / closed state of the modal\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Shows the navigation on desktop if true\n\t\t */\n\t\tshowNavigation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the popover container\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: String,\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Name of the settings\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Additional elements to add to the focus trap\n\t\t */\n\t\tadditionalTrapElements: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t},\n\n\temits: ['update:open'],\n\n\tdata() {\n\t\treturn {\n\t\t\tselectedSection: '',\n\t\t\tlinkClicked: false,\n\t\t\taddedScrollListener: false,\n\t\t\tscroller: null,\n\t\t\t/**\n\t\t\t * Currently registered settings sections\n\t\t\t * @type {{ id: string, name: string, icon?: VNode[] }}\n\t\t\t */\n\t\t\tsections: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tdialogProperties() {\n\t\t\treturn {\n\t\t\t\tadditionalTrapElements: this.additionalTrapElements,\n\t\t\t\tclass: 'app-settings',\n\t\t\t\tcontainer: this.container,\n\t\t\t\tcontentClasses: 'app-settings__content',\n\t\t\t\tsize: 'large',\n\t\t\t\tname: this.name,\n\t\t\t\tnavigationClasses: 'app-settings__navigation',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Check if one or more navigation entries provide icons\n\t\t */\n\t\thasNavigationIcons() {\n\t\t\treturn this.sections.some(({ icon }) => !!icon)\n\t\t},\n\n\t\thasNavigation() {\n\t\t\tif (this.isMobile || !this.showNavigation) {\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\treturn true\n\t\t\t}\n\t\t},\n\n\t\tsettingsNavigationAriaLabel() {\n\t\t\treturn t('Settings navigation')\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Select first settings section\n\t\tthis.selectedSection = this.$slots.default[0].componentOptions.propsData.id\n\t},\n\n\tupdated() {\n\t\t// Check that the scroller element has been mounted\n\t\tif (!this.$refs.settingsScroller) {\n\t\t\treturn\n\t\t}\n\t\t// Get the scroller element\n\t\tthis.scroller = this.$refs.settingsScroller\n\t\tif (!this.addedScrollListener) {\n\t\t\tthis.scroller.addEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = true\n\t\t}\n\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Called when a new section is registered\n\t\t * @param {string} id The section ID\n\t\t * @param {string} name The section name\n\t\t * @param {import('vue').VNode[]|undefined} icon Optional icon component\n\t\t */\n\t\tregisterSection(id, name, icon) {\n\t\t\t// Check for the uniqueness of section names\n\t\t\tif (this.sections.some(({ id: otherId }) => id === otherId)) {\n\t\t\t\tthrow new Error(`Duplicate section id found: ${id}. Settings navigation sections must have unique section ids.`)\n\t\t\t}\n\t\t\tif (this.sections.some(({ name: otherName }) => name === otherName)) {\n\t\t\t\tthrow new Error(`Duplicate section name found: ${name}. Settings navigation sections must have unique section names.`)\n\t\t\t}\n\n\t\t\tconst newSections = [...this.sections, { id, name, icon }]\n\t\t\t// Sort sections by order in slots\n\t\t\tthis.sections = newSections.sort(({ id: idA }, { id: idB }) => {\n\t\t\t\tconst indexOf = (id) => this.$slots.default.indexOf(vnode => vnode?.componentOptions?.propsData?.id === id)\n\t\t\t\treturn indexOf(idA) - indexOf(idB)\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Called when a new section is unregistered\n\t\t * @param {string} id The section ID\n\t\t */\n\t\tunregisterSection(id) {\n\t\t\tthis.sections = this.sections.filter(({ id: otherId }) => id === otherId)\n\t\t},\n\n\t\t/**\n\t\t * Scrolls the content to the selected settings section.absolute\n\t\t *\n\t\t * @param {string} item the ID of the section\n\t\t */\n\t\thandleSettingsNavigationClick(item) {\n\t\t\tthis.linkClicked = true\n\t\t\tdocument.getElementById('settings-section_' + item).scrollIntoView({\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tinline: 'nearest',\n\t\t\t})\n\t\t\tthis.selectedSection = item\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.linkClicked = false\n\t\t\t}, 1000)\n\t\t},\n\n\t\thandleCloseModal(isOpen) {\n\t\t\tif (isOpen) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.$emit('update:open', false)\n\t\t\t// Remove scroll listener each time the modal is closed\n\t\t\tthis.scroller.removeEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = false\n\t\t\tthis.scroller.scrollTop = 0\n\t\t},\n\n\t\thandleScroll() {\n\t\t\tif (!this.linkClicked) {\n\t\t\t\tthis.unfocusNavigationItem()\n\t\t\t}\n\t\t},\n\n\t\t// Remove selected section once the user starts scrolling\n\t\tunfocusNavigationItem: debounce(function() {\n\t\t\tthis.selectedSection = ''\n\t\t\tif (document.activeElement.className.includes('navigation-list__link')) {\n\t\t\t\tdocument.activeElement.blur()\n\t\t\t}\n\t\t}, 300),\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n.app-settings {\n\t&__navigation {\n\t\tmin-width: 200px;\n\t\tmargin-right: 20px;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\tposition: relative;\n\t\theight: 100%;\n\t}\n\t&__content {\n\t\tmax-width: 100vw;\n\t\toverflow-y: auto;\n\t\toverflow-x: hidden;\n\t\tpadding: 24px;\n\t\twidth: 100%;\n\t}\n}\n\n.navigation-list {\n\theight: 100%;\n\tbox-sizing: border-box;\n\toverflow-y: auto;\n\tpadding: 12px;\n\n\t&--collapsed {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tgap: 6px;\n\t}\n\n\t&__link {\n\t\tdisplay: flex;\n\t\talign-content: center;\n\t\tfont-size: 16px;\n\t\theight: $clickable-area;\n\t\tmargin: 4px 0;\n\t\tline-height: $clickable-area;\n\t\tborder-radius: var(--border-radius-pill);\n\t\tfont-weight: bold;\n\t\tpadding: 0 20px;\n\t\tcursor: pointer;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t}\n\n\t\t&--active {\n\t\t\tbackground-color: var(--color-primary-element-light) !important;\n\t\t}\n\n\t\t&--icon {\n\t\t\tpadding-inline-start: 8px;\n\t\t\tgap: 4px;\n\t\t}\n\n\t\t&-icon {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\talign-content: center;\n\t\t\twidth: 36px;\n\t\t\tmax-width: 36px;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","Components_NcDialog","Components_NcVNodes","Mixins_isMobile","icon","l10n","id","name","otherId","otherName","newSections","idA","idB","indexOf","vnode","_b","_a","item","isOpen","debounce__default"],"mappings":";;AAwLA,MAAAA,IAAA;AAAA,EAEA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EACA,UAAA;AACA,WAAA;AAAA,MACA,iBAAA,KAAA;AAAA,MACA,mBAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,CAAA;AAAA,IACA;AAAA,EAEA;AAAA,EAEA,OAAA,CAAA,aAAA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,iBAAA;AAAA,MACA,aAAA;AAAA,MACA,qBAAA;AAAA,MACA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAKA,UAAA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,mBAAA;AACA,aAAA;AAAA,QACA,wBAAA,KAAA;AAAA,QACA,OAAA;AAAA,QACA,WAAA,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IAAAF,KAAA,gBAAAA,EAAA,qBAAA,gBAAAE,EAAA,cAAA,gBAAAD,EAAA,QAAAT;AAAA,SAAA;AACA,eAAAO,EAAAF,CAAA,IAAAE,EAAAD,CAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,kBAAAN,GAAA;AACA,WAAA,WAAA,KAAA,SAAA,OAAA,CAAA,EAAA,IAAAE,EAAA,MAAAF,MAAAE,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,8BAAAS,GAAA;AACA,WAAA,cAAA,IACA,SAAA,eAAA,sBAAAA,CAAA,EAAA,eAAA;AAAA,QACA,UAAA;AAAA,QACA,QAAA;AAAA,MACA,CAAA,GACA,KAAA,kBAAAA,GACA,WAAA,MAAA;AACA,aAAA,cAAA;AAAA,MACA,GAAA,GAAA;AAAA,IACA;AAAA,IAEA,iBAAAC,GAAA;AACA,MAAAA,MAIA,KAAA,MAAA,eAAA,EAAA,GAEA,KAAA,SAAA,oBAAA,UAAA,KAAA,YAAA,GACA,KAAA,sBAAA,IACA,KAAA,SAAA,YAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,MAAA,KAAA,eACA,KAAA,sBAAA;AAAA,IAEA;AAAA;AAAA,IAGA,uBAAAC,EAAA,QAAA,WAAA;AACA,WAAA,kBAAA,IACA,SAAA,cAAA,UAAA,SAAA,uBAAA,KACA,SAAA,cAAA,KAAA;AAAA,IAEA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import "../assets/index-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import "../assets/index-db5a8b1c.css";
|
|
2
|
+
import u from "./NcDialog.mjs";
|
|
3
|
+
import g from "./NcVNodes.mjs";
|
|
4
|
+
import p from "../Mixins/isMobile.mjs";
|
|
5
|
+
import { t as h } from "../chunks/l10n-f692947e.mjs";
|
|
6
|
+
import f from "debounce";
|
|
7
|
+
import { n as m } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
|
|
8
|
+
const _ = {
|
|
8
9
|
name: "NcAppSettingsDialog",
|
|
9
10
|
components: {
|
|
10
|
-
NcDialog:
|
|
11
|
+
NcDialog: u,
|
|
12
|
+
NcVNodes: g
|
|
13
|
+
},
|
|
14
|
+
mixins: [p],
|
|
15
|
+
provide() {
|
|
16
|
+
return {
|
|
17
|
+
registerSection: this.registerSection,
|
|
18
|
+
unregisterSection: this.registerSection
|
|
19
|
+
};
|
|
11
20
|
},
|
|
12
|
-
mixins: [c],
|
|
13
21
|
props: {
|
|
14
22
|
/**
|
|
15
23
|
* Determines the open / closed state of the modal
|
|
@@ -53,7 +61,12 @@ const g = {
|
|
|
53
61
|
selectedSection: "",
|
|
54
62
|
linkClicked: !1,
|
|
55
63
|
addedScrollListener: !1,
|
|
56
|
-
scroller: null
|
|
64
|
+
scroller: null,
|
|
65
|
+
/**
|
|
66
|
+
* Currently registered settings sections
|
|
67
|
+
* @type {{ id: string, name: string, icon?: VNode[] }}
|
|
68
|
+
*/
|
|
69
|
+
sections: []
|
|
57
70
|
};
|
|
58
71
|
},
|
|
59
72
|
computed: {
|
|
@@ -68,14 +81,17 @@ const g = {
|
|
|
68
81
|
navigationClasses: "app-settings__navigation"
|
|
69
82
|
};
|
|
70
83
|
},
|
|
84
|
+
/**
|
|
85
|
+
* Check if one or more navigation entries provide icons
|
|
86
|
+
*/
|
|
87
|
+
hasNavigationIcons() {
|
|
88
|
+
return this.sections.some(({ icon: i }) => !!i);
|
|
89
|
+
},
|
|
71
90
|
hasNavigation() {
|
|
72
91
|
return !(this.isMobile || !this.showNavigation);
|
|
73
92
|
},
|
|
74
93
|
settingsNavigationAriaLabel() {
|
|
75
|
-
return
|
|
76
|
-
},
|
|
77
|
-
getNavigationItems() {
|
|
78
|
-
return this.getSettingsNavigation(this.$slots.default);
|
|
94
|
+
return h("Settings navigation");
|
|
79
95
|
}
|
|
80
96
|
},
|
|
81
97
|
mounted() {
|
|
@@ -86,77 +102,83 @@ const g = {
|
|
|
86
102
|
},
|
|
87
103
|
methods: {
|
|
88
104
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* @param {
|
|
92
|
-
* @
|
|
105
|
+
* Called when a new section is registered
|
|
106
|
+
* @param {string} id The section ID
|
|
107
|
+
* @param {string} name The section name
|
|
108
|
+
* @param {import('vue').VNode[]|undefined} icon Optional icon component
|
|
109
|
+
*/
|
|
110
|
+
registerSection(i, e, n) {
|
|
111
|
+
if (this.sections.some(({ id: t }) => i === t))
|
|
112
|
+
throw new Error(`Duplicate section id found: ${i}. Settings navigation sections must have unique section ids.`);
|
|
113
|
+
if (this.sections.some(({ name: t }) => e === t))
|
|
114
|
+
throw new Error(`Duplicate section name found: ${e}. Settings navigation sections must have unique section names.`);
|
|
115
|
+
const o = [...this.sections, { id: i, name: e, icon: n }];
|
|
116
|
+
this.sections = o.sort(({ id: t }, { id: s }) => {
|
|
117
|
+
const l = (d) => this.$slots.default.indexOf((a) => {
|
|
118
|
+
var r, c;
|
|
119
|
+
return ((c = (r = a == null ? void 0 : a.componentOptions) == null ? void 0 : r.propsData) == null ? void 0 : c.id) === d;
|
|
120
|
+
});
|
|
121
|
+
return l(t) - l(s);
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* Called when a new section is unregistered
|
|
126
|
+
* @param {string} id The section ID
|
|
93
127
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var i, s;
|
|
97
|
-
return {
|
|
98
|
-
id: (i = t.componentOptions.propsData) == null ? void 0 : i.id,
|
|
99
|
-
name: (s = t.componentOptions.propsData) == null ? void 0 : s.name
|
|
100
|
-
};
|
|
101
|
-
}), a = n.map((t) => t.name), o = n.map((t) => t.id);
|
|
102
|
-
return e.forEach((t, i) => {
|
|
103
|
-
const s = [...a], l = [...o];
|
|
104
|
-
if (s.splice(i, 1), l.splice(i, 1), s.includes(t.name))
|
|
105
|
-
throw new Error(`Duplicate section name found: ${t}. Settings navigation sections must have unique section names.`);
|
|
106
|
-
if (l.includes(t.id))
|
|
107
|
-
throw new Error(`Duplicate section id found: ${t}. Settings navigation sections must have unique section ids.`);
|
|
108
|
-
}), e;
|
|
128
|
+
unregisterSection(i) {
|
|
129
|
+
this.sections = this.sections.filter(({ id: e }) => i === e);
|
|
109
130
|
},
|
|
110
131
|
/**
|
|
111
132
|
* Scrolls the content to the selected settings section.absolute
|
|
112
133
|
*
|
|
113
134
|
* @param {string} item the ID of the section
|
|
114
135
|
*/
|
|
115
|
-
handleSettingsNavigationClick(
|
|
116
|
-
this.linkClicked = !0, document.getElementById("settings-section_" +
|
|
136
|
+
handleSettingsNavigationClick(i) {
|
|
137
|
+
this.linkClicked = !0, document.getElementById("settings-section_" + i).scrollIntoView({
|
|
117
138
|
behavior: "smooth",
|
|
118
139
|
inline: "nearest"
|
|
119
|
-
}), this.selectedSection =
|
|
140
|
+
}), this.selectedSection = i, setTimeout(() => {
|
|
120
141
|
this.linkClicked = !1;
|
|
121
142
|
}, 1e3);
|
|
122
143
|
},
|
|
123
|
-
handleCloseModal(
|
|
124
|
-
|
|
144
|
+
handleCloseModal(i) {
|
|
145
|
+
i || (this.$emit("update:open", !1), this.scroller.removeEventListener("scroll", this.handleScroll), this.addedScrollListener = !1, this.scroller.scrollTop = 0);
|
|
125
146
|
},
|
|
126
147
|
handleScroll() {
|
|
127
148
|
this.linkClicked || this.unfocusNavigationItem();
|
|
128
149
|
},
|
|
129
150
|
// Remove selected section once the user starts scrolling
|
|
130
|
-
unfocusNavigationItem:
|
|
151
|
+
unfocusNavigationItem: f(function() {
|
|
131
152
|
this.selectedSection = "", document.activeElement.className.includes("navigation-list__link") && document.activeElement.blur();
|
|
132
153
|
}, 300)
|
|
133
154
|
}
|
|
134
155
|
};
|
|
135
|
-
var
|
|
136
|
-
var e = this,
|
|
137
|
-
return e.open ?
|
|
138
|
-
return [
|
|
139
|
-
return
|
|
156
|
+
var v = function() {
|
|
157
|
+
var e = this, n = e._self._c;
|
|
158
|
+
return e.open ? n("NcDialog", e._b({ on: { "update:open": e.handleCloseModal }, scopedSlots: e._u([{ key: "navigation", fn: function({ isCollapsed: o }) {
|
|
159
|
+
return [n("ul", { class: { "navigation-list": !0, "navigation-list--collapsed": o }, attrs: { "aria-label": e.settingsNavigationAriaLabel, role: "tablist" } }, e._l(e.sections, function(t) {
|
|
160
|
+
return n("li", { key: t.id }, [n("a", { class: {
|
|
140
161
|
"navigation-list__link": !0,
|
|
141
|
-
"navigation-list__link--active": t.id === e.selectedSection
|
|
142
|
-
|
|
162
|
+
"navigation-list__link--active": t.id === e.selectedSection,
|
|
163
|
+
"navigation-list__link--icon": e.hasNavigationIcons
|
|
164
|
+
}, attrs: { "aria-selected": t.id === e.selectedSection, role: "tab", tabindex: "0" }, on: { click: function(s) {
|
|
143
165
|
return e.handleSettingsNavigationClick(t.id);
|
|
144
|
-
}, keydown: function(
|
|
145
|
-
return !
|
|
146
|
-
} } }, [e._v(e._s(t.name))])]);
|
|
166
|
+
}, keydown: function(s) {
|
|
167
|
+
return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.handleSettingsNavigationClick(t.id);
|
|
168
|
+
} } }, [e.hasNavigationIcons ? n("div", { staticClass: "navigation-list__link-icon" }, [t.icon ? n("NcVNodes", { attrs: { vnodes: t.icon } }) : e._e()], 1) : e._e(), n("span", { staticClass: "navigation-list__link-text" }, [e._v(" " + e._s(t.name) + " ")])])]);
|
|
147
169
|
}), 0)];
|
|
148
|
-
} }], null, !1,
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
170
|
+
} }], null, !1, 1562656468) }, "NcDialog", e.dialogProperties, !1), [n("div", { ref: "settingsScroller" }, [e._t("default")], 2)]) : e._e();
|
|
171
|
+
}, S = [], k = /* @__PURE__ */ m(
|
|
172
|
+
_,
|
|
173
|
+
v,
|
|
174
|
+
S,
|
|
153
175
|
!1,
|
|
154
176
|
null,
|
|
155
|
-
"
|
|
177
|
+
"b5b2caa2",
|
|
156
178
|
null,
|
|
157
179
|
null
|
|
158
180
|
);
|
|
159
|
-
const
|
|
181
|
+
const x = k.exports;
|
|
160
182
|
export {
|
|
161
|
-
|
|
183
|
+
x as default
|
|
162
184
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcAppSettingsDialog.mjs","sources":["../../src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<docs>\nJust nest the `AppSettingSections` component into `NcAppSettingsDialog`,\nproviding the section's name prop. You can put your settings within each\n`NcAppSettingsSection` component.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"settingsOpen = true\">Show Settings</NcButton>\n\t\t<NcAppSettingsDialog :open.sync=\"settingsOpen\" :show-navigation=\"true\" name=\"Application settings\">\n\t\t\t<NcAppSettingsSection id=\"asci-name-1\" name=\"Example name 1\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-2\" name=\"Example name 2\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-3\" name=\"Example name 3\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-4\" name=\"Example name 4\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-5\" name=\"Example name 5\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-6\" name=\"Example name 6\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-7\" name=\"Example name 7\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-8\" name=\"Example name 8\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-9\" name=\"Example name 9\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-10\" name=\"Example name 10\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t</NcAppSettingsDialog>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tsettingsOpen: false,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcDialog v-if=\"open\"\n\t\tv-bind=\"dialogProperties\"\n\t\t@update:open=\"handleCloseModal\">\n\t\t<template #navigation=\"{ isCollapsed }\">\n\t\t\t<ul :aria-label=\"settingsNavigationAriaLabel\"\n\t\t\t\t:class=\"{ 'navigation-list': true, 'navigation-list--collapsed': isCollapsed }\"\n\t\t\t\trole=\"tablist\">\n\t\t\t\t<li v-for=\"item in getNavigationItems\" :key=\"item.id\">\n\t\t\t\t\t<a :aria-selected=\"item.id === selectedSection\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'navigation-list__link': true,\n\t\t\t\t\t\t\t'navigation-list__link--active': item.id === selectedSection,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t@click=\"handleSettingsNavigationClick(item.id)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSettingsNavigationClick(item.id)\">{{ item.name }}</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</template>\n\t\t<div ref=\"settingsScroller\">\n\t\t\t<slot />\n\t\t</div>\n\t</NcDialog>\n</template>\n\n<script>\nimport NcDialog from '../NcDialog/index.js'\nimport isMobile from '../../mixins/isMobile/index.js'\nimport { t } from '../../l10n.js'\n\nimport debounce from 'debounce'\n\nexport default {\n\n\tname: 'NcAppSettingsDialog',\n\n\tcomponents: {\n\t\tNcDialog,\n\t},\n\n\tmixins: [isMobile],\n\n\tprops: {\n\t\t/**\n\t\t * Determines the open / closed state of the modal\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Shows the navigation on desktop if true\n\t\t */\n\t\tshowNavigation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the popover container\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: String,\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Name of the settings\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Additional elements to add to the focus trap\n\t\t */\n\t\tadditionalTrapElements: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t},\n\n\temits: ['update:open'],\n\n\tdata() {\n\t\treturn {\n\t\t\tselectedSection: '',\n\t\t\tlinkClicked: false,\n\t\t\taddedScrollListener: false,\n\t\t\tscroller: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tdialogProperties() {\n\t\t\treturn {\n\t\t\t\tadditionalTrapElements: this.additionalTrapElements,\n\t\t\t\tclass: 'app-settings',\n\t\t\t\tcontainer: this.container,\n\t\t\t\tcontentClasses: 'app-settings__content',\n\t\t\t\tsize: 'large',\n\t\t\t\tname: this.name,\n\t\t\t\tnavigationClasses: 'app-settings__navigation',\n\t\t\t}\n\t\t},\n\n\t\thasNavigation() {\n\t\t\tif (this.isMobile || !this.showNavigation) {\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\treturn true\n\t\t\t}\n\t\t},\n\n\t\tsettingsNavigationAriaLabel() {\n\t\t\treturn t('Settings navigation')\n\t\t},\n\n\t\tgetNavigationItems() {\n\t\t\treturn this.getSettingsNavigation(this.$slots.default)\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Select first settings section\n\t\tthis.selectedSection = this.$slots.default[0].componentOptions.propsData.id\n\t},\n\n\tupdated() {\n\t\t// Check that the scroller element has been mounted\n\t\tif (!this.$refs.settingsScroller) {\n\t\t\treturn\n\t\t}\n\t\t// Get the scroller element\n\t\tthis.scroller = this.$refs.settingsScroller\n\t\tif (!this.addedScrollListener) {\n\t\t\tthis.scroller.addEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = true\n\t\t}\n\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Builds the settings navigation menu\n\t\t *\n\t\t * @param {object} slots The default slots object passed from the render function.\n\t\t * @return {Array} the navigation items\n\t\t */\n\t\tgetSettingsNavigation(slots) {\n\t\t\t// Array of navigationitems strings\n\t\t\tconst navigationItems = slots.filter(vNode => vNode.componentOptions).map(vNode => {\n\t\t\t\treturn {\n\t\t\t\t\tid: vNode.componentOptions.propsData?.id,\n\t\t\t\t\tname: vNode.componentOptions.propsData?.name,\n\t\t\t\t}\n\t\t\t})\n\t\t\tconst navigationNames = slots.map(item => item.name)\n\t\t\tconst navigationIds = slots.map(item => item.id)\n\n\t\t\t// Check for the uniqueness of section names\n\t\t\tnavigationItems.forEach((element, index) => {\n\t\t\t\tconst newNamesArray = [...navigationNames]\n\t\t\t\tconst newIdArray = [...navigationIds]\n\t\t\t\tnewNamesArray.splice(index, 1)\n\t\t\t\tnewIdArray.splice(index, 1)\n\t\t\t\tif (newNamesArray.includes(element.name)) {\n\t\t\t\t\tthrow new Error(`Duplicate section name found: ${element}. Settings navigation sections must have unique section names.`)\n\t\t\t\t}\n\t\t\t\tif (newIdArray.includes(element.id)) {\n\t\t\t\t\tthrow new Error(`Duplicate section id found: ${element}. Settings navigation sections must have unique section ids.`)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn navigationItems\n\t\t},\n\n\t\t/**\n\t\t * Scrolls the content to the selected settings section.absolute\n\t\t *\n\t\t * @param {string} item the ID of the section\n\t\t */\n\t\thandleSettingsNavigationClick(item) {\n\t\t\tthis.linkClicked = true\n\t\t\tdocument.getElementById('settings-section_' + item).scrollIntoView({\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tinline: 'nearest',\n\t\t\t})\n\t\t\tthis.selectedSection = item\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.linkClicked = false\n\t\t\t}, 1000)\n\t\t},\n\n\t\thandleCloseModal(isOpen) {\n\t\t\tif (isOpen) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.$emit('update:open', false)\n\t\t\t// Remove scroll listener each time the modal is closed\n\t\t\tthis.scroller.removeEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = false\n\t\t\tthis.scroller.scrollTop = 0\n\t\t},\n\n\t\thandleScroll() {\n\t\t\tif (!this.linkClicked) {\n\t\t\t\tthis.unfocusNavigationItem()\n\t\t\t}\n\t\t},\n\n\t\t// Remove selected section once the user starts scrolling\n\t\tunfocusNavigationItem: debounce(function() {\n\t\t\tthis.selectedSection = ''\n\t\t\tif (document.activeElement.className.includes('navigation-list__link')) {\n\t\t\t\tdocument.activeElement.blur()\n\t\t\t}\n\t\t}, 300),\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n.app-settings {\n\t&__navigation {\n\t\tmin-width: 200px;\n\t\tmargin-right: 20px;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\tposition: relative;\n\t\theight: 100%;\n\t}\n\t&__content {\n\t\tmax-width: 100vw;\n\t\toverflow-y: auto;\n\t\toverflow-x: hidden;\n\t\tpadding: 24px;\n\t\twidth: 100%;\n\t}\n}\n\n.navigation-list {\n\theight: 100%;\n\tbox-sizing: border-box;\n\toverflow-y: auto;\n\tpadding: 12px;\n\n\t&--collapsed {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tgap: 6px;\n\t}\n\n\t&__link {\n\t\tdisplay: block;\n\t\tfont-size: 16px;\n\t\theight: $clickable-area;\n\t\tmargin: 4px 0;\n\t\tline-height: $clickable-area;\n\t\tborder-radius: var(--border-radius-pill);\n\t\tfont-weight: bold;\n\t\tpadding: 0 20px;\n\t\tcursor: pointer;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t}\n\t\t&--active {\n\t\t\tbackground-color: var(--color-primary-element-light) !important;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","NcDialog","isMobile","t","slots","navigationItems","vNode","_a","_b","navigationNames","item","navigationIds","element","index","newNamesArray","newIdArray","isOpen","debounce"],"mappings":";;;;;;AAgHA,MAAAA,IAAA;AAAA,EAEA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AA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cAAA,UAAA,SAAA,uBAAA,KACA,SAAA,cAAA,KAAA;AAAA,IAEA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcAppSettingsDialog.mjs","sources":["../../src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<docs>\nJust nest the `AppSettingSections` component into `NcAppSettingsDialog`,\nproviding the section's name prop. You can put your settings within each\n`NcAppSettingsSection` component.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"settingsOpen = true\">Show Settings</NcButton>\n\t\t<NcAppSettingsDialog :open.sync=\"settingsOpen\" :show-navigation=\"true\" name=\"Application settings\">\n\t\t\t<NcAppSettingsSection id=\"asci-name-1\" name=\"Example name 1\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-2\" name=\"Example name 2\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-3\" name=\"Example name 3\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-4\" name=\"Example name 4\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-5\" name=\"Example name 5\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-6\" name=\"Example name 6\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-7\" name=\"Example name 7\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-8\" name=\"Example name 8\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-9\" name=\"Example name 9\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-10\" name=\"Example name 10\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t</NcAppSettingsDialog>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tsettingsOpen: false,\n\t\t}\n\t},\n}\n</script>\n```\n\nYou can also add icons to the section navigation:\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"settingsOpen = true\">Show Settings</NcButton>\n\t\t<NcAppSettingsDialog :open.sync=\"settingsOpen\" :show-navigation=\"true\" name=\"Application settings\">\n\t\t\t<NcAppSettingsSection id=\"asci-name-1\" name=\"Instagram\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Instagram :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<p style=\"height: 100vh;\">\n\t\t\t\t\tInstagram setting\n\t\t\t\t</p>\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-2\" name=\"Mastodon\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Mastodon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<p style=\"height: 100vh;\">\n\t\t\t\t\tMastodon setting\n\t\t\t\t</p>\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-3\" name=\"Twitch\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Twitch :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<p style=\"height: 100vh;\">\n\t\t\t\t\tTwitch setting\n\t\t\t\t</p>\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-4\" name=\"Twitter\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Twitter :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\tTwitter setting\n\t\t\t</NcAppSettingsSection>\n\t\t</NcAppSettingsDialog>\n\t</div>\n</template>\n\n<script>\nimport Instagram from 'vue-material-design-icons/Instagram.vue'\nimport Mastodon from 'vue-material-design-icons/Mastodon.vue'\nimport Twitch from 'vue-material-design-icons/Twitch.vue'\nimport Twitter from 'vue-material-design-icons/Twitter.vue'\n\nexport default {\n\tcomponents: {\n\t\tInstagram,\n\t\tMastodon,\n\t\tTwitch,\n\t\tTwitter,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tsettingsOpen: false,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcDialog v-if=\"open\"\n\t\tv-bind=\"dialogProperties\"\n\t\t@update:open=\"handleCloseModal\">\n\t\t<template #navigation=\"{ isCollapsed }\">\n\t\t\t<ul :aria-label=\"settingsNavigationAriaLabel\"\n\t\t\t\t:class=\"{ 'navigation-list': true, 'navigation-list--collapsed': isCollapsed }\"\n\t\t\t\trole=\"tablist\">\n\t\t\t\t<li v-for=\"section in sections\" :key=\"section.id\">\n\t\t\t\t\t<a :aria-selected=\"section.id === selectedSection\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'navigation-list__link': true,\n\t\t\t\t\t\t\t'navigation-list__link--active': section.id === selectedSection,\n\t\t\t\t\t\t\t'navigation-list__link--icon': hasNavigationIcons,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t@click=\"handleSettingsNavigationClick(section.id)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSettingsNavigationClick(section.id)\">\n\t\t\t\t\t\t<div v-if=\"hasNavigationIcons\" class=\"navigation-list__link-icon\">\n\t\t\t\t\t\t\t<NcVNodes v-if=\"section.icon\" :vnodes=\"section.icon\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class=\"navigation-list__link-text\">\n\t\t\t\t\t\t\t{{ section.name }}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</template>\n\t\t<div ref=\"settingsScroller\">\n\t\t\t<slot />\n\t\t</div>\n\t</NcDialog>\n</template>\n\n<script>\nimport NcDialog from '../NcDialog/index.js'\nimport NcVNodes from '../NcVNodes/index.js'\nimport isMobile from '../../mixins/isMobile/index.js'\nimport { t } from '../../l10n.js'\n\nimport debounce from 'debounce'\n\nexport default {\n\n\tname: 'NcAppSettingsDialog',\n\n\tcomponents: {\n\t\tNcDialog,\n\t\tNcVNodes,\n\t},\n\n\tmixins: [isMobile],\n\tprovide() {\n\t\treturn {\n\t\t\tregisterSection: this.registerSection,\n\t\t\tunregisterSection: this.registerSection,\n\t\t}\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Determines the open / closed state of the modal\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Shows the navigation on desktop if true\n\t\t */\n\t\tshowNavigation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the popover container\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: String,\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Name of the settings\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Additional elements to add to the focus trap\n\t\t */\n\t\tadditionalTrapElements: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t},\n\n\temits: ['update:open'],\n\n\tdata() {\n\t\treturn {\n\t\t\tselectedSection: '',\n\t\t\tlinkClicked: false,\n\t\t\taddedScrollListener: false,\n\t\t\tscroller: null,\n\t\t\t/**\n\t\t\t * Currently registered settings sections\n\t\t\t * @type {{ id: string, name: string, icon?: VNode[] }}\n\t\t\t */\n\t\t\tsections: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tdialogProperties() {\n\t\t\treturn {\n\t\t\t\tadditionalTrapElements: this.additionalTrapElements,\n\t\t\t\tclass: 'app-settings',\n\t\t\t\tcontainer: this.container,\n\t\t\t\tcontentClasses: 'app-settings__content',\n\t\t\t\tsize: 'large',\n\t\t\t\tname: this.name,\n\t\t\t\tnavigationClasses: 'app-settings__navigation',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Check if one or more navigation entries provide icons\n\t\t */\n\t\thasNavigationIcons() {\n\t\t\treturn this.sections.some(({ icon }) => !!icon)\n\t\t},\n\n\t\thasNavigation() {\n\t\t\tif (this.isMobile || !this.showNavigation) {\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\treturn true\n\t\t\t}\n\t\t},\n\n\t\tsettingsNavigationAriaLabel() {\n\t\t\treturn t('Settings navigation')\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Select first settings section\n\t\tthis.selectedSection = this.$slots.default[0].componentOptions.propsData.id\n\t},\n\n\tupdated() {\n\t\t// Check that the scroller element has been mounted\n\t\tif (!this.$refs.settingsScroller) {\n\t\t\treturn\n\t\t}\n\t\t// Get the scroller element\n\t\tthis.scroller = this.$refs.settingsScroller\n\t\tif (!this.addedScrollListener) {\n\t\t\tthis.scroller.addEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = true\n\t\t}\n\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Called when a new section is registered\n\t\t * @param {string} id The section ID\n\t\t * @param {string} name The section name\n\t\t * @param {import('vue').VNode[]|undefined} icon Optional icon component\n\t\t */\n\t\tregisterSection(id, name, icon) {\n\t\t\t// Check for the uniqueness of section names\n\t\t\tif (this.sections.some(({ id: otherId }) => id === otherId)) {\n\t\t\t\tthrow new Error(`Duplicate section id found: ${id}. Settings navigation sections must have unique section ids.`)\n\t\t\t}\n\t\t\tif (this.sections.some(({ name: otherName }) => name === otherName)) {\n\t\t\t\tthrow new Error(`Duplicate section name found: ${name}. Settings navigation sections must have unique section names.`)\n\t\t\t}\n\n\t\t\tconst newSections = [...this.sections, { id, name, icon }]\n\t\t\t// Sort sections by order in slots\n\t\t\tthis.sections = newSections.sort(({ id: idA }, { id: idB }) => {\n\t\t\t\tconst indexOf = (id) => this.$slots.default.indexOf(vnode => vnode?.componentOptions?.propsData?.id === id)\n\t\t\t\treturn indexOf(idA) - indexOf(idB)\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Called when a new section is unregistered\n\t\t * @param {string} id The section ID\n\t\t */\n\t\tunregisterSection(id) {\n\t\t\tthis.sections = this.sections.filter(({ id: otherId }) => id === otherId)\n\t\t},\n\n\t\t/**\n\t\t * Scrolls the content to the selected settings section.absolute\n\t\t *\n\t\t * @param {string} item the ID of the section\n\t\t */\n\t\thandleSettingsNavigationClick(item) {\n\t\t\tthis.linkClicked = true\n\t\t\tdocument.getElementById('settings-section_' + item).scrollIntoView({\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tinline: 'nearest',\n\t\t\t})\n\t\t\tthis.selectedSection = item\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.linkClicked = false\n\t\t\t}, 1000)\n\t\t},\n\n\t\thandleCloseModal(isOpen) {\n\t\t\tif (isOpen) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.$emit('update:open', false)\n\t\t\t// Remove scroll listener each time the modal is closed\n\t\t\tthis.scroller.removeEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = false\n\t\t\tthis.scroller.scrollTop = 0\n\t\t},\n\n\t\thandleScroll() {\n\t\t\tif (!this.linkClicked) {\n\t\t\t\tthis.unfocusNavigationItem()\n\t\t\t}\n\t\t},\n\n\t\t// Remove selected section once the user starts scrolling\n\t\tunfocusNavigationItem: debounce(function() {\n\t\t\tthis.selectedSection = ''\n\t\t\tif (document.activeElement.className.includes('navigation-list__link')) {\n\t\t\t\tdocument.activeElement.blur()\n\t\t\t}\n\t\t}, 300),\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n.app-settings {\n\t&__navigation {\n\t\tmin-width: 200px;\n\t\tmargin-right: 20px;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\tposition: relative;\n\t\theight: 100%;\n\t}\n\t&__content {\n\t\tmax-width: 100vw;\n\t\toverflow-y: auto;\n\t\toverflow-x: hidden;\n\t\tpadding: 24px;\n\t\twidth: 100%;\n\t}\n}\n\n.navigation-list {\n\theight: 100%;\n\tbox-sizing: border-box;\n\toverflow-y: auto;\n\tpadding: 12px;\n\n\t&--collapsed {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tgap: 6px;\n\t}\n\n\t&__link {\n\t\tdisplay: flex;\n\t\talign-content: center;\n\t\tfont-size: 16px;\n\t\theight: $clickable-area;\n\t\tmargin: 4px 0;\n\t\tline-height: $clickable-area;\n\t\tborder-radius: var(--border-radius-pill);\n\t\tfont-weight: bold;\n\t\tpadding: 0 20px;\n\t\tcursor: pointer;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t}\n\n\t\t&--active {\n\t\t\tbackground-color: var(--color-primary-element-light) !important;\n\t\t}\n\n\t\t&--icon {\n\t\t\tpadding-inline-start: 8px;\n\t\t\tgap: 4px;\n\t\t}\n\n\t\t&-icon {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\talign-content: center;\n\t\t\twidth: 36px;\n\t\t\tmax-width: 36px;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","NcDialog","NcVNodes","isMobile","icon","t","id","name","otherId","otherName","newSections","idA","idB","indexOf","vnode","_b","_a","item","isOpen","debounce"],"mappings":";;;;;;;AAwLA,MAAAA,IAAA;AAAA,EAEA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EACA,UAAA;AACA,WAAA;AAAA,MACA,iBAAA,KAAA;AAAA,MACA,mBAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,CAAA;AAAA,IACA;AAAA,EAEA;AAAA,EAEA,OAAA,CAAA,aAAA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,iBAAA;AAAA,MACA,aAAA;AAAA,MACA,qBAAA;AAAA,MACA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAKA,UAAA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,mBAAA;AACA,aAAA;AAAA,QACA,wBAAA,KAAA;AAAA,QACA,O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mBAAAC,KAAAC,IAAAF,KAAA,gBAAAA,EAAA,qBAAA,gBAAAE,EAAA,cAAA,gBAAAD,EAAA,QAAAT;AAAA,SAAA;AACA,eAAAO,EAAAF,CAAA,IAAAE,EAAAD,CAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,kBAAAN,GAAA;AACA,WAAA,WAAA,KAAA,SAAA,OAAA,CAAA,EAAA,IAAAE,EAAA,MAAAF,MAAAE,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,8BAAAS,GAAA;AACA,WAAA,cAAA,IACA,SAAA,eAAA,sBAAAA,CAAA,EAAA,eAAA;AAAA,QACA,UAAA;AAAA,QACA,QAAA;AAAA,MACA,CAAA,GACA,KAAA,kBAAAA,GACA,WAAA,MAAA;AACA,aAAA,cAAA;AAAA,MACA,GAAA,GAAA;AAAA,IACA;AAAA,IAEA,iBAAAC,GAAA;AACA,MAAAA,MAIA,KAAA,MAAA,eAAA,EAAA,GAEA,KAAA,SAAA,oBAAA,UAAA,KAAA,YAAA,GACA,KAAA,sBAAA,IACA,KAAA,SAAA,YAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,MAAA,KAAA,eACA,KAAA,sBAAA;AAAA,IAEA;AAAA;AAAA,IAGA,uBAAAC,EAAA,WAAA;AACA,WAAA,kBAAA,IACA,SAAA,cAAA,UAAA,SAAA,uBAAA,KACA,SAAA,cAAA,KAAA;AAAA,IAEA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a = require("../assets/index-1f25a3c0.css");
|
|
2
2
|
const s = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs");
|
|
3
|
-
const
|
|
3
|
+
const n = {
|
|
4
4
|
name: "NcAppSettingsSection",
|
|
5
|
+
inject: ["registerSection", "unregisterSection"],
|
|
5
6
|
props: {
|
|
6
7
|
name: {
|
|
7
8
|
type: String,
|
|
@@ -20,20 +21,38 @@ const i = {
|
|
|
20
21
|
htmlId() {
|
|
21
22
|
return "settings-section_" + this.id;
|
|
22
23
|
}
|
|
24
|
+
},
|
|
25
|
+
// Reactive changes for section navigation
|
|
26
|
+
watch: {
|
|
27
|
+
id(e, t) {
|
|
28
|
+
var i;
|
|
29
|
+
this.unregisterSection(t), this.registerSection(e, this.name, (i = this.$slots) == null ? void 0 : i.icon);
|
|
30
|
+
},
|
|
31
|
+
name(e) {
|
|
32
|
+
var t;
|
|
33
|
+
this.unregisterSection(this.id), this.registerSection(this.id, e, (t = this.$slots) == null ? void 0 : t.icon);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
mounted() {
|
|
37
|
+
var e;
|
|
38
|
+
this.registerSection(this.id, this.name, (e = this.$slots) == null ? void 0 : e.icon);
|
|
39
|
+
},
|
|
40
|
+
beforeDestroy() {
|
|
41
|
+
this.unregisterSection(this.id);
|
|
23
42
|
}
|
|
24
43
|
};
|
|
25
44
|
var r = function() {
|
|
26
|
-
var t = this,
|
|
27
|
-
return
|
|
28
|
-
},
|
|
29
|
-
|
|
45
|
+
var t = this, i = t._self._c;
|
|
46
|
+
return i("div", { staticClass: "app-settings-section", attrs: { id: t.htmlId } }, [i("h3", { staticClass: "app-settings-section__name" }, [t._v(" " + t._s(t.name) + " ")]), t._t("default"), t._e()], 2);
|
|
47
|
+
}, o = [], c = /* @__PURE__ */ s.normalizeComponent(
|
|
48
|
+
n,
|
|
30
49
|
r,
|
|
31
|
-
|
|
50
|
+
o,
|
|
32
51
|
!1,
|
|
33
52
|
null,
|
|
34
|
-
"
|
|
53
|
+
"5162e6df",
|
|
35
54
|
null,
|
|
36
55
|
null
|
|
37
56
|
);
|
|
38
|
-
const
|
|
39
|
-
module.exports =
|
|
57
|
+
const _ = c.exports;
|
|
58
|
+
module.exports = _;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcAppSettingsSection.cjs","sources":["../../src/components/NcAppSettingsSection/NcAppSettingsSection.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<div :id=\"htmlId\" class=\"app-settings-section\">\n\t\t<h3 class=\"app-settings-section__name\">\n\t\t\t{{ name }}\n\t\t</h3>\n\t\t<slot />\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcAppSettingsSection',\n\n\tprops: {\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\tid: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tvalidator(id) {\n\t\t\t\t// Only alphanumeric, dash and underscore\n\t\t\t\treturn /^[a-z0-9\\-_]+$/.test(id)\n\t\t\t},\n\t\t},\n\t},\n\tcomputed: {\n\t\t// generate an id for each settingssection based on the name without whitespaces\n\t\thtmlId() {\n\t\t\treturn 'settings-section_' + this.id\n\t\t},\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n.app-settings-section {\n\tmargin-bottom: 80px;\n\t&__name {\n\t\tfont-size: 20px;\n\t\tmargin: 0;\n\t\tpadding: 20px 0;\n\t\tfont-weight: bold;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n</style>\n"],"names":["_sfc_main","id"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"NcAppSettingsSection.cjs","sources":["../../src/components/NcAppSettingsSection/NcAppSettingsSection.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<div :id=\"htmlId\" class=\"app-settings-section\">\n\t\t<h3 class=\"app-settings-section__name\">\n\t\t\t{{ name }}\n\t\t</h3>\n\t\t<slot />\n\t\t<!-- @slot Optonal icon to for the secion in the navigation -->\n\t\t<slot v-if=\"false\" name=\"icon\" />\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcAppSettingsSection',\n\tinject: ['registerSection', 'unregisterSection'],\n\n\tprops: {\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\tid: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tvalidator(id) {\n\t\t\t\t// Only alphanumeric, dash and underscore\n\t\t\t\treturn /^[a-z0-9\\-_]+$/.test(id)\n\t\t\t},\n\t\t},\n\t},\n\tcomputed: {\n\t\t// generate an id for each settingssection based on the name without whitespaces\n\t\thtmlId() {\n\t\t\treturn 'settings-section_' + this.id\n\t\t},\n\t},\n\t// Reactive changes for section navigation\n\twatch: {\n\t\tid(newId, oldId) {\n\t\t\tthis.unregisterSection(oldId)\n\t\t\tthis.registerSection(newId, this.name, this.$slots?.icon)\n\t\t},\n\t\tname(newName) {\n\t\t\tthis.unregisterSection(this.id)\n\t\t\tthis.registerSection(this.id, newName, this.$slots?.icon)\n\t\t},\n\t},\n\tmounted() {\n\t\t// register section for navigation\n\t\tthis.registerSection(this.id, this.name, this.$slots?.icon)\n\t},\n\tbeforeDestroy() {\n\t\tthis.unregisterSection(this.id)\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n.app-settings-section {\n\tmargin-bottom: 80px;\n\t&__name {\n\t\tfont-size: 20px;\n\t\tmargin: 0;\n\t\tpadding: 20px 0;\n\t\tfont-weight: bold;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n</style>\n"],"names":["_sfc_main","id","newId","oldId","_a","newName"],"mappings":";;AAkCA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA,CAAA,mBAAA,mBAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAAC,GAAA;AAEA,eAAA,iBAAA,KAAAA,CAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;AAAA;AAAA,IAEA,SAAA;AACA,aAAA,sBAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA;AAAA,EAEA,OAAA;AAAA,IACA,GAAAC,GAAAC,GAAA;;AACA,WAAA,kBAAAA,CAAA,GACA,KAAA,gBAAAD,GAAA,KAAA,OAAAE,IAAA,KAAA,WAAA,gBAAAA,EAAA,IAAA;AAAA,IACA;AAAA,IACA,KAAAC,GAAA;;AACA,WAAA,kBAAA,KAAA,EAAA,GACA,KAAA,gBAAA,KAAA,IAAAA,IAAAD,IAAA,KAAA,WAAA,gBAAAA,EAAA,IAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;;AAEA,SAAA,gBAAA,KAAA,IAAA,KAAA,OAAAA,IAAA,KAAA,WAAA,gBAAAA,EAAA,IAAA;AAAA,EACA;AAAA,EACA,gBAAA;AACA,SAAA,kBAAA,KAAA,EAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import "../assets/index-
|
|
1
|
+
import "../assets/index-1f25a3c0.css";
|
|
2
2
|
import { n as s } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
|
|
3
|
-
const
|
|
3
|
+
const n = {
|
|
4
4
|
name: "NcAppSettingsSection",
|
|
5
|
+
inject: ["registerSection", "unregisterSection"],
|
|
5
6
|
props: {
|
|
6
7
|
name: {
|
|
7
8
|
type: String,
|
|
@@ -20,22 +21,40 @@ const i = {
|
|
|
20
21
|
htmlId() {
|
|
21
22
|
return "settings-section_" + this.id;
|
|
22
23
|
}
|
|
24
|
+
},
|
|
25
|
+
// Reactive changes for section navigation
|
|
26
|
+
watch: {
|
|
27
|
+
id(e, t) {
|
|
28
|
+
var i;
|
|
29
|
+
this.unregisterSection(t), this.registerSection(e, this.name, (i = this.$slots) == null ? void 0 : i.icon);
|
|
30
|
+
},
|
|
31
|
+
name(e) {
|
|
32
|
+
var t;
|
|
33
|
+
this.unregisterSection(this.id), this.registerSection(this.id, e, (t = this.$slots) == null ? void 0 : t.icon);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
mounted() {
|
|
37
|
+
var e;
|
|
38
|
+
this.registerSection(this.id, this.name, (e = this.$slots) == null ? void 0 : e.icon);
|
|
39
|
+
},
|
|
40
|
+
beforeDestroy() {
|
|
41
|
+
this.unregisterSection(this.id);
|
|
23
42
|
}
|
|
24
43
|
};
|
|
25
44
|
var r = function() {
|
|
26
|
-
var t = this,
|
|
27
|
-
return
|
|
28
|
-
},
|
|
29
|
-
|
|
45
|
+
var t = this, i = t._self._c;
|
|
46
|
+
return i("div", { staticClass: "app-settings-section", attrs: { id: t.htmlId } }, [i("h3", { staticClass: "app-settings-section__name" }, [t._v(" " + t._s(t.name) + " ")]), t._t("default"), t._e()], 2);
|
|
47
|
+
}, o = [], c = /* @__PURE__ */ s(
|
|
48
|
+
n,
|
|
30
49
|
r,
|
|
31
|
-
|
|
50
|
+
o,
|
|
32
51
|
!1,
|
|
33
52
|
null,
|
|
34
|
-
"
|
|
53
|
+
"5162e6df",
|
|
35
54
|
null,
|
|
36
55
|
null
|
|
37
56
|
);
|
|
38
|
-
const
|
|
57
|
+
const d = c.exports;
|
|
39
58
|
export {
|
|
40
|
-
|
|
59
|
+
d as default
|
|
41
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcAppSettingsSection.mjs","sources":["../../src/components/NcAppSettingsSection/NcAppSettingsSection.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<div :id=\"htmlId\" class=\"app-settings-section\">\n\t\t<h3 class=\"app-settings-section__name\">\n\t\t\t{{ name }}\n\t\t</h3>\n\t\t<slot />\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcAppSettingsSection',\n\n\tprops: {\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\tid: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tvalidator(id) {\n\t\t\t\t// Only alphanumeric, dash and underscore\n\t\t\t\treturn /^[a-z0-9\\-_]+$/.test(id)\n\t\t\t},\n\t\t},\n\t},\n\tcomputed: {\n\t\t// generate an id for each settingssection based on the name without whitespaces\n\t\thtmlId() {\n\t\t\treturn 'settings-section_' + this.id\n\t\t},\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n.app-settings-section {\n\tmargin-bottom: 80px;\n\t&__name {\n\t\tfont-size: 20px;\n\t\tmargin: 0;\n\t\tpadding: 20px 0;\n\t\tfont-weight: bold;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n</style>\n"],"names":["_sfc_main","id"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"NcAppSettingsSection.mjs","sources":["../../src/components/NcAppSettingsSection/NcAppSettingsSection.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<div :id=\"htmlId\" class=\"app-settings-section\">\n\t\t<h3 class=\"app-settings-section__name\">\n\t\t\t{{ name }}\n\t\t</h3>\n\t\t<slot />\n\t\t<!-- @slot Optonal icon to for the secion in the navigation -->\n\t\t<slot v-if=\"false\" name=\"icon\" />\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcAppSettingsSection',\n\tinject: ['registerSection', 'unregisterSection'],\n\n\tprops: {\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\tid: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tvalidator(id) {\n\t\t\t\t// Only alphanumeric, dash and underscore\n\t\t\t\treturn /^[a-z0-9\\-_]+$/.test(id)\n\t\t\t},\n\t\t},\n\t},\n\tcomputed: {\n\t\t// generate an id for each settingssection based on the name without whitespaces\n\t\thtmlId() {\n\t\t\treturn 'settings-section_' + this.id\n\t\t},\n\t},\n\t// Reactive changes for section navigation\n\twatch: {\n\t\tid(newId, oldId) {\n\t\t\tthis.unregisterSection(oldId)\n\t\t\tthis.registerSection(newId, this.name, this.$slots?.icon)\n\t\t},\n\t\tname(newName) {\n\t\t\tthis.unregisterSection(this.id)\n\t\t\tthis.registerSection(this.id, newName, this.$slots?.icon)\n\t\t},\n\t},\n\tmounted() {\n\t\t// register section for navigation\n\t\tthis.registerSection(this.id, this.name, this.$slots?.icon)\n\t},\n\tbeforeDestroy() {\n\t\tthis.unregisterSection(this.id)\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n.app-settings-section {\n\tmargin-bottom: 80px;\n\t&__name {\n\t\tfont-size: 20px;\n\t\tmargin: 0;\n\t\tpadding: 20px 0;\n\t\tfont-weight: bold;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n</style>\n"],"names":["_sfc_main","id","newId","oldId","_a","newName"],"mappings":";;AAkCA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA,CAAA,mBAAA,mBAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAAC,GAAA;AAEA,eAAA,iBAAA,KAAAA,CAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;AAAA;AAAA,IAEA,SAAA;AACA,aAAA,sBAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA;AAAA,EAEA,OAAA;AAAA,IACA,GAAAC,GAAAC,GAAA;;AACA,WAAA,kBAAAA,CAAA,GACA,KAAA,gBAAAD,GAAA,KAAA,OAAAE,IAAA,KAAA,WAAA,gBAAAA,EAAA,IAAA;AAAA,IACA;AAAA,IACA,KAAAC,GAAA;;AACA,WAAA,kBAAA,KAAA,EAAA,GACA,KAAA,gBAAA,KAAA,IAAAA,IAAAD,IAAA,KAAA,WAAA,gBAAAA,EAAA,IAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;;AAEA,SAAA,gBAAA,KAAA,IAAA,KAAA,OAAAA,IAAA,KAAA,WAAA,gBAAAA,EAAA,IAAA;AAAA,EACA;AAAA,EACA,gBAAA;AACA,SAAA,kBAAA,KAAA,EAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|