From eaa05e7345d491ff94b8311699945db826024563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Fri, 17 Feb 2023 12:44:31 +0100 Subject: [PATCH 1/4] Use router-link slot in NcAppNavigationItem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- .../NcAppNavigationItem.vue | 210 +++++++++--------- src/components/NcVNodes/NcVNodes.vue | 4 +- 2 files changed, 103 insertions(+), 111 deletions(-) diff --git a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue index e5840da78e..763bd37642 100644 --- a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue +++ b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue @@ -209,99 +209,104 @@ Just set the `pinned` prop. 'app-navigation-entry--collapsible': collapsible, }" class="app-navigation-entry-wrapper"> - - - - - - -
- - + +
+ + + + + +
+ + +
+ + {{ nameTitleFallback }} + +
+ +
+
+ + + +
+
+ {{ nameTitleFallback }} +
- - {{ nameTitleFallback }} - -
- -
- - - - -
-
- {{ nameTitleFallback }} -
-
- -
-
- -
- - - + +
+
+ +
+ - {{ editLabel }} - - - - - - -
+ + + {{ editLabel }} + + + + + +
+
- - - + + +
+
    @@ -315,6 +320,7 @@ import { directive as ClickOutside } from 'v-click-outside' import NcActions from '../NcActions/index.js' import NcActionButton from '../NcActionButton/index.js' import NcLoadingIcon from '../NcLoadingIcon/index.js' +import NcVNodes from '../NcVNodes/index.js' import NcAppNavigationIconCollapsible from './NcAppNavigationIconCollapsible.vue' import isMobile from '../../mixins/isMobile/index.js' import NcInputConfirmCancel from './NcInputConfirmCancel.vue' @@ -330,9 +336,10 @@ export default { components: { NcActions, NcActionButton, - NcLoadingIcon, NcAppNavigationIconCollapsible, NcInputConfirmCancel, + NcLoadingIcon, + NcVNodes, Pencil, Undo, }, @@ -399,7 +406,7 @@ export default { */ to: { type: [String, Object], - default: '', + default: null, }, /** @@ -570,6 +577,10 @@ export default { return this.name }, + isRouterLink() { + return this.to && !this.href + }, + collapsible() { return this.allowCollapse && !!this.$slots.default }, @@ -598,25 +609,6 @@ export default { return false }, - // This is used to decide which outer element type to use - navElement() { - if (this.to && !this.href) { - return { - is: 'router-link', - tag: 'div', - to: this.to, - exact: this.exact, - } - } - return { - is: 'div', - } - }, - - isActive() { - return this.to && this.$route === this.to - }, - editButtonAriaLabel() { return this.editLabel ? this.editLabel : t('Edit item') }, diff --git a/src/components/NcVNodes/NcVNodes.vue b/src/components/NcVNodes/NcVNodes.vue index fa27f7c631..bbdb40c2f5 100644 --- a/src/components/NcVNodes/NcVNodes.vue +++ b/src/components/NcVNodes/NcVNodes.vue @@ -29,7 +29,7 @@ export default { */ vnodes: { type: [Array, Object], - default: () => [], + default: null, }, }, /** @@ -39,7 +39,7 @@ export default { * @return {object} The created VNode */ render(h) { - return this.vnodes + return this.vnodes || this.$slots?.default || this.$scopedSlots?.default?.() }, } From 7b3f763441cc8f2b665814d9bead976f3e296471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Fri, 24 Feb 2023 17:07:43 +0100 Subject: [PATCH 2/4] Use router-link slot in NcListItem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- src/components/NcListItem/NcListItem.vue | 180 +++++++++++------------ 1 file changed, 85 insertions(+), 95 deletions(-) diff --git a/src/components/NcListItem/NcListItem.vue b/src/components/NcListItem/NcListItem.vue index 8f3a51e4e6..5fe0910eb8 100644 --- a/src/components/NcListItem/NcListItem.vue +++ b/src/components/NcListItem/NcListItem.vue @@ -199,71 +199,88 @@