@nextcloud/vue 8.0.0-beta.8 → 8.0.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/CHANGELOG.md +64 -2
- package/dist/Components/NcActionButton.cjs +22 -11
- package/dist/Components/NcActionButton.cjs.map +1 -1
- package/dist/Components/NcActionButton.mjs +24 -12
- package/dist/Components/NcActionButton.mjs.map +1 -1
- package/dist/Components/NcActionInput.cjs +23 -18
- package/dist/Components/NcActionInput.cjs.map +1 -1
- package/dist/Components/NcActionInput.mjs +20 -14
- package/dist/Components/NcActionInput.mjs.map +1 -1
- package/dist/Components/NcActionLink.cjs +7 -7
- package/dist/Components/NcActionLink.cjs.map +1 -1
- package/dist/Components/NcActionLink.mjs +4 -4
- package/dist/Components/NcActionLink.mjs.map +1 -1
- package/dist/Components/NcActionRouter.cjs +8 -8
- package/dist/Components/NcActionRouter.cjs.map +1 -1
- package/dist/Components/NcActionRouter.mjs +4 -4
- package/dist/Components/NcActionRouter.mjs.map +1 -1
- package/dist/Components/NcActionText.cjs +10 -10
- package/dist/Components/NcActionText.cjs.map +1 -1
- package/dist/Components/NcActionText.mjs +11 -11
- package/dist/Components/NcActionText.mjs.map +1 -1
- package/dist/Components/NcActionTextEditable.cjs +10 -10
- package/dist/Components/NcActionTextEditable.cjs.map +1 -1
- package/dist/Components/NcActionTextEditable.mjs +2 -2
- package/dist/Components/NcActions.cjs +64 -57
- package/dist/Components/NcActions.cjs.map +1 -1
- package/dist/Components/NcActions.mjs +76 -69
- 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 +167 -63
- package/dist/Components/NcAppNavigationItem.cjs.map +1 -1
- package/dist/Components/NcAppNavigationItem.mjs +142 -40
- 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 +87 -117
- package/dist/Components/NcAppSettingsDialog.cjs.map +1 -1
- package/dist/Components/NcAppSettingsDialog.mjs +95 -124
- 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 +100 -34
- package/dist/Components/NcAppSidebar.cjs.map +1 -1
- package/dist/Components/NcAppSidebar.mjs +157 -93
- 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 +4 -4
- 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 +86 -54
- package/dist/Components/NcBreadcrumbs.cjs.map +1 -1
- package/dist/Components/NcBreadcrumbs.mjs +93 -62
- 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 +400 -54
- package/dist/Components/NcCheckboxRadioSwitch.cjs.map +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +398 -58
- 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/NcDashboardWidget.cjs +30 -30
- package/dist/Components/NcDashboardWidget.cjs.map +1 -1
- package/dist/Components/NcDashboardWidget.mjs +3 -3
- package/dist/Components/NcDashboardWidgetItem.cjs +11 -11
- package/dist/Components/NcDashboardWidgetItem.cjs.map +1 -1
- package/dist/Components/NcDashboardWidgetItem.mjs +9 -9
- package/dist/Components/NcDashboardWidgetItem.mjs.map +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/NcDialog.cjs +171 -0
- package/dist/Components/NcDialog.cjs.map +1 -0
- package/dist/Components/NcDialog.mjs +177 -0
- package/dist/Components/NcDialog.mjs.map +1 -0
- package/dist/Components/NcDialogButton.cjs +69 -0
- package/dist/Components/NcDialogButton.cjs.map +1 -0
- package/dist/Components/NcDialogButton.mjs +74 -0
- package/dist/Components/NcDialogButton.mjs.map +1 -0
- 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/NcIconSvgWrapper.cjs +29 -14
- package/dist/Components/NcIconSvgWrapper.cjs.map +1 -1
- package/dist/Components/NcIconSvgWrapper.mjs +32 -17
- package/dist/Components/NcIconSvgWrapper.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 +20 -12
- package/dist/Components/NcListItemIcon.cjs.map +1 -1
- package/dist/Components/NcListItemIcon.mjs +21 -13
- package/dist/Components/NcListItemIcon.mjs.map +1 -1
- package/dist/Components/NcModal.cjs +167 -72
- package/dist/Components/NcModal.cjs.map +1 -1
- package/dist/Components/NcModal.mjs +171 -79
- package/dist/Components/NcModal.mjs.map +1 -1
- package/dist/Components/NcNoteCard.cjs +147 -19
- package/dist/Components/NcNoteCard.cjs.map +1 -1
- package/dist/Components/NcNoteCard.mjs +148 -23
- package/dist/Components/NcNoteCard.mjs.map +1 -1
- package/dist/Components/NcPasswordField.cjs +114 -39
- package/dist/Components/NcPasswordField.cjs.map +1 -1
- package/dist/Components/NcPasswordField.mjs +125 -52
- package/dist/Components/NcPasswordField.mjs.map +1 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs +70 -37
- package/dist/Components/NcRelatedResourcesPanel.cjs.map +1 -1
- package/dist/Components/NcRelatedResourcesPanel.mjs +60 -27
- 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 +82 -54
- package/dist/Components/NcSelect.cjs.map +1 -1
- package/dist/Components/NcSelect.mjs +77 -47
- 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 +167 -0
- package/dist/Components/NcTextArea.cjs.map +1 -0
- package/dist/Components/NcTextArea.mjs +172 -0
- package/dist/Components/NcTextArea.mjs.map +1 -0
- package/dist/Components/NcTextField.cjs +79 -23
- package/dist/Components/NcTextField.cjs.map +1 -1
- package/dist/Components/NcTextField.mjs +82 -27
- package/dist/Components/NcTextField.mjs.map +1 -1
- package/dist/Components/NcTimezonePicker.cjs +26 -19
- package/dist/Components/NcTimezonePicker.cjs.map +1 -1
- package/dist/Components/NcTimezonePicker.mjs +31 -23
- 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-5072b6ee.css → index-05760fea.css} +16 -11
- package/dist/assets/{index-30e099f7.css → index-0ac09203.css} +3 -3
- package/dist/assets/{index-0ab8e182.css → index-0e9b11c7.css} +27 -22
- package/dist/assets/{index-1151d229.css → index-1f25a3c0.css} +3 -3
- package/dist/assets/{index-5eff69c7.css → index-2e5e3b55.css} +32 -30
- package/dist/assets/{index-03ec5f40.css → index-400b48a6.css} +7 -7
- package/dist/assets/{index-ed4adf1d.css → index-4271da53.css} +18 -17
- package/dist/assets/{index-33da80f0.css → index-4611417f.css} +8 -9
- package/dist/assets/{index-01e5adf4.css → index-55600948.css} +11 -11
- package/dist/assets/{index-c7905a53.css → index-57b305d3.css} +3 -3
- package/dist/assets/{index-de0326c7.css → index-5ee8a575.css} +69 -78
- package/dist/assets/index-6899d75b.css +150 -0
- package/dist/assets/{index-9354264c.css → index-6f721577.css} +16 -16
- package/dist/assets/{index-1beccc92.css → index-750c02cc.css} +28 -10
- package/dist/assets/{index-0557f12a.css → index-77a548be.css} +4 -4
- package/dist/assets/{index-fbdeb5ab.css → index-7d211db9.css} +11 -11
- package/dist/assets/{index-becfbea7.css → index-802d2118.css} +28 -23
- 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-6405cd50.css → index-ab715d82.css} +4 -4
- package/dist/assets/index-abb90c97.css +164 -0
- package/dist/assets/{index-23e64bbb.css → index-c221fe05.css} +9 -9
- package/dist/assets/{index-c6f0da2e.css → index-c239a2fc.css} +14 -8
- package/dist/assets/{index-fec4bb7b.css → index-d3702c91.css} +22 -17
- package/dist/assets/{index-194e9415.css → index-d5716ef0.css} +74 -59
- 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-1cf8eeb4.css → index-db5a8b1c.css} +26 -33
- package/dist/assets/index-dc612aa3.css +112 -0
- package/dist/assets/{index-294382c8.css → index-e1a7aa6f.css} +43 -38
- package/dist/assets/{index-376d2dec.css → index-e7c55791.css} +67 -67
- package/dist/assets/{index-165fce0e.css → index-e7eadba7.css} +13 -13
- package/dist/assets/{index-0adc989c.css → index-ebbb7829.css} +9 -13
- package/dist/assets/{referencePickerModal-0acecb5e.css → referencePickerModal-3a127978.css} +55 -55
- 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-364eb664.cjs +113 -0
- package/dist/chunks/NcAppNavigationToggle-364eb664.cjs.map +1 -0
- package/dist/chunks/NcAppNavigationToggle-cd2ef112.mjs +118 -0
- package/dist/chunks/NcAppNavigationToggle-cd2ef112.mjs.map +1 -0
- package/dist/chunks/{NcInputConfirmCancel-f881168d.mjs → NcInputConfirmCancel-304f0b74.mjs} +22 -15
- package/dist/chunks/NcInputConfirmCancel-304f0b74.mjs.map +1 -0
- package/dist/chunks/NcInputConfirmCancel-c873bb9b.cjs +90 -0
- package/dist/chunks/NcInputConfirmCancel-c873bb9b.cjs.map +1 -0
- package/dist/chunks/{NcRichText-1c3d2654.mjs → NcRichText-25edeb8e.mjs} +9 -9
- package/dist/chunks/{NcRichText-d385dc10.cjs.map → NcRichText-25edeb8e.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-d385dc10.cjs → NcRichText-dcb4fb97.cjs} +2 -2
- package/dist/chunks/{NcRichText-1c3d2654.mjs.map → NcRichText-dcb4fb97.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-47d9c113.cjs → NcSettingsSelectGroup-d639533d.cjs} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-47d9c113.cjs.map → NcSettingsSelectGroup-d639533d.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-0f4a0f94.mjs → NcSettingsSelectGroup-fd91d31a.mjs} +2 -2
- package/dist/chunks/{NcSettingsSelectGroup-0f4a0f94.mjs.map → NcSettingsSelectGroup-fd91d31a.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-97a014a1.mjs → ScopeComponent-5b9e60d8.mjs} +3 -3
- package/dist/chunks/{ScopeComponent-97a014a1.mjs.map → ScopeComponent-5b9e60d8.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-1c75ec38.cjs → ScopeComponent-dfa5ec75.cjs} +1 -1
- package/dist/chunks/{ScopeComponent-1c75ec38.cjs.map → ScopeComponent-dfa5ec75.cjs.map} +1 -1
- package/dist/chunks/{actionText-b0bd6eb7.cjs → actionText-54bc24a6.cjs} +1 -1
- package/dist/chunks/{actionText-9f5c55bd.mjs.map → actionText-54bc24a6.cjs.map} +1 -1
- package/dist/chunks/{actionText-9f5c55bd.mjs → actionText-a64be267.mjs} +1 -1
- package/dist/chunks/{actionText-b0bd6eb7.cjs.map → actionText-a64be267.mjs.map} +1 -1
- package/dist/chunks/{index-2a5b8ace.cjs → index-343ecbe5.cjs} +98 -55
- package/dist/chunks/index-343ecbe5.cjs.map +1 -0
- package/dist/chunks/{index-6c221fa0.mjs → index-a01ff595.mjs} +143 -100
- package/dist/chunks/index-a01ff595.mjs.map +1 -0
- package/dist/chunks/{l10n-4326316a.cjs → l10n-9321b50d.cjs} +1 -1
- package/dist/chunks/{l10n-4326316a.cjs.map → l10n-9321b50d.cjs.map} +1 -1
- package/dist/chunks/l10n-9f3afaf5.cjs +29 -0
- package/dist/chunks/l10n-9f3afaf5.cjs.map +1 -0
- package/dist/chunks/l10n-b6d21146.mjs +31 -0
- package/dist/chunks/l10n-b6d21146.mjs.map +1 -0
- package/dist/chunks/{l10n-c5f5f001.mjs → l10n-bef4ea85.mjs} +1 -1
- package/dist/chunks/{l10n-c5f5f001.mjs.map → l10n-bef4ea85.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-0fde503d.mjs → referencePickerModal-58498cac.mjs} +157 -125
- package/dist/chunks/referencePickerModal-58498cac.mjs.map +1 -0
- package/dist/chunks/{referencePickerModal-9b4ff88d.cjs → referencePickerModal-a739a17b.cjs} +145 -112
- package/dist/chunks/referencePickerModal-a739a17b.cjs.map +1 -0
- package/dist/index.cjs +105 -103
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +138 -133
- package/dist/index.mjs.map +1 -1
- package/dist/vendor.LICENSE.txt +5 -1
- package/package.json +8 -5
- package/dist/assets/index-7768d5e5.css +0 -148
- package/dist/assets/index-d646553d.css +0 -41
- package/dist/chunks/NcAppNavigationToggle-960658a0.cjs +0 -49
- package/dist/chunks/NcAppNavigationToggle-960658a0.cjs.map +0 -1
- package/dist/chunks/NcAppNavigationToggle-d868f651.mjs +0 -55
- package/dist/chunks/NcAppNavigationToggle-d868f651.mjs.map +0 -1
- package/dist/chunks/NcInputConfirmCancel-0c4bee9a.cjs +0 -83
- package/dist/chunks/NcInputConfirmCancel-0c4bee9a.cjs.map +0 -1
- package/dist/chunks/NcInputConfirmCancel-f881168d.mjs.map +0 -1
- package/dist/chunks/index-2a5b8ace.cjs.map +0 -1
- package/dist/chunks/index-6c221fa0.mjs.map +0 -1
- package/dist/chunks/l10n-27a75c40.mjs +0 -31
- package/dist/chunks/l10n-27a75c40.mjs.map +0 -1
- package/dist/chunks/l10n-903083c4.cjs +0 -29
- package/dist/chunks/l10n-903083c4.cjs.map +0 -1
- package/dist/chunks/referencePickerModal-0fde503d.mjs.map +0 -1
- package/dist/chunks/referencePickerModal-9b4ff88d.cjs.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 -\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<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<script>\nimport NcModal from '../NcModal/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\tNcModal,\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\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\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() {\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\n\t\thandleLinkKeydown(keyDownEvent, item) {\n\t\t\tif (keyDownEvent.code === 'Enter') {\n\t\t\t\tthis.handleSettingsNavigationClick(item)\n\t\t\t}\n\t\t},\n\t},\n\n\trender(h) {\n\t\t/**\n\t\t * Build the navigation\n\t\t *\n\t\t * @return {object} the navigation\n\t\t */\n\t\tconst createAppSettingsNavigation = () => {\n\t\t\tif (this.hasNavigation) {\n\t\t\t\treturn [h('div', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'app-settings__navigation',\n\t\t\t\t\t\trole: 'tablist',\n\t\t\t\t\t\t'aria-label': this.settingsNavigationAriaLabel,\n\t\t\t\t\t},\n\t\t\t\t}, [h('ul', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'navigation-list',\n\t\t\t\t\t\trole: 'tablist',\n\t\t\t\t\t},\n\t\t\t\t}, this.getSettingsNavigation(this.$slots.default).map(item => {\n\t\t\t\t\treturn createListElement(item)\n\t\t\t\t}))])]\n\t\t\t} else {\n\t\t\t\treturn []\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Build each list element in the navigation\n\t\t *\n\t\t * @param {object} item the navigation item\n\t\t * @return {object} the list element\n\t\t */\n\t\tconst createListElement = (item) => h('li', {}, [h('a', {\n\t\t\tclass: {\n\t\t\t\t'navigation-list__link': true,\n\t\t\t\t'navigation-list__link--active': item.id === this.selectedSection,\n\t\t\t},\n\n\t\t\tattrs: {\n\t\t\t\trole: 'tab',\n\t\t\t\t'aria-selected': item.id === this.selectedSection,\n\t\t\t\ttabindex: '0',\n\t\t\t},\n\n\t\t\ton: {\n\t\t\t\tclick: () => this.handleSettingsNavigationClick(item.id),\n\t\t\t\tkeydown: () => this.handleLinkKeydown(event, item.id),\n\t\t\t},\n\t\t}, item.name)])\n\n\t\t// Return value of the render function\n\t\tif (this.open) {\n\t\t\treturn h('NcModal', {\n\t\t\t\tclass: [\n\t\t\t\t\t'app-settings-modal',\n\t\t\t\t],\n\t\t\t\tattrs: {\n\t\t\t\t\tcontainer: this.container,\n\t\t\t\t\tsize: 'large',\n\t\t\t\t\tadditionalTrapElements: this.additionalTrapElements,\n\t\t\t\t},\n\t\t\t\ton: {\n\t\t\t\t\tclose: () => { this.handleCloseModal() },\n\t\t\t\t},\n\t\t\t}, [\n\t\t\t\t// main app-settings root element\n\t\t\t\th('div', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'app-settings',\n\t\t\t\t\t},\n\t\t\t\t}, [\n\t\t\t\t\t// app-settings name\n\t\t\t\t\th('h2', {\n\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\tclass: 'app-settings__name',\n\t\t\t\t\t\t},\n\t\t\t\t\t}, this.name),\n\n\t\t\t\t\t// app-settings navigation + content\n\t\t\t\t\th(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\t\tclass: 'app-settings__wrapper',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t...createAppSettingsNavigation(),\n\t\t\t\t\t\t\th('div', {\n\t\t\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\t\t\tclass: 'app-settings__content',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tref: 'settingsScroller',\n\t\t\t\t\t\t\t}, this.$slots.default),\n\t\t\t\t\t\t],\n\t\t\t\t\t),\n\t\t\t\t]),\n\t\t\t])\n\t\t} else {\n\t\t\treturn undefined\n\t\t}\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n\n.app-settings-modal :deep(.modal-wrapper .modal-container) {\n\tdisplay: flex;\n\toverflow: hidden;\n}\n\n.app-settings {\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-width: 0;\n\t&__name {\n\t\tmin-height: $clickable-area;\n\t\theight: $clickable-area;\n\t\tline-height: $clickable-area;\n\t\tpadding-top: 4px; // Same as the close button top spacing\n\t\ttext-align: center;\n\t}\n\t&__wrapper {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\toverflow: hidden;\n\t\theight: 100%;\n\t\tposition: relative;\n\t}\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\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_NcModal","Mixins_isMobile","l10n","slots","navigationItems","vNode","_a","_b","navigationNames","item","navigationIds","element","index","newNamesArray","newIdArray","debounce__default","keyDownEvent","h","createAppSettingsNavigation","createListElement"],"mappings":";;AAoFA,MAAAA,IAAA;AAAA,EAEA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,SAAAC;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,M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AAA,YACA;AAAA,YACA;AAAA,cACA,OAAA;AAAA,gBACA,OAAA;AAAA,cACA;AAAA,YACA;AAAA,YACA;AAAA,cACA,GAAAC,EAAA;AAAA,cACAD,EAAA,OAAA;AAAA,gBACA,OAAA;AAAA,kBACA,OAAA;AAAA,gBACA;AAAA,gBACA,KAAA;AAAA,cACA,GAAA,KAAA,OAAA,OAAA;AAAA,YACA;AAAA,UACA;AAAA,QACA,CAAA;AAAA,MACA,CAAA;AAAA,EAIA;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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-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-b6d21146.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
|
-
|
|
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,15 +61,37 @@ 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: {
|
|
73
|
+
dialogProperties() {
|
|
74
|
+
return {
|
|
75
|
+
additionalTrapElements: this.additionalTrapElements,
|
|
76
|
+
class: "app-settings",
|
|
77
|
+
container: this.container,
|
|
78
|
+
contentClasses: "app-settings__content",
|
|
79
|
+
size: "large",
|
|
80
|
+
name: this.name,
|
|
81
|
+
navigationClasses: "app-settings__navigation"
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Check if one or more navigation entries provide icons
|
|
86
|
+
*/
|
|
87
|
+
hasNavigationIcons() {
|
|
88
|
+
return this.sections.some(({ icon: i }) => !!i);
|
|
89
|
+
},
|
|
60
90
|
hasNavigation() {
|
|
61
91
|
return !(this.isMobile || !this.showNavigation);
|
|
62
92
|
},
|
|
63
93
|
settingsNavigationAriaLabel() {
|
|
64
|
-
return
|
|
94
|
+
return h("Settings navigation");
|
|
65
95
|
}
|
|
66
96
|
},
|
|
67
97
|
mounted() {
|
|
@@ -72,142 +102,83 @@ const g = {
|
|
|
72
102
|
},
|
|
73
103
|
methods: {
|
|
74
104
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* @param {
|
|
78
|
-
* @
|
|
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
|
|
79
109
|
*/
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
|
127
|
+
*/
|
|
128
|
+
unregisterSection(i) {
|
|
129
|
+
this.sections = this.sections.filter(({ id: e }) => i === e);
|
|
95
130
|
},
|
|
96
131
|
/**
|
|
97
132
|
* Scrolls the content to the selected settings section.absolute
|
|
98
133
|
*
|
|
99
134
|
* @param {string} item the ID of the section
|
|
100
135
|
*/
|
|
101
|
-
handleSettingsNavigationClick(
|
|
102
|
-
this.linkClicked = !0, document.getElementById("settings-section_" +
|
|
136
|
+
handleSettingsNavigationClick(i) {
|
|
137
|
+
this.linkClicked = !0, document.getElementById("settings-section_" + i).scrollIntoView({
|
|
103
138
|
behavior: "smooth",
|
|
104
139
|
inline: "nearest"
|
|
105
|
-
}), this.selectedSection =
|
|
140
|
+
}), this.selectedSection = i, setTimeout(() => {
|
|
106
141
|
this.linkClicked = !1;
|
|
107
142
|
}, 1e3);
|
|
108
143
|
},
|
|
109
|
-
handleCloseModal() {
|
|
110
|
-
this.$emit("update:open", !1), this.scroller.removeEventListener("scroll", this.handleScroll), this.addedScrollListener = !1, this.scroller.scrollTop = 0;
|
|
144
|
+
handleCloseModal(i) {
|
|
145
|
+
i || (this.$emit("update:open", !1), this.scroller.removeEventListener("scroll", this.handleScroll), this.addedScrollListener = !1, this.scroller.scrollTop = 0);
|
|
111
146
|
},
|
|
112
147
|
handleScroll() {
|
|
113
148
|
this.linkClicked || this.unfocusNavigationItem();
|
|
114
149
|
},
|
|
115
150
|
// Remove selected section once the user starts scrolling
|
|
116
|
-
unfocusNavigationItem:
|
|
151
|
+
unfocusNavigationItem: f(function() {
|
|
117
152
|
this.selectedSection = "", document.activeElement.className.includes("navigation-list__link") && document.activeElement.blur();
|
|
118
|
-
}, 300)
|
|
119
|
-
handleLinkKeydown(t, n) {
|
|
120
|
-
t.code === "Enter" && this.handleSettingsNavigationClick(n);
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
render(t) {
|
|
124
|
-
const n = () => this.hasNavigation ? [t("div", {
|
|
125
|
-
attrs: {
|
|
126
|
-
class: "app-settings__navigation",
|
|
127
|
-
role: "tablist",
|
|
128
|
-
"aria-label": this.settingsNavigationAriaLabel
|
|
129
|
-
}
|
|
130
|
-
}, [t("ul", {
|
|
131
|
-
attrs: {
|
|
132
|
-
class: "navigation-list",
|
|
133
|
-
role: "tablist"
|
|
134
|
-
}
|
|
135
|
-
}, this.getSettingsNavigation(this.$slots.default).map((i) => o(i)))])] : [], o = (i) => t("li", {}, [t("a", {
|
|
136
|
-
class: {
|
|
137
|
-
"navigation-list__link": !0,
|
|
138
|
-
"navigation-list__link--active": i.id === this.selectedSection
|
|
139
|
-
},
|
|
140
|
-
attrs: {
|
|
141
|
-
role: "tab",
|
|
142
|
-
"aria-selected": i.id === this.selectedSection,
|
|
143
|
-
tabindex: "0"
|
|
144
|
-
},
|
|
145
|
-
on: {
|
|
146
|
-
click: () => this.handleSettingsNavigationClick(i.id),
|
|
147
|
-
keydown: () => this.handleLinkKeydown(event, i.id)
|
|
148
|
-
}
|
|
149
|
-
}, i.name)]);
|
|
150
|
-
if (this.open)
|
|
151
|
-
return t("NcModal", {
|
|
152
|
-
class: [
|
|
153
|
-
"app-settings-modal"
|
|
154
|
-
],
|
|
155
|
-
attrs: {
|
|
156
|
-
container: this.container,
|
|
157
|
-
size: "large",
|
|
158
|
-
additionalTrapElements: this.additionalTrapElements
|
|
159
|
-
},
|
|
160
|
-
on: {
|
|
161
|
-
close: () => {
|
|
162
|
-
this.handleCloseModal();
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}, [
|
|
166
|
-
// main app-settings root element
|
|
167
|
-
t("div", {
|
|
168
|
-
attrs: {
|
|
169
|
-
class: "app-settings"
|
|
170
|
-
}
|
|
171
|
-
}, [
|
|
172
|
-
// app-settings name
|
|
173
|
-
t("h2", {
|
|
174
|
-
attrs: {
|
|
175
|
-
class: "app-settings__name"
|
|
176
|
-
}
|
|
177
|
-
}, this.name),
|
|
178
|
-
// app-settings navigation + content
|
|
179
|
-
t(
|
|
180
|
-
"div",
|
|
181
|
-
{
|
|
182
|
-
attrs: {
|
|
183
|
-
class: "app-settings__wrapper"
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
[
|
|
187
|
-
...n(),
|
|
188
|
-
t("div", {
|
|
189
|
-
attrs: {
|
|
190
|
-
class: "app-settings__content"
|
|
191
|
-
},
|
|
192
|
-
ref: "settingsScroller"
|
|
193
|
-
}, this.$slots.default)
|
|
194
|
-
]
|
|
195
|
-
)
|
|
196
|
-
])
|
|
197
|
-
]);
|
|
153
|
+
}, 300)
|
|
198
154
|
}
|
|
199
|
-
}
|
|
200
|
-
var
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
155
|
+
};
|
|
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: {
|
|
161
|
+
"navigation-list__link": !0,
|
|
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) {
|
|
165
|
+
return e.handleSettingsNavigationClick(t.id);
|
|
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) + " ")])])]);
|
|
169
|
+
}), 0)];
|
|
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,
|
|
204
175
|
!1,
|
|
205
176
|
null,
|
|
206
|
-
"
|
|
177
|
+
"b5b2caa2",
|
|
207
178
|
null,
|
|
208
179
|
null
|
|
209
180
|
);
|
|
210
|
-
const
|
|
181
|
+
const x = k.exports;
|
|
211
182
|
export {
|
|
212
|
-
|
|
183
|
+
x as default
|
|
213
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 -\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<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<script>\nimport NcModal from '../NcModal/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\tNcModal,\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\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\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() {\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\n\t\thandleLinkKeydown(keyDownEvent, item) {\n\t\t\tif (keyDownEvent.code === 'Enter') {\n\t\t\t\tthis.handleSettingsNavigationClick(item)\n\t\t\t}\n\t\t},\n\t},\n\n\trender(h) {\n\t\t/**\n\t\t * Build the navigation\n\t\t *\n\t\t * @return {object} the navigation\n\t\t */\n\t\tconst createAppSettingsNavigation = () => {\n\t\t\tif (this.hasNavigation) {\n\t\t\t\treturn [h('div', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'app-settings__navigation',\n\t\t\t\t\t\trole: 'tablist',\n\t\t\t\t\t\t'aria-label': this.settingsNavigationAriaLabel,\n\t\t\t\t\t},\n\t\t\t\t}, [h('ul', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'navigation-list',\n\t\t\t\t\t\trole: 'tablist',\n\t\t\t\t\t},\n\t\t\t\t}, this.getSettingsNavigation(this.$slots.default).map(item => {\n\t\t\t\t\treturn createListElement(item)\n\t\t\t\t}))])]\n\t\t\t} else {\n\t\t\t\treturn []\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Build each list element in the navigation\n\t\t *\n\t\t * @param {object} item the navigation item\n\t\t * @return {object} the list element\n\t\t */\n\t\tconst createListElement = (item) => h('li', {}, [h('a', {\n\t\t\tclass: {\n\t\t\t\t'navigation-list__link': true,\n\t\t\t\t'navigation-list__link--active': item.id === this.selectedSection,\n\t\t\t},\n\n\t\t\tattrs: {\n\t\t\t\trole: 'tab',\n\t\t\t\t'aria-selected': item.id === this.selectedSection,\n\t\t\t\ttabindex: '0',\n\t\t\t},\n\n\t\t\ton: {\n\t\t\t\tclick: () => this.handleSettingsNavigationClick(item.id),\n\t\t\t\tkeydown: () => this.handleLinkKeydown(event, item.id),\n\t\t\t},\n\t\t}, item.name)])\n\n\t\t// Return value of the render function\n\t\tif (this.open) {\n\t\t\treturn h('NcModal', {\n\t\t\t\tclass: [\n\t\t\t\t\t'app-settings-modal',\n\t\t\t\t],\n\t\t\t\tattrs: {\n\t\t\t\t\tcontainer: this.container,\n\t\t\t\t\tsize: 'large',\n\t\t\t\t\tadditionalTrapElements: this.additionalTrapElements,\n\t\t\t\t},\n\t\t\t\ton: {\n\t\t\t\t\tclose: () => { this.handleCloseModal() },\n\t\t\t\t},\n\t\t\t}, [\n\t\t\t\t// main app-settings root element\n\t\t\t\th('div', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'app-settings',\n\t\t\t\t\t},\n\t\t\t\t}, [\n\t\t\t\t\t// app-settings name\n\t\t\t\t\th('h2', {\n\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\tclass: 'app-settings__name',\n\t\t\t\t\t\t},\n\t\t\t\t\t}, this.name),\n\n\t\t\t\t\t// app-settings navigation + content\n\t\t\t\t\th(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\t\tclass: 'app-settings__wrapper',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t...createAppSettingsNavigation(),\n\t\t\t\t\t\t\th('div', {\n\t\t\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\t\t\tclass: 'app-settings__content',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tref: 'settingsScroller',\n\t\t\t\t\t\t\t}, this.$slots.default),\n\t\t\t\t\t\t],\n\t\t\t\t\t),\n\t\t\t\t]),\n\t\t\t])\n\t\t} else {\n\t\t\treturn undefined\n\t\t}\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n\n.app-settings-modal :deep(.modal-wrapper .modal-container) {\n\tdisplay: flex;\n\toverflow: hidden;\n}\n\n.app-settings {\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-width: 0;\n\t&__name {\n\t\tmin-height: $clickable-area;\n\t\theight: $clickable-area;\n\t\tline-height: $clickable-area;\n\t\tpadding-top: 4px; // Same as the close button top spacing\n\t\ttext-align: center;\n\t}\n\t&__wrapper {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\toverflow: hidden;\n\t\theight: 100%;\n\t\tposition: relative;\n\t}\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\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","NcModal","isMobile","t","slots","navigationItems","vNode","_a","_b","navigationNames","item","navigationIds","element","index","newNamesArray","newIdArray","debounce","keyDownEvent","h","createAppSettingsNavigation","createListElement"],"mappings":";;;;;;AAoFA,MAAAA,IAAA;AAAA,EAEA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,SAAAC;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;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,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IAEA,gBAAA;AACA,aAAA,OAAA,YAAA,CAAA,KAAA;AAAA,IAKA;AAAA,IAEA,8BAAA;AACA,aAAAC,EAAA,qBAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAEA,SAAA,kBAAA,KAAA,OAAA,QAAA,CAAA,EAAA,iBAAA,UAAA;AAAA,EACA;AAAA,EAE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AAA,IAAA,CAAA,CAAA;AAGA,QAAA,KAAA;AACA,aAAAQ,EAAA,WAAA;AAAA,QACA,OAAA;AAAA,UACA;AAAA,QACA;AAAA,QACA,OAAA;AAAA,UACA,WAAA,KAAA;AAAA,UACA,MAAA;AAAA,UACA,wBAAA,KAAA;AAAA,QACA;AAAA,QACA,IAAA;AAAA,UACA,OAAA,MAAA;AAAA,iBAAA,iBAAA;AAAA,UAAA;AAAA,QACA;AAAA,MACA,GAAA;AAAA;AAAA,QAEAA,EAAA,OAAA;AAAA,UACA,OAAA;AAAA,YACA,OAAA;AAAA,UACA;AAAA,QACA,GAAA;AAAA;AAAA,UAEAA,EAAA,MAAA;AAAA,YACA,OAAA;AAAA,cACA,OAAA;AAAA,YACA;AAAA,UACA,GAAA,KAAA,IAAA;AAAA;AAAA,UAGAA;AAAA,YACA;AAAA,YACA;AAAA,cACA,OAAA;AAAA,gBACA,OAAA;AAAA,cACA;AAAA,YACA;AAAA,YACA;AAAA,cACA,GAAAC,EAAA;AAAA,cACAD,EAAA,OAAA;AAAA,gBACA,OAAA;AAAA,kBACA,OAAA;AAAA,gBACA;AAAA,gBACA,KAAA;AAAA,cACA,GAAA,KAAA,OAAA,OAAA;AAAA,YACA;AAAA,UACA;AAAA,QACA,CAAA;AAAA,MACA,CAAA;AAAA,EAIA;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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AA,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;;;;;;;;;;;;;;;"}
|