Skip to content

Commit 522eb37

Browse files
Antreesybackportbot[bot]
authored andcommitted
feat(NcActionButton): introduce 'description' prop
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
1 parent 758bab5 commit 522eb37

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

src/assets/action.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@
112112
display: block;
113113
}
114114

115+
&__description {
116+
display: block;
117+
white-space: pre-wrap;
118+
font-size: var(--font-size-small);
119+
line-height: var(--default-line-height);
120+
color: var(--color-text-maxcontrast);
121+
cursor: pointer;
122+
}
123+
115124
&__menu-icon {
116125
margin-inline: auto calc($icon-margin * -1);
117126
}

src/components/NcActionButton/NcActionButton.vue

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ This component is made to be used inside of the [NcActions](#NcActions) componen
5353
</script>
5454
```
5555

56-
If you're using a long text you can specify a name
56+
If you're using a long text, you can specify a `name` prop.
57+
58+
For the same purpose, but in a more compact way, `description` prop can be used.
5759

5860
```vue
5961
<template>
@@ -70,15 +72,23 @@ If you're using a long text you can specify a name
7072
</template>
7173
This button is associated with a very long text.\nAnd with new lines too.
7274
</NcActionButton>
75+
<NcActionButton description="Subline description for the button" @click="showMessage('Edit')">
76+
<template #icon>
77+
<Pencil :size="20" />
78+
</template>
79+
Edit
80+
</NcActionButton>
7381
</NcActions>
7482
</template>
7583
<script>
7684
import Delete from 'vue-material-design-icons/Delete.vue'
85+
import Pencil from 'vue-material-design-icons/Pencil.vue'
7786
import Plus from 'vue-material-design-icons/Plus.vue'
7887

7988
export default {
8089
components: {
8190
Delete,
91+
Pencil,
8292
Plus,
8393
},
8494
methods: {
@@ -348,6 +358,9 @@ export default {
348358
class="action-button__text">
349359
{{ text }}
350360
</span>
361+
<span v-if="description"
362+
class="action-button__description"
363+
v-text="description" />
351364
</span>
352365

353366
<!-- right(in LTR) or left(in RTL) arrow icon when there is a sub-menu -->
@@ -452,6 +465,14 @@ export default {
452465
type: String,
453466
default: null,
454467
},
468+
469+
/**
470+
* Small underlying text content of the entry
471+
*/
472+
description: {
473+
type: String,
474+
default: '',
475+
},
455476
},
456477
setup() {
457478
return {

0 commit comments

Comments
 (0)