This repository has been archived by the owner on Apr 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support 104 Heroicons and provide graceful support for multiple actions
- Loading branch information
Eoghan O'Brien
committed
Oct 11, 2020
1 parent
7c14157
commit dc4975c
Showing
125 changed files
with
1,302 additions
and
87 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
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,40 @@ | ||
<template> | ||
<button | ||
:data-testid="actionId" | ||
:dusk="duskId" | ||
@click.prevent="click" | ||
:title="__(action.label)" | ||
class="btn btn-default ml-3 detached-action-button flex justify-center items-center" | ||
:class="action.classes" | ||
> | ||
<icon v-if="action.icon" :type="action.icon" width="20" height="20" view-box="0 0 24 24" :class="action.iconClasses" /> | ||
<span>{{ __(action.label) }}</span> | ||
</button> | ||
</template> | ||
<script> | ||
export default { | ||
props: { | ||
action: {type: Object, required: true} | ||
}, | ||
methods: { | ||
click() { | ||
this.$emit('action-button-clicked', this.action) | ||
} | ||
}, | ||
computed: { | ||
actionId() { | ||
return `import-action-${this.actionCode}` | ||
}, | ||
duskId() { | ||
return `run-action-button-${this.actionCode}` | ||
}, | ||
actionCode() { | ||
return this.action.name.toLowerCase().replace(' ', '-') | ||
} | ||
} | ||
} | ||
</script> |
Oops, something went wrong.