@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,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 AppNavigation from './AppNavigation'
|
|
22
|
-
|
|
23
|
-
export default AppNavigation
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<li class="app-navigation-caption">
|
|
3
|
-
{{ title }}
|
|
4
|
-
</li>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
name: 'AppNavigationCaption',
|
|
11
|
-
props: {
|
|
12
|
-
title: {
|
|
13
|
-
type: String,
|
|
14
|
-
required: true,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<style lang="scss" scoped>
|
|
21
|
-
.app-navigation-caption {
|
|
22
|
-
font-weight: bold;
|
|
23
|
-
color: var(--color-text-maxcontrast);
|
|
24
|
-
line-height: $clickable-area;
|
|
25
|
-
padding-left: $clickable-area;
|
|
26
|
-
white-space: nowrap;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
text-overflow: ellipsis;
|
|
29
|
-
opacity: 0.7;
|
|
30
|
-
box-shadow: none !important;
|
|
31
|
-
order: 1;
|
|
32
|
-
flex-shrink: 0;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// extra top space if it's not the first item on the list
|
|
36
|
-
.app-navigation-caption:not(:first-child) {
|
|
37
|
-
margin-top: $clickable-area / 2;
|
|
38
|
-
}
|
|
39
|
-
</style>
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
- @copyright Copyright (c) 2019 Marco Ambrosini <marcoambrosini@pm.me>
|
|
3
|
-
-
|
|
4
|
-
- @author Marco Ambrosini <marcoambrosini@pm.me>
|
|
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
|
-
<docs>
|
|
24
|
-
|
|
25
|
-
### Normal Counter
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
<AppNavigationCounter>314+</AppNavigationCounter>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Highlighted Counter (i.e. mentions)
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
<AppNavigationCounter :highlighted="true">@admin</AppNavigationCounter>
|
|
35
|
-
<AppNavigationCounter :highlighted="true">314+</AppNavigationCounter>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
</docs>
|
|
39
|
-
|
|
40
|
-
<template>
|
|
41
|
-
<div :class="{ 'app-navigation-entry__counter--highlighted': highlighted }"
|
|
42
|
-
class="app-navigation-entry__counter">
|
|
43
|
-
<slot />
|
|
44
|
-
</div>
|
|
45
|
-
</template>
|
|
46
|
-
|
|
47
|
-
<script>
|
|
48
|
-
|
|
49
|
-
export default {
|
|
50
|
-
name: 'AppNavigationCounter',
|
|
51
|
-
|
|
52
|
-
props: {
|
|
53
|
-
highlighted: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
default: false,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
</script>
|
|
61
|
-
|
|
62
|
-
<style lang="scss" scoped>
|
|
63
|
-
.app-navigation-entry__counter {
|
|
64
|
-
font-size: calc(var(--default-font-size) * .8);
|
|
65
|
-
overflow: hidden;
|
|
66
|
-
width: fit-content;
|
|
67
|
-
max-width: $clickable-area;
|
|
68
|
-
text-align: center;
|
|
69
|
-
text-overflow: ellipsis;
|
|
70
|
-
line-height: 1em;
|
|
71
|
-
padding: 4px 8px;
|
|
72
|
-
border-radius: var(--border-radius-pill);
|
|
73
|
-
background-color: var(--color-background-darker);
|
|
74
|
-
|
|
75
|
-
&--highlighted {
|
|
76
|
-
padding: 4px 6px;
|
|
77
|
-
color: var(--color-primary-text);
|
|
78
|
-
background-color: var(--color-primary);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2019 Marco Ambrosini <marcoambrosini@pm.me>
|
|
3
|
-
*
|
|
4
|
-
* @author Marco Ambrosini <marcoambrosini@pm.me>
|
|
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
|
-
import AppNavigationCounter from './AppNavigationCounter'
|
|
24
|
-
|
|
25
|
-
export default AppNavigationCounter
|
|
@@ -1,95 +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
|
-
<docs>
|
|
24
|
-
### Bullet
|
|
25
|
-
This component is made to be used inside of the [AppNavigationItem](#AppNavigationItem) component slot: `icon`.
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
<AppNavigationIconBullet slot="icon" color="0082c9" />
|
|
29
|
-
<AppNavigationIconBullet slot="icon" color="#0082c9" />
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### AppNavigationItem example
|
|
34
|
-
```
|
|
35
|
-
<AppNavigationItem title="Entry 2" :pinned="true">
|
|
36
|
-
<AppNavigationIconBullet slot="icon" color="0082c9" />
|
|
37
|
-
</AppNavigationItem>
|
|
38
|
-
```
|
|
39
|
-
</docs>
|
|
40
|
-
|
|
41
|
-
<template>
|
|
42
|
-
<div class="app-navigation-entry__icon-bullet" @click="onClick">
|
|
43
|
-
<div :style="{ backgroundColor: formattedColor }" />
|
|
44
|
-
</div>
|
|
45
|
-
</template>
|
|
46
|
-
|
|
47
|
-
<script>
|
|
48
|
-
export default {
|
|
49
|
-
name: 'AppNavigationIconBullet',
|
|
50
|
-
|
|
51
|
-
props: {
|
|
52
|
-
color: {
|
|
53
|
-
type: String,
|
|
54
|
-
required: true,
|
|
55
|
-
validator(color) {
|
|
56
|
-
// #000, 000, #0082c9 and 0082c9
|
|
57
|
-
return /^#?([0-9A-F]{3}){1,2}$/i.test(color)
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
computed: {
|
|
63
|
-
formattedColor() {
|
|
64
|
-
if (this.color.startsWith('#')) {
|
|
65
|
-
return this.color
|
|
66
|
-
}
|
|
67
|
-
return '#' + this.color
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
methods: {
|
|
72
|
-
onClick(e) {
|
|
73
|
-
this.$emit('click', e)
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
</script>
|
|
79
|
-
|
|
80
|
-
<style lang="scss" scoped>
|
|
81
|
-
.app-navigation-entry__icon-bullet {
|
|
82
|
-
display: block;
|
|
83
|
-
// there is 2 margins
|
|
84
|
-
padding: $icon-margin + 1px;
|
|
85
|
-
div {
|
|
86
|
-
width: $icon-size - 2px;
|
|
87
|
-
height: $icon-size - 2px;
|
|
88
|
-
cursor: pointer;
|
|
89
|
-
transition: background 100ms ease-in-out;
|
|
90
|
-
border: none;
|
|
91
|
-
border-radius: 50%;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
</style>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2018 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
|
-
import AppNavigationIconBullet from './AppNavigationIconBullet'
|
|
23
|
-
|
|
24
|
-
export default AppNavigationIconBullet
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
- @copyright Copyright (c) 2019 Marco Ambrosini <marcoambrosini@pm.me>
|
|
3
|
-
-
|
|
4
|
-
- @author Marco Ambrosini <marcoambrosini@pm.me>
|
|
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
|
-
<template>
|
|
24
|
-
<!-- Button to expand or collapse children -->
|
|
25
|
-
<button
|
|
26
|
-
class="icon-collapse"
|
|
27
|
-
:class="{'icon-collapse--rotated':open}"
|
|
28
|
-
type="button"
|
|
29
|
-
@click="onClick" />
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script>
|
|
33
|
-
export default {
|
|
34
|
-
name: 'AppNavigationIconCollapsible',
|
|
35
|
-
|
|
36
|
-
props: {
|
|
37
|
-
open: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: true,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
methods: {
|
|
44
|
-
onClick(e) {
|
|
45
|
-
this.$emit('click', e)
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<style lang="scss" scoped>
|
|
53
|
-
@import '../../fonts/scss/iconfont-vue';
|
|
54
|
-
|
|
55
|
-
.icon-collapse {
|
|
56
|
-
position: absolute;
|
|
57
|
-
z-index: 105; // above a, under button
|
|
58
|
-
width: 44px;
|
|
59
|
-
height: 44px;
|
|
60
|
-
margin: 0;
|
|
61
|
-
padding: 0;
|
|
62
|
-
transition: opacity var(--animation-quick) ease-in-out;
|
|
63
|
-
-webkit-transform: rotate(-90deg);
|
|
64
|
-
-ms-transform: rotate(-90deg);
|
|
65
|
-
transform: rotate(-90deg);
|
|
66
|
-
color: var(--color-main-text);
|
|
67
|
-
border: none;
|
|
68
|
-
border-radius: 0;
|
|
69
|
-
outline: none !important;
|
|
70
|
-
background-color: transparent;
|
|
71
|
-
box-shadow: none;
|
|
72
|
-
font-size: 18px;
|
|
73
|
-
|
|
74
|
-
@include iconfont('triangle-s');
|
|
75
|
-
|
|
76
|
-
&:hover{
|
|
77
|
-
color: var(--color-primary);
|
|
78
|
-
}
|
|
79
|
-
&--rotated {
|
|
80
|
-
-webkit-transform: rotate(0deg);
|
|
81
|
-
-ms-transform: rotate(0deg);
|
|
82
|
-
transform: rotate(0deg);
|
|
83
|
-
color: var(--color-main-text);
|
|
84
|
-
&:hover{
|
|
85
|
-
color: var(--color-primary);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
</style>
|
|
@@ -1,629 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
- @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
-
|
|
4
|
-
- @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
5
|
-
- @author Marco Ambrosini <marcoambrosini@pm.me>
|
|
6
|
-
- @author Jonas Sulzer <jonas@violoncello.ch>
|
|
7
|
-
- @author Jonathan Treffler <mail@jonathan-treffler.de>
|
|
8
|
-
-
|
|
9
|
-
- @license GNU AGPL version 3 or any later version
|
|
10
|
-
-
|
|
11
|
-
- This program is free software: you can redistribute it and/or modify
|
|
12
|
-
- it under the terms of the GNU Affero General Public License as
|
|
13
|
-
- published by the Free Software Foundation, either version 3 of the
|
|
14
|
-
- License, or (at your option) any later version.
|
|
15
|
-
-
|
|
16
|
-
- This program is distributed in the hope that it will be useful,
|
|
17
|
-
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
-
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
-
- GNU Affero General Public License for more details.
|
|
20
|
-
-
|
|
21
|
-
- You should have received a copy of the GNU Affero General Public License
|
|
22
|
-
- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
-
-
|
|
24
|
-
-->
|
|
25
|
-
|
|
26
|
-
<docs>
|
|
27
|
-
|
|
28
|
-
# Usage
|
|
29
|
-
|
|
30
|
-
### Simple element
|
|
31
|
-
|
|
32
|
-
* With an icon:
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
<AppNavigationItem title="My title" icon="icon-category-enabled" />
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
* With a spinning loader instead of the icon:
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
<AppNavigationItem title="Loading Item" :loading="true" />
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Element with actions
|
|
45
|
-
Wrap the children in a template. If you have more than 2 actions, a popover menu and a menu
|
|
46
|
-
button will be automatically created.
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
<AppNavigationItem title="Item with actions" icon="icon-category-enabled">
|
|
50
|
-
<template slot="actions">
|
|
51
|
-
<ActionButton icon="icon-edit" @click="alert('Edit')">
|
|
52
|
-
Edit
|
|
53
|
-
</ActionButton>
|
|
54
|
-
<ActionButton icon="icon-delete" @click="alert('Delete')">
|
|
55
|
-
Delete
|
|
56
|
-
</ActionButton>
|
|
57
|
-
<ActionLink icon="icon-external" title="Link" href="https://nextcloud.com" />
|
|
58
|
-
</template>
|
|
59
|
-
</AppNavigationItem>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Element with counter
|
|
63
|
-
Just nest the counter into `<AppNavigationItem>` and add `slot="counter"` to it.
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
<AppNavigationItem title="Item with counter" icon="icon-folder">
|
|
67
|
-
<AppNavigationCounter slot="counter">
|
|
68
|
-
99+
|
|
69
|
-
</AppNavigationCounter>
|
|
70
|
-
</AppNavigationItem>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Element with children
|
|
74
|
-
|
|
75
|
-
Wrap the children in a template with the `slot` property and use the prop `allowCollapse` to choose wether to allow or
|
|
76
|
-
prevent the user from collapsing the items.
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
<AppNavigationItem title="Item with children" :allowCollapse="true" :open="true">
|
|
80
|
-
<template>
|
|
81
|
-
<AppNavigationItem title="AppNavigationItemChild1" />
|
|
82
|
-
<AppNavigationItem class="active" title="AppNavigationItemChild2" />
|
|
83
|
-
<AppNavigationItem title="AppNavigationItemChild3" />
|
|
84
|
-
<AppNavigationItem title="AppNavigationItemChild4" />
|
|
85
|
-
</template>
|
|
86
|
-
</AppNavigationItem>
|
|
87
|
-
```
|
|
88
|
-
### Editable element
|
|
89
|
-
Add the prop `:editable=true` and an edit placeholder if you need it. By default
|
|
90
|
-
the placeholder is the previous title of the element.
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
<AppNavigationItem title="Editable Item" :editable="true"
|
|
94
|
-
editPlaceholder="your_placeholder_here" icon="icon-folder" @update:title="function(value){alert(value)}" />
|
|
95
|
-
```
|
|
96
|
-
### Undo element
|
|
97
|
-
Just set the `undo` and `title` props. When clicking the undo button, an `undo` event is emitted.
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
<AppNavigationItem :undo="true" title="Deleted important entry" @undo="alert('undo delete')" />
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
### Pinned element
|
|
104
|
-
Just set the `pinned` prop.
|
|
105
|
-
```
|
|
106
|
-
<AppNavigationItem title="Pinned item" :pinned="true" />
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
</docs>
|
|
110
|
-
|
|
111
|
-
<template>
|
|
112
|
-
<!-- Navigation item, can be either an <li> or a <router-link> depending on the props -->
|
|
113
|
-
<nav-element v-bind="navElement"
|
|
114
|
-
:class="{
|
|
115
|
-
'app-navigation-entry--no-icon': !isIconShown,
|
|
116
|
-
'app-navigation-entry--opened': opened,
|
|
117
|
-
'app-navigation-entry--pinned': pinned,
|
|
118
|
-
'app-navigation-entry--editing' : editingActive,
|
|
119
|
-
'app-navigation-entry--deleted': undo,
|
|
120
|
-
'app-navigation-entry--collapsible': collapsible,
|
|
121
|
-
'active': isActive
|
|
122
|
-
}"
|
|
123
|
-
class="app-navigation-entry">
|
|
124
|
-
<!-- Icon and title -->
|
|
125
|
-
<a v-if="!undo"
|
|
126
|
-
class="app-navigation-entry-link"
|
|
127
|
-
href="#"
|
|
128
|
-
@click="onClick">
|
|
129
|
-
|
|
130
|
-
<!-- icon if not collapsible -->
|
|
131
|
-
<!-- never show the icon over the collapsible if mobile -->
|
|
132
|
-
<div :class="{ 'icon-loading-small': loading, [icon]: icon && isIconShown }"
|
|
133
|
-
class="app-navigation-entry-icon">
|
|
134
|
-
<slot v-if="!loading" v-show="isIconShown" name="icon" />
|
|
135
|
-
</div>
|
|
136
|
-
<span v-if="!editingActive" class="app-navigation-entry__title" :title="title">
|
|
137
|
-
{{ title }}
|
|
138
|
-
</span>
|
|
139
|
-
<div v-if="editingActive" class="editingContainer">
|
|
140
|
-
<InputConfirmCancel
|
|
141
|
-
ref="editingInput"
|
|
142
|
-
v-model="editingValue"
|
|
143
|
-
:placeholder="editPlaceholder !== '' ? editPlaceholder : title"
|
|
144
|
-
@cancel="cancelEditing"
|
|
145
|
-
@confirm="handleEditingDone" />
|
|
146
|
-
</div>
|
|
147
|
-
</a>
|
|
148
|
-
|
|
149
|
-
<AppNavigationIconCollapsible v-if="collapsible" :open="opened" @click.prevent.stop="toggleCollapse" />
|
|
150
|
-
<!-- undo entry -->
|
|
151
|
-
<div v-if="undo" class="app-navigation-entry__deleted">
|
|
152
|
-
<div class="app-navigation-entry__deleted-description">
|
|
153
|
-
{{ title }}
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
<!-- Counter and Actions -->
|
|
158
|
-
<div v-if="hasUtils && !editingActive" class="app-navigation-entry__utils">
|
|
159
|
-
<div v-if="$slots.counter"
|
|
160
|
-
class="app-navigation-entry__counter-wrapper">
|
|
161
|
-
<slot name="counter" />
|
|
162
|
-
</div>
|
|
163
|
-
<Actions menu-align="right"
|
|
164
|
-
:placement="menuPlacement"
|
|
165
|
-
:open="menuOpen"
|
|
166
|
-
:force-menu="forceMenu"
|
|
167
|
-
:default-icon="menuIcon"
|
|
168
|
-
@update:open="onMenuToggle">
|
|
169
|
-
<ActionButton v-if="editable && !editingActive" icon="icon-rename" @click="handleEdit">
|
|
170
|
-
{{ editLabel }}
|
|
171
|
-
</ActionButton>
|
|
172
|
-
<ActionButton v-if="undo" icon="app-navigation-entry__deleted-button icon-history" @click="handleUndo" />
|
|
173
|
-
<slot name="actions" />
|
|
174
|
-
</Actions>
|
|
175
|
-
</div>
|
|
176
|
-
|
|
177
|
-
<!-- Children elements -->
|
|
178
|
-
<ul v-if="canHaveChildren && hasChildren" class="app-navigation-entry__children">
|
|
179
|
-
<slot />
|
|
180
|
-
</ul>
|
|
181
|
-
|
|
182
|
-
<!-- Anything (virtual) that should be mounted in the component, like a related modal -->
|
|
183
|
-
<slot name="extra" />
|
|
184
|
-
</nav-element>
|
|
185
|
-
</template>
|
|
186
|
-
|
|
187
|
-
<script>
|
|
188
|
-
import { directive as ClickOutside } from 'v-click-outside'
|
|
189
|
-
|
|
190
|
-
import Actions from '../Actions/Actions'
|
|
191
|
-
import ActionButton from '../ActionButton/ActionButton'
|
|
192
|
-
import AppNavigationIconCollapsible from './AppNavigationIconCollapsible'
|
|
193
|
-
import isMobile from '../../mixins/isMobile'
|
|
194
|
-
import InputConfirmCancel from './InputConfirmCancel'
|
|
195
|
-
|
|
196
|
-
export default {
|
|
197
|
-
name: 'AppNavigationItem',
|
|
198
|
-
|
|
199
|
-
components: {
|
|
200
|
-
Actions,
|
|
201
|
-
ActionButton,
|
|
202
|
-
AppNavigationIconCollapsible,
|
|
203
|
-
InputConfirmCancel,
|
|
204
|
-
},
|
|
205
|
-
directives: {
|
|
206
|
-
ClickOutside,
|
|
207
|
-
},
|
|
208
|
-
mixins: [isMobile],
|
|
209
|
-
props: {
|
|
210
|
-
/**
|
|
211
|
-
* The title of the element.
|
|
212
|
-
*/
|
|
213
|
-
title: {
|
|
214
|
-
type: String,
|
|
215
|
-
required: true,
|
|
216
|
-
},
|
|
217
|
-
/**
|
|
218
|
-
* Refers to the icon on the left, this prop accepts a class
|
|
219
|
-
* like 'icon-category-enabled'.
|
|
220
|
-
*/
|
|
221
|
-
icon: {
|
|
222
|
-
type: String,
|
|
223
|
-
default: '',
|
|
224
|
-
},
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Displays a loading animated icon on the left of the element
|
|
228
|
-
* instead of the icon.
|
|
229
|
-
*/
|
|
230
|
-
loading: {
|
|
231
|
-
type: Boolean,
|
|
232
|
-
default: false,
|
|
233
|
-
},
|
|
234
|
-
/**
|
|
235
|
-
* Passing in a route will make the root element of this
|
|
236
|
-
* component a `<router-link />` that points to that route.
|
|
237
|
-
* By leaving this blank, the root element will be a `<li>`.
|
|
238
|
-
*/
|
|
239
|
-
to: {
|
|
240
|
-
type: [String, Object],
|
|
241
|
-
default: '',
|
|
242
|
-
},
|
|
243
|
-
/**
|
|
244
|
-
* Pass in `true` if you want the matching behaviour to
|
|
245
|
-
* be non-inclusive: https://router.vuejs.org/api/#exact
|
|
246
|
-
*/
|
|
247
|
-
exact: {
|
|
248
|
-
type: Boolean,
|
|
249
|
-
default: false,
|
|
250
|
-
},
|
|
251
|
-
/**
|
|
252
|
-
* Gives the possibility to collapse the children elements into the
|
|
253
|
-
* parent element (true) or expands the children elements (false).
|
|
254
|
-
*/
|
|
255
|
-
allowCollapse: {
|
|
256
|
-
type: Boolean,
|
|
257
|
-
default: false,
|
|
258
|
-
},
|
|
259
|
-
/**
|
|
260
|
-
* Makes the title of the item editable by providing an `ActionButton`
|
|
261
|
-
* component that toggles a form
|
|
262
|
-
*/
|
|
263
|
-
editable: {
|
|
264
|
-
type: Boolean,
|
|
265
|
-
default: false,
|
|
266
|
-
},
|
|
267
|
-
/**
|
|
268
|
-
* Only for 'editable' items, sets label for the edit action button.
|
|
269
|
-
*/
|
|
270
|
-
editLabel: {
|
|
271
|
-
type: String,
|
|
272
|
-
default: '',
|
|
273
|
-
},
|
|
274
|
-
/**
|
|
275
|
-
* Only for items in 'editable' mode, sets the placeholder text for the editing form.
|
|
276
|
-
*/
|
|
277
|
-
editPlaceholder: {
|
|
278
|
-
type: String,
|
|
279
|
-
default: '',
|
|
280
|
-
},
|
|
281
|
-
/**
|
|
282
|
-
* Pins the item to the bottom left area, above the settings. Do not
|
|
283
|
-
* place 'non-pinned' `AppnavigationItem` components below `pinned`
|
|
284
|
-
* ones.
|
|
285
|
-
*/
|
|
286
|
-
pinned: {
|
|
287
|
-
type: Boolean,
|
|
288
|
-
default: false,
|
|
289
|
-
},
|
|
290
|
-
/**
|
|
291
|
-
* Puts the item in the 'undo' state.
|
|
292
|
-
*/
|
|
293
|
-
undo: {
|
|
294
|
-
type: Boolean,
|
|
295
|
-
default: false,
|
|
296
|
-
},
|
|
297
|
-
/**
|
|
298
|
-
* The navigation collapsible state (synced)
|
|
299
|
-
*/
|
|
300
|
-
open: {
|
|
301
|
-
type: Boolean,
|
|
302
|
-
default: false,
|
|
303
|
-
},
|
|
304
|
-
/**
|
|
305
|
-
* The actions menu open state (synced)
|
|
306
|
-
*/
|
|
307
|
-
menuOpen: {
|
|
308
|
-
type: Boolean,
|
|
309
|
-
default: false,
|
|
310
|
-
},
|
|
311
|
-
/**
|
|
312
|
-
* Force the actions to display in a three dot menu
|
|
313
|
-
*/
|
|
314
|
-
forceMenu: {
|
|
315
|
-
type: Boolean,
|
|
316
|
-
default: false,
|
|
317
|
-
},
|
|
318
|
-
/**
|
|
319
|
-
* The action's menu default icon
|
|
320
|
-
*/
|
|
321
|
-
menuIcon: {
|
|
322
|
-
type: String,
|
|
323
|
-
default: undefined,
|
|
324
|
-
},
|
|
325
|
-
/**
|
|
326
|
-
* The action's menu direction
|
|
327
|
-
*/
|
|
328
|
-
menuPlacement: {
|
|
329
|
-
type: String,
|
|
330
|
-
default: 'bottom',
|
|
331
|
-
},
|
|
332
|
-
},
|
|
333
|
-
|
|
334
|
-
data() {
|
|
335
|
-
return {
|
|
336
|
-
editingValue: '',
|
|
337
|
-
opened: this.open,
|
|
338
|
-
editingActive: false,
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
computed: {
|
|
342
|
-
collapsible() {
|
|
343
|
-
return this.allowCollapse && !!this.$slots.default
|
|
344
|
-
},
|
|
345
|
-
|
|
346
|
-
// is the icon shown?
|
|
347
|
-
// we don't show it on mobile if the entry is collapsible
|
|
348
|
-
// we show the collapse toggle directly!
|
|
349
|
-
isIconShown() {
|
|
350
|
-
return !this.collapsible || (this.collapsible && !this.isMobile)
|
|
351
|
-
},
|
|
352
|
-
|
|
353
|
-
// Checks if the component is already a children of another
|
|
354
|
-
// instance of AppNavigationItem
|
|
355
|
-
canHaveChildren() {
|
|
356
|
-
if (this.$parent.$options._componentTag === 'AppNavigationItem') {
|
|
357
|
-
return false
|
|
358
|
-
} else {
|
|
359
|
-
return true
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
hasChildren() {
|
|
363
|
-
if (this.$slots.default) {
|
|
364
|
-
return true
|
|
365
|
-
} else {
|
|
366
|
-
return false
|
|
367
|
-
}
|
|
368
|
-
},
|
|
369
|
-
hasUtils() {
|
|
370
|
-
if (this.editing) {
|
|
371
|
-
return false
|
|
372
|
-
} else if (this.$slots.actions || this.$slots.counter || this.editable || this.undo) {
|
|
373
|
-
return true
|
|
374
|
-
} else {
|
|
375
|
-
return false
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
// This is used to decide which outer element type to use
|
|
379
|
-
// li or router-link
|
|
380
|
-
navElement() {
|
|
381
|
-
if (this.to) {
|
|
382
|
-
return {
|
|
383
|
-
is: 'router-link',
|
|
384
|
-
tag: 'li',
|
|
385
|
-
to: this.to,
|
|
386
|
-
exact: this.exact,
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
return {
|
|
390
|
-
is: 'li',
|
|
391
|
-
}
|
|
392
|
-
},
|
|
393
|
-
isActive() {
|
|
394
|
-
return this.to && this.$route === this.to
|
|
395
|
-
},
|
|
396
|
-
},
|
|
397
|
-
watch: {
|
|
398
|
-
open(newVal) {
|
|
399
|
-
this.opened = newVal
|
|
400
|
-
},
|
|
401
|
-
},
|
|
402
|
-
methods: {
|
|
403
|
-
// sync opened menu state with prop
|
|
404
|
-
onMenuToggle(state) {
|
|
405
|
-
this.$emit('update:menuOpen', state)
|
|
406
|
-
},
|
|
407
|
-
// toggle the collapsible state
|
|
408
|
-
toggleCollapse() {
|
|
409
|
-
this.opened = !this.opened
|
|
410
|
-
this.$emit('update:open', this.opened)
|
|
411
|
-
},
|
|
412
|
-
|
|
413
|
-
// forward click event
|
|
414
|
-
onClick(event) {
|
|
415
|
-
this.$emit('click', event)
|
|
416
|
-
},
|
|
417
|
-
|
|
418
|
-
// Edition methods
|
|
419
|
-
handleEdit() {
|
|
420
|
-
this.editingValue = this.title
|
|
421
|
-
this.editingActive = true
|
|
422
|
-
this.onMenuToggle(false)
|
|
423
|
-
this.$nextTick(() => {
|
|
424
|
-
this.$refs.editingInput.focusInput()
|
|
425
|
-
})
|
|
426
|
-
},
|
|
427
|
-
cancelEditing() {
|
|
428
|
-
this.editingActive = false
|
|
429
|
-
},
|
|
430
|
-
handleEditingDone() {
|
|
431
|
-
this.$emit('update:title', this.editingValue)
|
|
432
|
-
this.editingValue = ''
|
|
433
|
-
this.editingActive = false
|
|
434
|
-
},
|
|
435
|
-
|
|
436
|
-
// Undo methods
|
|
437
|
-
handleUndo() {
|
|
438
|
-
this.$emit('undo')
|
|
439
|
-
},
|
|
440
|
-
},
|
|
441
|
-
}
|
|
442
|
-
</script>
|
|
443
|
-
|
|
444
|
-
<style lang="scss">
|
|
445
|
-
@import '../../fonts/scss/iconfont-vue';
|
|
446
|
-
|
|
447
|
-
.app-navigation-entry {
|
|
448
|
-
position: relative;
|
|
449
|
-
display: flex;
|
|
450
|
-
flex-shrink: 0;
|
|
451
|
-
flex-wrap: wrap;
|
|
452
|
-
order: 1;
|
|
453
|
-
box-sizing: border-box;
|
|
454
|
-
width: 100%;
|
|
455
|
-
min-height: $clickable-area;
|
|
456
|
-
padding-right: 4px;
|
|
457
|
-
|
|
458
|
-
// When .active class is applied, change color background of link and utils. The
|
|
459
|
-
// !important prevents the focus state to override the active state.
|
|
460
|
-
&.active {
|
|
461
|
-
background-color: var(--color-primary-light) !important;
|
|
462
|
-
}
|
|
463
|
-
&:focus-within,
|
|
464
|
-
&:hover {
|
|
465
|
-
background-color: var(--color-background-hover);
|
|
466
|
-
}
|
|
467
|
-
&.active,
|
|
468
|
-
&:focus-within,
|
|
469
|
-
&:hover {
|
|
470
|
-
.app-navigation-entry__children {
|
|
471
|
-
background-color: var(--color-main-background);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/* hide deletion/collapse of subitems */
|
|
476
|
-
&.app-navigation-entry--deleted,
|
|
477
|
-
&.app-navigation-entry--collapsible:not(.app-navigation-entry--opened) {
|
|
478
|
-
> ul {
|
|
479
|
-
// NO ANIMATE because if not really hidden, we can still tab through it
|
|
480
|
-
display: none;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
&:not(.app-navigation-entry--editing) {
|
|
485
|
-
.app-navigation-entry-link, .app-navigation-entry-div {
|
|
486
|
-
padding-right: $icon-margin;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
// Main entry link
|
|
491
|
-
.app-navigation-entry-link, .app-navigation-entry-div {
|
|
492
|
-
z-index: 100; /* above the bullet to allow click*/
|
|
493
|
-
display: flex;
|
|
494
|
-
overflow: hidden;
|
|
495
|
-
flex: 1 1 0;
|
|
496
|
-
box-sizing: border-box;
|
|
497
|
-
min-height: $clickable-area;
|
|
498
|
-
padding: 0;
|
|
499
|
-
white-space: nowrap;
|
|
500
|
-
color: var(--color-main-text);
|
|
501
|
-
background-repeat: no-repeat;
|
|
502
|
-
background-position: $icon-margin center;
|
|
503
|
-
background-size: $icon-size $icon-size;
|
|
504
|
-
line-height: $clickable-area;
|
|
505
|
-
|
|
506
|
-
.app-navigation-entry-icon {
|
|
507
|
-
display: flex;
|
|
508
|
-
align-items: center;
|
|
509
|
-
flex: 0 0 $clickable-area;
|
|
510
|
-
justify-content: center;
|
|
511
|
-
width: $clickable-area;
|
|
512
|
-
height: $clickable-area;
|
|
513
|
-
background-size: $icon-size $icon-size;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
.app-navigation-entry__title {
|
|
517
|
-
overflow: hidden;
|
|
518
|
-
max-width: 100%;
|
|
519
|
-
white-space: nowrap;
|
|
520
|
-
text-overflow: ellipsis;
|
|
521
|
-
padding-left: 6px;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
.editingContainer {
|
|
525
|
-
width: calc(100% - #{$clickable-area});
|
|
526
|
-
margin: auto;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
/* Second level nesting for lists */
|
|
531
|
-
.app-navigation-entry__children {
|
|
532
|
-
position: relative;
|
|
533
|
-
display: flex;
|
|
534
|
-
flex: 0 1 auto;
|
|
535
|
-
flex-direction: column;
|
|
536
|
-
width: 100%;
|
|
537
|
-
|
|
538
|
-
.app-navigation-entry {
|
|
539
|
-
display: inline-flex;
|
|
540
|
-
flex-wrap: wrap;
|
|
541
|
-
padding-left: $clickable-area - $icon-margin;
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
/* Deleted entries */
|
|
547
|
-
.app-navigation-entry__deleted {
|
|
548
|
-
display: inline-flex;
|
|
549
|
-
flex: 1 1 0;
|
|
550
|
-
padding-left: $clickable-area - $icon-margin !important;
|
|
551
|
-
.app-navigation-entry__deleted-description {
|
|
552
|
-
position: relative;
|
|
553
|
-
overflow: hidden;
|
|
554
|
-
flex: 1 1 0;
|
|
555
|
-
white-space: nowrap;
|
|
556
|
-
text-overflow: ellipsis;
|
|
557
|
-
line-height: $clickable-area;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
/* Makes the icon of the collapsible element disappear
|
|
562
|
-
* When hovering on the root element */
|
|
563
|
-
.app-navigation-entry--collapsible {
|
|
564
|
-
//shows the triangle button
|
|
565
|
-
.icon-collapse {
|
|
566
|
-
visibility: hidden;
|
|
567
|
-
}
|
|
568
|
-
&.app-navigation-entry--no-icon,
|
|
569
|
-
&:hover, &:focus {
|
|
570
|
-
a .app-navigation-entry-icon {
|
|
571
|
-
// hides the icon
|
|
572
|
-
visibility: hidden;
|
|
573
|
-
}
|
|
574
|
-
.icon-collapse {
|
|
575
|
-
//shows the triangle button
|
|
576
|
-
visibility: visible;
|
|
577
|
-
}
|
|
578
|
-
// prevent the icon of children elements from being hidden
|
|
579
|
-
// by the previous rule
|
|
580
|
-
.app-navigation-entry__children li:not(.app-navigation-entry--collapsible) a :first-child {
|
|
581
|
-
visibility: visible;
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
/* counter and actions */
|
|
587
|
-
.app-navigation-entry__utils {
|
|
588
|
-
display: flex;
|
|
589
|
-
align-items: center;
|
|
590
|
-
flex: 0 1 auto;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
/* counter */
|
|
594
|
-
.app-navigation-entry__counter-wrapper {
|
|
595
|
-
// Add slightly more space to the right of the counter
|
|
596
|
-
margin-right: 2px;
|
|
597
|
-
display: flex;
|
|
598
|
-
align-items: center;
|
|
599
|
-
flex: 0 1 auto;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
// STATES
|
|
603
|
-
/* editing state */
|
|
604
|
-
.app-navigation-entry--editing {
|
|
605
|
-
.app-navigation-entry-edit {
|
|
606
|
-
z-index: 250;
|
|
607
|
-
opacity: 1;
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
/* deleted state */
|
|
612
|
-
.app-navigation-entry--deleted {
|
|
613
|
-
.app-navigation-entry-deleted {
|
|
614
|
-
z-index: 250;
|
|
615
|
-
transform: translateX(0);
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
/* pinned state */
|
|
620
|
-
.app-navigation-entry--pinned {
|
|
621
|
-
order: 2;
|
|
622
|
-
margin-top: auto;
|
|
623
|
-
// only put a marginTop auto to the first one!
|
|
624
|
-
~ .app-navigation-entry--pinned {
|
|
625
|
-
margin-top: 0;
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
</style>
|