@nextcloud/vue 3.10.2 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +114 -19
- package/README.md +9 -10
- package/dist/Components/ActionButton.js +24 -3
- package/dist/Components/ActionButton.js.map +1 -1
- package/dist/Components/ActionCaption.js +23 -0
- package/dist/Components/ActionCaption.js.map +1 -0
- package/dist/Components/ActionCheckbox.js +24 -3
- package/dist/Components/ActionCheckbox.js.map +1 -1
- package/dist/Components/ActionInput.js +124 -21
- package/dist/Components/ActionInput.js.map +1 -1
- package/dist/Components/ActionLink.js +24 -3
- package/dist/Components/ActionLink.js.map +1 -1
- package/dist/Components/ActionRadio.js +24 -3
- package/dist/Components/ActionRadio.js.map +1 -1
- package/dist/Components/ActionRouter.js +23 -2
- package/dist/Components/ActionRouter.js.map +1 -1
- package/dist/Components/ActionSeparator.js +1 -1
- package/dist/Components/ActionSeparator.js.map +1 -1
- package/dist/Components/ActionText.js +23 -2
- package/dist/Components/ActionText.js.map +1 -1
- package/dist/Components/ActionTextEditable.js +45 -3
- package/dist/Components/ActionTextEditable.js.map +1 -1
- package/dist/Components/Actions.js +25 -4
- package/dist/Components/Actions.js.map +1 -1
- package/dist/Components/AppContent.js +21 -1
- package/dist/Components/AppContent.js.map +1 -1
- package/dist/Components/AppContentDetails.js +1 -1
- package/dist/Components/AppContentDetails.js.map +1 -1
- package/dist/Components/AppContentList.js +1 -1
- package/dist/Components/AppContentList.js.map +1 -1
- package/dist/Components/AppNavigation.js +109 -2
- package/dist/Components/AppNavigation.js.map +1 -1
- package/dist/Components/AppNavigationCaption.js +66 -1
- package/dist/Components/AppNavigationCaption.js.map +1 -1
- package/dist/Components/AppNavigationCounter.js +2 -2
- package/dist/Components/AppNavigationCounter.js.map +1 -1
- package/dist/Components/AppNavigationIconBullet.js +2 -2
- package/dist/Components/AppNavigationIconBullet.js.map +1 -1
- package/dist/Components/AppNavigationItem.js +49 -7
- package/dist/Components/AppNavigationItem.js.map +1 -1
- package/dist/Components/AppNavigationNew.js +1 -1
- package/dist/Components/AppNavigationNew.js.map +1 -1
- package/dist/Components/AppNavigationNewItem.js +2 -2
- package/dist/Components/AppNavigationNewItem.js.map +1 -1
- package/dist/Components/AppNavigationSettings.js +5 -5
- package/dist/Components/AppNavigationSettings.js.map +1 -1
- package/dist/Components/AppNavigationSpacer.js +1 -1
- package/dist/Components/AppNavigationSpacer.js.map +1 -1
- package/dist/Components/AppNavigationToggle.js +109 -2
- package/dist/Components/AppNavigationToggle.js.map +1 -1
- package/dist/Components/AppSettingsDialog.js +64 -22
- package/dist/Components/AppSettingsDialog.js.map +1 -1
- package/dist/Components/AppSettingsSection.js +1 -1
- package/dist/Components/AppSettingsSection.js.map +1 -1
- package/dist/Components/AppSidebar.js +38 -17
- package/dist/Components/AppSidebar.js.map +1 -1
- package/dist/Components/AppSidebarTab.js +1 -1
- package/dist/Components/AppSidebarTab.js.map +1 -1
- package/dist/Components/Avatar.js +9 -10
- package/dist/Components/Avatar.js.map +1 -1
- package/dist/Components/Breadcrumb.js +33 -12
- package/dist/Components/Breadcrumb.js.map +1 -1
- package/dist/Components/Breadcrumbs.js +59 -17
- package/dist/Components/Breadcrumbs.js.map +1 -1
- package/dist/Components/CheckboxRadioSwitch.js +44 -0
- package/dist/Components/CheckboxRadioSwitch.js.map +1 -0
- package/dist/Components/ColorPicker.js +6 -7
- package/dist/Components/ColorPicker.js.map +1 -1
- package/dist/Components/Content.js +2 -2
- package/dist/Components/Content.js.map +1 -1
- package/dist/Components/CounterBubble.js +23 -0
- package/dist/Components/CounterBubble.js.map +1 -0
- package/dist/Components/DatetimePicker.js +341 -3
- package/dist/Components/DatetimePicker.js.map +1 -1
- package/dist/Components/EmojiPicker.js +14 -14
- package/dist/Components/EmojiPicker.js.map +1 -1
- package/dist/Components/EmptyContent.js +2 -2
- package/dist/Components/EmptyContent.js.map +1 -1
- package/dist/Components/Highlight.js +3 -3
- package/dist/Components/Highlight.js.map +1 -1
- package/dist/Components/ListItem.js +130 -0
- package/dist/Components/ListItem.js.map +1 -0
- package/dist/Components/ListItemIcon.js +20 -21
- package/dist/Components/ListItemIcon.js.map +1 -1
- package/dist/Components/Modal.js +53 -11
- package/dist/Components/Modal.js.map +1 -1
- package/dist/Components/Multiselect.js +22 -23
- package/dist/Components/Multiselect.js.map +1 -1
- package/dist/Components/MultiselectTags.js +24 -25
- package/dist/Components/MultiselectTags.js.map +1 -1
- package/dist/Components/Popover.js +2 -2
- package/dist/Components/Popover.js.map +1 -1
- package/dist/Components/PopoverMenu.js +1 -1
- package/dist/Components/PopoverMenu.js.map +1 -1
- package/dist/Components/ProgressBar.js +2 -2
- package/dist/Components/ProgressBar.js.map +1 -1
- package/dist/Components/RichContenteditable.js +2 -2
- package/dist/Components/RichContenteditable.js.map +1 -1
- package/dist/Components/SettingsInputText.js +22 -1
- package/dist/Components/SettingsInputText.js.map +1 -1
- package/dist/Components/SettingsSection.js +2 -2
- package/dist/Components/SettingsSection.js.map +1 -1
- package/dist/Components/SettingsSelectGroup.js +41 -21
- package/dist/Components/SettingsSelectGroup.js.map +1 -1
- package/dist/Components/TimezonePicker.js +340 -0
- package/dist/Components/TimezonePicker.js.map +1 -0
- package/dist/Components/UserBubble.js +35 -36
- package/dist/Components/UserBubble.js.map +1 -1
- package/dist/Directives/Focus.js +1 -1
- package/dist/Directives/Focus.js.map +1 -1
- package/dist/Directives/Linkify.js +1 -1
- package/dist/Directives/Linkify.js.map +1 -1
- package/dist/Directives/Tooltip.js +2 -2
- package/dist/Directives/Tooltip.js.map +1 -1
- package/dist/Functions/usernameToColor.js +2 -3
- package/dist/Functions/usernameToColor.js.map +1 -1
- package/dist/Mixins/excludeClickOutsideClasses.js +2 -2
- package/dist/Mixins/excludeClickOutsideClasses.js.map +1 -1
- package/dist/Mixins/isFullscreen.js +1 -1
- package/dist/Mixins/isFullscreen.js.map +1 -1
- package/dist/Mixins/isMobile.js +1 -1
- package/dist/Mixins/isMobile.js.map +1 -1
- package/dist/Mixins/richEditor.js +1 -1
- package/dist/Mixins/richEditor.js.map +1 -1
- package/dist/ncvuecomponents.js +276 -69
- package/dist/ncvuecomponents.js.map +1 -1
- package/package.json +28 -43
- package/src/assets/action.scss +0 -132
- package/src/assets/iconfont/README.md +0 -30
- package/src/assets/iconfont/arrow-left-double.svg +0 -3
- package/src/assets/iconfont/arrow-left.svg +0 -3
- package/src/assets/iconfont/arrow-right-double.svg +0 -3
- package/src/assets/iconfont/arrow-right.svg +0 -3
- package/src/assets/iconfont/breadcrumb.svg +0 -1
- package/src/assets/iconfont/checkmark.svg +0 -1
- package/src/assets/iconfont/close.svg +0 -1
- package/src/assets/iconfont/confirm.svg +0 -1
- package/src/assets/iconfont/info.svg +0 -1
- package/src/assets/iconfont/menu.svg +0 -1
- package/src/assets/iconfont/more.svg +0 -1
- package/src/assets/iconfont/pause.svg +0 -1
- package/src/assets/iconfont/play.svg +0 -1
- package/src/assets/iconfont/triangle-s.svg +0 -1
- package/src/assets/iconfont/user-status-away.svg +0 -2
- package/src/assets/iconfont/user-status-dnd.svg +0 -2
- package/src/assets/iconfont/user-status-invisible.svg +0 -2
- package/src/assets/iconfont/user-status-online.svg +0 -2
- package/src/assets/inputs.scss +0 -104
- package/src/assets/variables.scss +0 -57
- package/src/components/ActionButton/ActionButton.vue +0 -160
- package/src/components/ActionButton/index.js +0 -24
- package/src/components/ActionCheckbox/ActionCheckbox.vue +0 -220
- package/src/components/ActionCheckbox/index.js +0 -24
- package/src/components/ActionInput/ActionInput.vue +0 -418
- package/src/components/ActionInput/index.js +0 -24
- package/src/components/ActionLink/ActionLink.vue +0 -132
- package/src/components/ActionLink/index.js +0 -24
- package/src/components/ActionRadio/ActionRadio.vue +0 -219
- package/src/components/ActionRadio/index.js +0 -24
- package/src/components/ActionRouter/ActionRouter.vue +0 -100
- package/src/components/ActionRouter/index.js +0 -24
- package/src/components/ActionSeparator/ActionSeparator.vue +0 -43
- package/src/components/ActionSeparator/index.js +0 -24
- package/src/components/ActionText/ActionText.vue +0 -87
- package/src/components/ActionText/index.js +0 -24
- package/src/components/ActionTextEditable/ActionTextEditable.vue +0 -306
- package/src/components/ActionTextEditable/index.js +0 -24
- package/src/components/Actions/Actions.vue +0 -764
- package/src/components/Actions/index.js +0 -24
- package/src/components/AppContent/AppContent.vue +0 -93
- package/src/components/AppContent/index.js +0 -23
- package/src/components/AppContentDetails/AppContentDetails.vue +0 -34
- package/src/components/AppContentDetails/index.js +0 -23
- package/src/components/AppContentList/AppContentList.vue +0 -44
- package/src/components/AppContentList/index.js +0 -23
- package/src/components/AppNavigation/AppNavigation.vue +0 -190
- package/src/components/AppNavigation/index.js +0 -23
- package/src/components/AppNavigationCaption/AppNavigationCaption.vue +0 -39
- package/src/components/AppNavigationCaption/index.js +0 -3
- package/src/components/AppNavigationCounter/AppNavigationCounter.vue +0 -82
- package/src/components/AppNavigationCounter/index.js +0 -25
- package/src/components/AppNavigationIconBullet/AppNavigationIconBullet.vue +0 -95
- package/src/components/AppNavigationIconBullet/index.js +0 -24
- package/src/components/AppNavigationItem/AppNavigationIconCollapsible.vue +0 -90
- package/src/components/AppNavigationItem/AppNavigationItem.vue +0 -629
- package/src/components/AppNavigationItem/InputConfirmCancel.vue +0 -134
- package/src/components/AppNavigationItem/index.js +0 -24
- package/src/components/AppNavigationNew/AppNavigationNew.vue +0 -76
- package/src/components/AppNavigationNew/index.js +0 -23
- package/src/components/AppNavigationNewItem/AppNavigationNewItem.vue +0 -165
- package/src/components/AppNavigationNewItem/index.js +0 -24
- package/src/components/AppNavigationSettings/AppNavigationSettings.vue +0 -105
- package/src/components/AppNavigationSettings/index.js +0 -23
- package/src/components/AppNavigationSpacer/AppNavigationSpacer.vue +0 -39
- package/src/components/AppNavigationSpacer/index.js +0 -23
- package/src/components/AppNavigationToggle/AppNavigationToggle.vue +0 -78
- package/src/components/AppNavigationToggle/index.js +0 -24
- package/src/components/AppSettingsDialog/AppSettingsDialog.vue +0 -331
- package/src/components/AppSettingsDialog/index.js +0 -25
- package/src/components/AppSettingsSection/AppSettingsSection.vue +0 -64
- package/src/components/AppSettingsSection/index.js +0 -25
- package/src/components/AppSidebar/AppSidebar.vue +0 -802
- package/src/components/AppSidebar/AppSidebarTabs.vue +0 -348
- package/src/components/AppSidebar/index.js +0 -23
- package/src/components/AppSidebarTab/AppSidebarTab.vue +0 -103
- package/src/components/AppSidebarTab/index.js +0 -23
- package/src/components/Avatar/Avatar.vue +0 -758
- package/src/components/Avatar/index.js +0 -25
- package/src/components/Breadcrumb/Breadcrumb.vue +0 -262
- package/src/components/Breadcrumb/index.js +0 -25
- package/src/components/Breadcrumbs/Breadcrumbs.vue +0 -537
- package/src/components/Breadcrumbs/index.js +0 -25
- package/src/components/ColorPicker/ColorPicker.vue +0 -380
- package/src/components/ColorPicker/index.js +0 -25
- package/src/components/Content/Content.vue +0 -77
- package/src/components/Content/index.js +0 -23
- package/src/components/DatetimePicker/DatetimePicker.vue +0 -195
- package/src/components/DatetimePicker/index.js +0 -28
- package/src/components/DatetimePicker/index.scss +0 -405
- package/src/components/EmojiPicker/EmojiPicker.vue +0 -302
- package/src/components/EmojiPicker/index.js +0 -23
- package/src/components/EmptyContent/EmptyContent.vue +0 -120
- package/src/components/EmptyContent/index.js +0 -24
- package/src/components/Highlight/Highlight.vue +0 -183
- package/src/components/Highlight/index.js +0 -25
- package/src/components/ListItemIcon/ListItemIcon.vue +0 -277
- package/src/components/ListItemIcon/index.js +0 -25
- package/src/components/Modal/Modal.vue +0 -833
- package/src/components/Modal/index.js +0 -27
- package/src/components/Multiselect/EllipsisedOption.vue +0 -141
- package/src/components/Multiselect/Multiselect.vue +0 -430
- package/src/components/Multiselect/index.js +0 -28
- package/src/components/Multiselect/index.scss +0 -290
- package/src/components/MultiselectTags/MultiselectTags.vue +0 -179
- package/src/components/MultiselectTags/api.js +0 -115
- package/src/components/MultiselectTags/index.js +0 -23
- package/src/components/Popover/Popover.vue +0 -208
- package/src/components/Popover/index.js +0 -25
- package/src/components/PopoverMenu/PopoverMenu.vue +0 -62
- package/src/components/PopoverMenu/PopoverMenuItem.vue +0 -382
- package/src/components/PopoverMenu/index.js +0 -24
- package/src/components/ProgressBar/ProgressBar.vue +0 -135
- package/src/components/ProgressBar/index.js +0 -25
- package/src/components/RichContenteditable/AutoCompleteResult.vue +0 -191
- package/src/components/RichContenteditable/MentionBubble.vue +0 -165
- package/src/components/RichContenteditable/RichContenteditable.vue +0 -517
- package/src/components/RichContenteditable/index.js +0 -25
- package/src/components/SettingsInputText/SettingsInputText.vue +0 -207
- package/src/components/SettingsInputText/index.js +0 -24
- package/src/components/SettingsSection/SettingsSection.vue +0 -151
- package/src/components/SettingsSection/index.js +0 -24
- package/src/components/SettingsSelectGroup/SettingsSelectGroup.vue +0 -149
- package/src/components/SettingsSelectGroup/index.js +0 -25
- package/src/components/UserBubble/UserBubble.vue +0 -319
- package/src/components/UserBubble/index.js +0 -25
- package/src/components/index.js +0 -110
- package/src/directives/Focus/index.js +0 -29
- package/src/directives/Linkify/index.js +0 -31
- package/src/directives/Tooltip/index.js +0 -32
- package/src/directives/Tooltip/index.scss +0 -117
- package/src/directives/index.js +0 -31
- package/src/fonts/iconfont-vue-f56d517.eot +0 -0
- package/src/fonts/iconfont-vue-f56d517.svg +0 -1
- package/src/fonts/iconfont-vue-f56d517.ttf +0 -0
- package/src/fonts/iconfont-vue-f56d517.woff +0 -0
- package/src/fonts/scss/iconfont-vue.scss +0 -115
- package/src/functions/usernameToColor/index.js +0 -25
- package/src/functions/usernameToColor/usernameToColor.js +0 -68
- package/src/index.js +0 -40
- package/src/l10n.js +0 -42
- package/src/mixins/actionGlobal.js +0 -59
- package/src/mixins/actionText.js +0 -85
- package/src/mixins/excludeClickOutsideClasses/index.js +0 -72
- package/src/mixins/index.js +0 -35
- package/src/mixins/isFullscreen/index.js +0 -46
- package/src/mixins/isMobile/index.js +0 -43
- package/src/mixins/l10n.js +0 -8
- package/src/mixins/richEditor/index.js +0 -160
- package/src/mixins/userStatus.js +0 -76
- package/src/utils/FindRanges.js +0 -47
- package/src/utils/GenColors.js +0 -79
- package/src/utils/GenRandomId.js +0 -31
- package/src/utils/GetChildren.js +0 -47
- package/src/utils/GetParent.js +0 -41
- package/src/utils/IsMobileState.js +0 -49
- package/src/utils/IsOutOfViewport.js +0 -36
- package/src/utils/ScopeComponent.js +0 -37
- package/src/utils/Timer.js +0 -61
- package/src/utils/ValidateChildren.js +0 -50
- package/src/utils/ValidateSlot.js +0 -57
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
- @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
- @copyright Copyright (c) 2020 Simon Belbeoch <simon.belbeoch@gmail.com>
|
|
4
|
-
-
|
|
5
|
-
- @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
6
|
-
-
|
|
7
|
-
- @license GNU AGPL version 3 or any later version
|
|
8
|
-
-
|
|
9
|
-
- This program is free software: you can redistribute it and/or modify
|
|
10
|
-
- it under the terms of the GNU Affero General Public License as
|
|
11
|
-
- published by the Free Software Foundation, either version 3 of the
|
|
12
|
-
- License, or (at your option) any later version.
|
|
13
|
-
-
|
|
14
|
-
- This program is distributed in the hope that it will be useful,
|
|
15
|
-
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
-
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
-
- GNU Affero General Public License for more details.
|
|
18
|
-
-
|
|
19
|
-
- You should have received a copy of the GNU Affero General Public License
|
|
20
|
-
- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
-
-
|
|
22
|
-
-->
|
|
23
|
-
|
|
24
|
-
<!-- Follows the tab aria guidelines
|
|
25
|
-
https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-1/tabs.html -->
|
|
26
|
-
<template>
|
|
27
|
-
<div class="app-sidebar-tabs">
|
|
28
|
-
<!-- tabs navigation -->
|
|
29
|
-
<!-- 33 and 34 code is for page up and page down -->
|
|
30
|
-
<nav v-if="hasMultipleTabs"
|
|
31
|
-
class="app-sidebar-tabs__nav"
|
|
32
|
-
@keydown.left.exact.prevent="focusPreviousTab"
|
|
33
|
-
@keydown.right.exact.prevent="focusNextTab"
|
|
34
|
-
@keydown.tab.exact.prevent="focusActiveTabContent"
|
|
35
|
-
@keydown.33.exact.prevent="focusFirstTab"
|
|
36
|
-
@keydown.34.exact.prevent="focusLastTab">
|
|
37
|
-
<ul>
|
|
38
|
-
<li v-for="tab in tabs" :key="tab.id" class="app-sidebar-tabs__tab">
|
|
39
|
-
<a :id="tab.id"
|
|
40
|
-
:aria-controls="`tab-${tab.id}`"
|
|
41
|
-
:aria-selected="activeTab === tab.id"
|
|
42
|
-
:class="{ active: activeTab === tab.id }"
|
|
43
|
-
:data-id="tab.id"
|
|
44
|
-
:href="`#tab-${tab.id}`"
|
|
45
|
-
:tabindex="activeTab === tab.id ? null : -1"
|
|
46
|
-
role="tab"
|
|
47
|
-
@click.prevent="setActive(tab.id)">
|
|
48
|
-
<span :class="tab.icon" class="app-sidebar-tabs__tab-icon" />
|
|
49
|
-
{{ tab.name }}
|
|
50
|
-
</a>
|
|
51
|
-
</li>
|
|
52
|
-
</ul>
|
|
53
|
-
</nav>
|
|
54
|
-
|
|
55
|
-
<!-- tabs content -->
|
|
56
|
-
<div :class="{'app-sidebar-tabs__content--multiple': hasMultipleTabs}"
|
|
57
|
-
class="app-sidebar-tabs__content">
|
|
58
|
-
<slot />
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
|
|
63
|
-
<script>
|
|
64
|
-
import Vue from 'vue'
|
|
65
|
-
|
|
66
|
-
const IsValidString = function(value) {
|
|
67
|
-
return value && typeof value === 'string' && value.trim() !== ''
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const IsValidStringWithoutSpaces = function(value) {
|
|
71
|
-
return IsValidString(value) && value.indexOf(' ') === -1
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export default {
|
|
75
|
-
name: 'AppSidebarTabs',
|
|
76
|
-
props: {
|
|
77
|
-
/**
|
|
78
|
-
* Id of the tab to activate
|
|
79
|
-
*/
|
|
80
|
-
active: {
|
|
81
|
-
type: String,
|
|
82
|
-
default: '',
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
data() {
|
|
87
|
-
return {
|
|
88
|
-
/**
|
|
89
|
-
* The tab component instances to build the tab navbar from.
|
|
90
|
-
*/
|
|
91
|
-
tabs: [],
|
|
92
|
-
/**
|
|
93
|
-
* The id of the currently active tab.
|
|
94
|
-
*/
|
|
95
|
-
activeTab: '',
|
|
96
|
-
/**
|
|
97
|
-
* Dummy array to react on slot changes.
|
|
98
|
-
*/
|
|
99
|
-
children: [],
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
computed: {
|
|
104
|
-
hasMultipleTabs() {
|
|
105
|
-
return this.tabs.length > 1
|
|
106
|
-
},
|
|
107
|
-
currentTabIndex() {
|
|
108
|
-
return this.tabs.findIndex(tab => tab.id === this.activeTab)
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
watch: {
|
|
113
|
-
active(active) {
|
|
114
|
-
// Prevent running it twice
|
|
115
|
-
if (active !== this.activeTab) {
|
|
116
|
-
this.updateActive()
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
children() {
|
|
121
|
-
this.updateTabs()
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
mounted() {
|
|
126
|
-
// Init the tabs list
|
|
127
|
-
this.updateTabs()
|
|
128
|
-
|
|
129
|
-
// Let's make the children list reactive
|
|
130
|
-
this.children = this.$children
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
methods: {
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Set the current active tab
|
|
137
|
-
* @param {string} id the id of the tab
|
|
138
|
-
*/
|
|
139
|
-
setActive(id) {
|
|
140
|
-
this.activeTab = id
|
|
141
|
-
this.$emit('update:active', this.activeTab)
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Focus the previous tab
|
|
146
|
-
* and emit to the parent component
|
|
147
|
-
*/
|
|
148
|
-
focusPreviousTab() {
|
|
149
|
-
if (this.currentTabIndex > 0) {
|
|
150
|
-
this.setActive(this.tabs[this.currentTabIndex - 1].id)
|
|
151
|
-
}
|
|
152
|
-
this.focusActiveTab() // focus nav item
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Focus the next tab
|
|
157
|
-
* and emit to the parent component
|
|
158
|
-
*/
|
|
159
|
-
focusNextTab() {
|
|
160
|
-
if (this.currentTabIndex < this.tabs.length - 1) {
|
|
161
|
-
this.setActive(this.tabs[this.currentTabIndex + 1].id)
|
|
162
|
-
}
|
|
163
|
-
this.focusActiveTab() // focus nav item
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Focus the first tab
|
|
168
|
-
* and emit to the parent component
|
|
169
|
-
*/
|
|
170
|
-
focusFirstTab() {
|
|
171
|
-
this.setActive(this.tabs[0].id)
|
|
172
|
-
this.focusActiveTab() // focus nav item
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Focus the last tab
|
|
177
|
-
* and emit to the parent component
|
|
178
|
-
*/
|
|
179
|
-
focusLastTab() {
|
|
180
|
-
this.setActive(this.tabs[this.tabs.length - 1].id)
|
|
181
|
-
this.focusActiveTab() // focus nav item
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Focus the current active tab
|
|
186
|
-
*/
|
|
187
|
-
focusActiveTab() {
|
|
188
|
-
this.$el.querySelector('#' + this.activeTab).focus()
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Focus the content on tab
|
|
193
|
-
* see aria accessibility guidelines
|
|
194
|
-
*/
|
|
195
|
-
focusActiveTabContent() {
|
|
196
|
-
this.$el.querySelector('#tab-' + this.activeTab).focus()
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Update the current active tab
|
|
201
|
-
*/
|
|
202
|
-
updateActive() {
|
|
203
|
-
this.activeTab = this.active
|
|
204
|
-
&& this.tabs.findIndex(tab => tab.id === this.active) !== -1
|
|
205
|
-
? this.active
|
|
206
|
-
: this.tabs.length > 0
|
|
207
|
-
? this.tabs[0].id
|
|
208
|
-
: ''
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Manually update the sidebar tabs according to $slots.default
|
|
213
|
-
*/
|
|
214
|
-
updateTabs() {
|
|
215
|
-
if (!this.$slots.default) {
|
|
216
|
-
this.tabs = []
|
|
217
|
-
return
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// Find all valid children (AppSidebarTab, other components, text nodes, etc.)
|
|
221
|
-
const children = this.$slots.default.filter(elem => elem.tag || elem.text.trim())
|
|
222
|
-
|
|
223
|
-
// Find all valid instances of AppSidebarTab
|
|
224
|
-
const invalidTabs = []
|
|
225
|
-
const tabs = children.reduce((tabs, tabNode) => {
|
|
226
|
-
const tab = tabNode.componentInstance
|
|
227
|
-
// Make sure all required props are provided and valid
|
|
228
|
-
if (IsValidString(tab?.name)
|
|
229
|
-
&& IsValidStringWithoutSpaces(tab?.id)
|
|
230
|
-
&& IsValidStringWithoutSpaces(tab?.icon)) {
|
|
231
|
-
tabs.push(tab)
|
|
232
|
-
} else {
|
|
233
|
-
invalidTabs.push(tabNode)
|
|
234
|
-
}
|
|
235
|
-
return tabs
|
|
236
|
-
}, [])
|
|
237
|
-
|
|
238
|
-
// Tabs are optional, but you can use either tabs or non-tab-content only
|
|
239
|
-
if (tabs.length !== 0 && tabs.length !== children.length) {
|
|
240
|
-
Vue.util.warn('Mixing tabs and non-tab-content is not possible.')
|
|
241
|
-
invalidTabs.map(invalid => console.debug('Ignoring invalid tab', invalid))
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// We sort the tabs by their order or by their name
|
|
245
|
-
this.tabs = tabs.sort((a, b) => {
|
|
246
|
-
const orderA = a.order || 0
|
|
247
|
-
const orderB = b.order || 0
|
|
248
|
-
if (orderA === orderB) {
|
|
249
|
-
return OC.Util.naturalSortCompare(a.name, b.name)
|
|
250
|
-
}
|
|
251
|
-
return orderA - orderB
|
|
252
|
-
})
|
|
253
|
-
|
|
254
|
-
// Init active tab if exists
|
|
255
|
-
if (this.tabs.length > 0) {
|
|
256
|
-
this.updateActive()
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
}
|
|
261
|
-
</script>
|
|
262
|
-
<style lang="scss" scoped>
|
|
263
|
-
.app-sidebar-tabs {
|
|
264
|
-
display: flex;
|
|
265
|
-
flex-direction: column;
|
|
266
|
-
min-height: 0;
|
|
267
|
-
flex: 1 1 100%;
|
|
268
|
-
|
|
269
|
-
&__nav {
|
|
270
|
-
margin-top: 10px;
|
|
271
|
-
ul {
|
|
272
|
-
display: flex;
|
|
273
|
-
justify-content: stretch;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
&__tab {
|
|
277
|
-
display: block;
|
|
278
|
-
flex: 1 1;
|
|
279
|
-
min-width: 0;
|
|
280
|
-
text-align: center;
|
|
281
|
-
a {
|
|
282
|
-
position: relative;
|
|
283
|
-
display: block;
|
|
284
|
-
overflow: hidden;
|
|
285
|
-
padding: 25px 5px 5px 5px;
|
|
286
|
-
transition: color var(--animation-quick), opacity var(--animation-quick), border-color var(--animation-quick);
|
|
287
|
-
text-align: center;
|
|
288
|
-
white-space: nowrap;
|
|
289
|
-
text-overflow: ellipsis;
|
|
290
|
-
opacity: $opacity_normal;
|
|
291
|
-
color: var(--color-main-text);
|
|
292
|
-
border-bottom: 1px solid var(--color-border);
|
|
293
|
-
|
|
294
|
-
&:hover,
|
|
295
|
-
&:focus,
|
|
296
|
-
&:active,
|
|
297
|
-
&.active {
|
|
298
|
-
opacity: $opacity_full;
|
|
299
|
-
.app-sidebar-tabs__tab-icon {
|
|
300
|
-
opacity: $opacity_full;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
&:not(.active):hover,
|
|
304
|
-
&:not(.active):focus {
|
|
305
|
-
border-bottom-color: var(--color-background-darker);
|
|
306
|
-
box-shadow: inset 0 -1px 0 var(--color-background-darker);
|
|
307
|
-
}
|
|
308
|
-
&.active {
|
|
309
|
-
color: var(--color-text-light);
|
|
310
|
-
border-bottom-color: var(--color-text-light);
|
|
311
|
-
box-shadow: inset 0 -1px 0 var(--color-text-light);
|
|
312
|
-
font-weight: bold;
|
|
313
|
-
}
|
|
314
|
-
// differentiate the two for accessibility purpose
|
|
315
|
-
// make sure the user knows she's focusing the navigation
|
|
316
|
-
// and can use arrows/home/pageup...
|
|
317
|
-
&:focus {
|
|
318
|
-
border-bottom-color: var(--color-primary-element);
|
|
319
|
-
box-shadow: inset 0 -1px 0 var(--color-primary-element);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
&__tab-icon {
|
|
325
|
-
position: absolute;
|
|
326
|
-
top: 0;
|
|
327
|
-
left: 0;
|
|
328
|
-
width: 100%;
|
|
329
|
-
height: 25px;
|
|
330
|
-
transition: opacity var(--animation-quick);
|
|
331
|
-
opacity: $opacity_normal;
|
|
332
|
-
background-position: center 8px;
|
|
333
|
-
background-size: 16px;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
&__content {
|
|
337
|
-
position: relative;
|
|
338
|
-
// take full available height
|
|
339
|
-
min-height: 0;
|
|
340
|
-
height: 100%;
|
|
341
|
-
// force the use of the tab component if more than one tab
|
|
342
|
-
// you can just put raw content if you don't use tabs
|
|
343
|
-
&--multiple > :not(section) {
|
|
344
|
-
display: none;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
</style>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
|
|
3
|
-
*
|
|
4
|
-
* @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
|
|
5
|
-
*
|
|
6
|
-
* @license GNU AGPL version 3 or any later version
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Affero General Public License as
|
|
10
|
-
* published by the Free Software Foundation, either version 3 of the
|
|
11
|
-
* License, or (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Affero General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
import AppSidebar from './AppSidebar'
|
|
22
|
-
|
|
23
|
-
export default AppSidebar
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
- @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
-
|
|
4
|
-
- @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
5
|
-
-
|
|
6
|
-
- @license GNU AGPL version 3 or any later version
|
|
7
|
-
-
|
|
8
|
-
- This program is free software: you can redistribute it and/or modify
|
|
9
|
-
- it under the terms of the GNU Affero General Public License as
|
|
10
|
-
- published by the Free Software Foundation, either version 3 of the
|
|
11
|
-
- License, or (at your option) any later version.
|
|
12
|
-
-
|
|
13
|
-
- This program is distributed in the hope that it will be useful,
|
|
14
|
-
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
- GNU Affero General Public License for more details.
|
|
17
|
-
-
|
|
18
|
-
- You should have received a copy of the GNU Affero General Public License
|
|
19
|
-
- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
-
|
|
21
|
-
-->
|
|
22
|
-
|
|
23
|
-
<!-- Follows the tab aria guidelines
|
|
24
|
-
https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-1/tabs.html -->
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<section
|
|
28
|
-
:id="`tab-${id}`"
|
|
29
|
-
:class="{'app-sidebar__tab--active': isActive}"
|
|
30
|
-
:aria-hidden="!isActive"
|
|
31
|
-
:aria-labelledby="id"
|
|
32
|
-
class="app-sidebar__tab"
|
|
33
|
-
tabindex="0"
|
|
34
|
-
role="tabpanel"
|
|
35
|
-
@scroll="onScroll">
|
|
36
|
-
<slot />
|
|
37
|
-
</section>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
export default {
|
|
42
|
-
name: 'AppSidebarTab',
|
|
43
|
-
|
|
44
|
-
props: {
|
|
45
|
-
id: {
|
|
46
|
-
type: String,
|
|
47
|
-
required: true,
|
|
48
|
-
},
|
|
49
|
-
name: {
|
|
50
|
-
type: String,
|
|
51
|
-
required: true,
|
|
52
|
-
},
|
|
53
|
-
icon: {
|
|
54
|
-
type: String,
|
|
55
|
-
required: true,
|
|
56
|
-
},
|
|
57
|
-
order: {
|
|
58
|
-
type: Number,
|
|
59
|
-
default: 0,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
computed: {
|
|
64
|
-
// TODO: implement a better way to force pass a prop fromm Sidebar
|
|
65
|
-
isActive() {
|
|
66
|
-
return this.$parent.activeTab === this.id
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
methods: {
|
|
71
|
-
onScroll(event) {
|
|
72
|
-
// Are we scrolled to the very bottom ?
|
|
73
|
-
if (this.$el.scrollHeight - this.$el.scrollTop === this.$el.clientHeight) {
|
|
74
|
-
/**
|
|
75
|
-
* Bottom scroll is reached
|
|
76
|
-
*/
|
|
77
|
-
this.$emit('bottomReached', event)
|
|
78
|
-
}
|
|
79
|
-
this.$emit('scroll', event)
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
}
|
|
83
|
-
</script>
|
|
84
|
-
|
|
85
|
-
<style lang="scss" scoped>
|
|
86
|
-
.app-sidebar__tab {
|
|
87
|
-
display: none;
|
|
88
|
-
padding: 10px;
|
|
89
|
-
min-height: 100%; // fill available height
|
|
90
|
-
max-height: 100%; // scroll inside
|
|
91
|
-
overflow: auto;
|
|
92
|
-
|
|
93
|
-
&:focus {
|
|
94
|
-
border-color: var(--color-primary);
|
|
95
|
-
box-shadow: 0 0 0.2em var(--color-primary);
|
|
96
|
-
outline: 0;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
&--active {
|
|
100
|
-
display: block;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
</style>
|