Skip to content

Commit

Permalink
πŸ’„ (#2345): table icons
Browse files Browse the repository at this point in the history
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
  • Loading branch information
Vinicius Reis committed May 23, 2022
1 parent 29898e4 commit 5e8f077
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 16 deletions.
6 changes: 6 additions & 0 deletions src/components/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import MdiLoading from 'vue-material-design-icons/Loading'

export { default as Lock } from 'vue-material-design-icons/Lock'
export { default as Delete } from 'vue-material-design-icons/Delete'
export { default as Undo } from 'vue-material-design-icons/ArrowULeftTop'
export { default as Redo } from 'vue-material-design-icons/ArrowURightTop'
export { default as Info } from 'vue-material-design-icons/Information'
Expand Down Expand Up @@ -51,6 +52,11 @@ export { default as FormatListNumbered } from 'vue-material-design-icons/FormatL
export { default as FormatListBulleted } from 'vue-material-design-icons/FormatListBulleted'
export { default as FormatListCheckbox } from 'vue-material-design-icons/FormatListCheckbox'
export { default as FormatQuote } from 'vue-material-design-icons/FormatQuoteClose'
export { default as TableSettings } from 'vue-material-design-icons/TableCog'
export { default as TableAddRowAfter } from 'vue-material-design-icons/TableRowPlusAfter'
export { default as TableAddRowBefore } from 'vue-material-design-icons/TableRowPlusBefore'
export { default as TableAddColumnAfter } from 'vue-material-design-icons/TableColumnPlusAfter'
export { default as TableAddColumnBefore } from 'vue-material-design-icons/TableColumnPlusBefore'

export const Loading = {
functional: true,
Expand Down
21 changes: 16 additions & 5 deletions src/nodes/TableCellView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,25 @@
<NodeViewContent class="content" />
<Actions v-if="editor.isEditable">
<ActionButton icon="icon-add_row_before"
:close-after-click="true"
close-after-click
@click="addRowBefore">
<template #icon>
<TableAddRowBefore />
</template>
{{ t('text', 'Add row before') }}
</ActionButton>
<ActionButton icon="icon-add_row_after"
:close-after-click="true"
<ActionButton close-after-click
@click="addRowAfter">
<template #icon>
<TableAddRowAfter />
</template>
{{ t('text', 'Add row after') }}
</ActionButton>
<ActionButton icon="icon-delete"
:close-after-click="true"
<ActionButton close-after-click
@click="deleteRow">
<template #icon>
<Delete />
</template>
{{ t('text', 'Delete this row') }}
</ActionButton>
</Actions>
Expand All @@ -49,6 +56,7 @@
import { NodeViewWrapper, NodeViewContent } from '@tiptap/vue-2'
import Actions from '@nextcloud/vue/dist/Components/Actions'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
import { TableAddRowBefore, TableAddRowAfter, Delete } from '../components/icons.js'

export default {
name: 'TableCellView',
Expand All @@ -57,6 +65,9 @@ export default {
Actions,
NodeViewWrapper,
NodeViewContent,
TableAddRowBefore,
TableAddRowAfter,
Delete,
},
props: {
editor: {
Expand Down
22 changes: 16 additions & 6 deletions src/nodes/TableHeaderView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,25 @@
<div>
<NodeViewContent class="content" />
<Actions v-if="editor.isEditable">
<ActionButton icon="icon-add_col_before"
:close-after-click="true"
<ActionButton close-after-click
@click="addColumnBefore">
<template #icon>
<TableAddColumnBefore />
</template>
{{ t('text', 'Add column before') }}
</ActionButton>
<ActionButton icon="icon-add_col_after"
:close-after-click="true"
<ActionButton close-after-click
@click="addColumnAfter">
<template #icon>
<TableAddColumnAfter />
</template>
{{ t('text', 'Add column after') }}
</ActionButton>
<ActionButton icon="icon-delete"
:close-after-click="true"
<ActionButton close-after-click
@click="deleteColumn">
<template #icon>
<Delete />
</template>
{{ t('text', 'Delete this column') }}
</ActionButton>
</Actions>
Expand All @@ -49,6 +55,7 @@
import { NodeViewWrapper, NodeViewContent } from '@tiptap/vue-2'
import Actions from '@nextcloud/vue/dist/Components/Actions'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
import { Delete, TableAddColumnBefore, TableAddColumnAfter } from '../components/icons.js'

export default {
name: 'TableHeaderView',
Expand All @@ -57,6 +64,9 @@ export default {
Actions,
NodeViewWrapper,
NodeViewContent,
Delete,
TableAddColumnBefore,
TableAddColumnAfter,
},
props: {
editor: {
Expand Down
17 changes: 12 additions & 5 deletions src/nodes/TableView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@
<NodeViewWrapper class="table-wrapper">
<NodeViewContent class="content" as="table" />
<Actions v-if="editor.isEditable"
:force-menu="true"
class="table-settings"
default-icon="icon-table_settings">
<ActionButton icon="icon-delete"
:close-after-click="true"
force-menu
class="table-settings">
<template #icon>
<TableSettings />
</template>
<ActionButton close-after-click
@click="deleteNode">
<template #icon>
<Delete />
</template>
{{ t('text', 'Delete this table') }}
</ActionButton>
</Actions>
Expand All @@ -41,6 +45,7 @@
import { NodeViewWrapper, NodeViewContent } from '@tiptap/vue-2'
import Actions from '@nextcloud/vue/dist/Components/Actions'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
import { TableSettings, Delete } from '../components/icons.js'

export default {
name: 'TableView',
Expand All @@ -49,6 +54,8 @@ export default {
Actions,
NodeViewWrapper,
NodeViewContent,
TableSettings,
Delete,
},
props: {
editor: {
Expand Down

0 comments on commit 5e8f077

Please sign in to comment.