-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
- Loading branch information
Showing
51 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
Binary file modified
BIN
-8 Bytes
(100%)
...avigationItem.cy.ts/NcAppNavigationItem-primary-on-active-entry-menu-active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-7 Bytes
(100%)
...avigationItem.cy.ts/NcAppNavigationItem-primary-on-active-route-menu-active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+78 Bytes
(100%)
...null-starred_false-compact_true-header_image-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+86 Bytes
(100%)
...e_null-starred_false-compact_true-header_image-secondary_none-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+76 Bytes
(100%)
..._null-starred_false-compact_true-header_none-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+88 Bytes
(100%)
...me_null-starred_false-compact_true-header_none-secondary_none-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+78 Bytes
(100%)
..._null-starred_null-compact_true-header_image-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+86 Bytes
(100%)
...me_null-starred_null-compact_true-header_image-secondary_none-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+78 Bytes
(100%)
...e_null-starred_null-compact_true-header_none-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+86 Bytes
(100%)
...ame_null-starred_null-compact_true-header_none-secondary_none-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+78 Bytes
(100%)
..._null-starred_true-compact_true-header_image-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+86 Bytes
(100%)
...me_null-starred_true-compact_true-header_image-secondary_none-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+82 Bytes
(100%)
...e_null-starred_true-compact_true-header_none-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+85 Bytes
(100%)
...ame_null-starred_true-compact_true-header_none-secondary_none-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+38 Bytes
(100%)
...true-starred_false-compact_true-header_image-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+43 Bytes
(100%)
...e_true-starred_false-compact_true-header_image-secondary_none-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+42 Bytes
(100%)
..._true-starred_false-compact_true-header_none-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+40 Bytes
(100%)
...me_true-starred_false-compact_true-header_none-secondary_none-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+38 Bytes
(100%)
..._true-starred_null-compact_true-header_image-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+43 Bytes
(100%)
...me_true-starred_null-compact_true-header_image-secondary_none-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+38 Bytes
(100%)
...e_true-starred_null-compact_true-header_none-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+43 Bytes
(100%)
...ame_true-starred_null-compact_true-header_none-secondary_none-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+38 Bytes
(100%)
..._true-starred_true-compact_true-header_image-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+43 Bytes
(100%)
...me_true-starred_true-compact_true-header_image-secondary_none-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+67 Bytes
(100%)
...e_true-starred_true-compact_true-header_none-secondary_button-editable_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+66 Bytes
(100%)
...ame_true-starred_true-compact_true-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+36 Bytes
(100%)
...ull-starred_false-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+36 Bytes
(100%)
..._null-starred_false-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+76 Bytes
(100%)
...null-starred_false-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+88 Bytes
(100%)
...e_null-starred_false-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+28 Bytes
(100%)
...null-starred_null-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+30 Bytes
(100%)
...e_null-starred_null-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+78 Bytes
(100%)
..._null-starred_null-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+86 Bytes
(100%)
...me_null-starred_null-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+43 Bytes
(100%)
...null-starred_true-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+42 Bytes
(100%)
...e_null-starred_true-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+82 Bytes
(100%)
..._null-starred_true-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+85 Bytes
(100%)
...me_null-starred_true-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+14 Bytes
(100%)
...rue-starred_false-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+11 Bytes
(100%)
..._true-starred_false-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+42 Bytes
(100%)
...true-starred_false-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+40 Bytes
(100%)
...e_true-starred_false-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-14 Bytes
(100%)
...true-starred_null-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-15 Bytes
(100%)
...e_true-starred_null-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+38 Bytes
(100%)
..._true-starred_null-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+43 Bytes
(100%)
...me_true-starred_null-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-11 Bytes
(100%)
...true-starred_true-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-11 Bytes
(100%)
...e_true-starred_true-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+67 Bytes
(100%)
..._true-starred_true-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+66 Bytes
(100%)
...me_true-starred_true-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import type { VNode, VNodeChildren } from 'vue' | ||
import { computed, onBeforeMount, ref, useSlots } from 'vue' | ||
|
||
function slotText(slot: VNode): string { | ||
const extractText = (child?: VNodeChildren): string => { | ||
if (typeof child === 'string') { | ||
return child.trim() | ||
} else if (Array.isArray(child)) { | ||
return child | ||
.map((c) => extractText(c)) | ||
.join('') | ||
} | ||
return '' | ||
} | ||
|
||
return extractText(slot.children) | ||
} | ||
|
||
export const useActionText = () => { | ||
const slots = useSlots() | ||
const text = ref('') | ||
const isLongText = computed(() => text.value && text.value.trim().length > 20) | ||
|
||
function getText() { | ||
return (slots.default?.() ?? []) | ||
.map(slotText) | ||
.join('') | ||
} | ||
|
||
onBeforeMount(() => { text.value = getText() }) | ||
|
||
return { | ||
/** | ||
* The current text from the default slot as $slots is not reactive | ||
*/ | ||
text, | ||
/** | ||
* Check if the passed text is considered long (currently > 20 characters) | ||
*/ | ||
isLongText, | ||
} | ||
} |