-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39073 from nextcloud/fix/setting_migrate-from-dep…
…recated-ncpopovermenu
- Loading branch information
Showing
16 changed files
with
389 additions
and
209 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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,78 @@ | ||
<template> | ||
<NcActions :aria-label="t('settings', 'Toggle user actions menu')" | ||
:inline="1"> | ||
<NcActionButton @click="toggleEdit"> | ||
{{ edit ? t('settings', 'Done') : t('settings', 'Edit') }} | ||
<template #icon> | ||
<NcIconSvgWrapper :svg="editSvg" aria-hidden="true" /> | ||
</template> | ||
</NcActionButton> | ||
<NcActionButton v-for="(action, index) in actions" | ||
:key="index" | ||
:aria-label="action.text" | ||
:icon="action.icon" | ||
@click="action.action"> | ||
{{ action.text }} | ||
</NcActionButton> | ||
</NcActions> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { PropType, defineComponent } from 'vue' | ||
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' | ||
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js' | ||
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js' | ||
import SvgCheck from '@mdi/svg/svg/check.svg?raw' | ||
import SvgPencil from '@mdi/svg/svg/pencil.svg?raw' | ||
interface UserAction { | ||
action: (event: MouseEvent) => void, | ||
icon: string, | ||
text: string | ||
} | ||
export default defineComponent({ | ||
components: { | ||
NcActionButton, | ||
NcActions, | ||
NcIconSvgWrapper, | ||
}, | ||
props: { | ||
/** | ||
* Array of user actions | ||
*/ | ||
actions: { | ||
type: Array as PropType<readonly UserAction[]>, | ||
required: true, | ||
}, | ||
/** | ||
* The state whether the row is currently edited | ||
*/ | ||
edit: { | ||
type: Boolean, | ||
required: true, | ||
}, | ||
}, | ||
computed: { | ||
/** | ||
* Current MDI logo to show for edit toggle | ||
*/ | ||
editSvg() { | ||
return this.edit ? SvgCheck : SvgPencil | ||
}, | ||
}, | ||
methods: { | ||
/** | ||
* Toggle edit mode by emitting the update event | ||
*/ | ||
toggleEdit() { | ||
this.$emit('update:edit', !this.edit) | ||
}, | ||
}, | ||
}) | ||
</script> |
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
Oops, something went wrong.