Skip to content

Commit 16ec712

Browse files
committed
Run formatter
1 parent 51789aa commit 16ec712

File tree

4 files changed

+67
-54
lines changed

4 files changed

+67
-54
lines changed

src/blocks/helpers/table-row.vue

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,61 @@
11
<template>
2-
<tr class="notion-simple-table-row">
3-
<td v-for="(cell, key, index) in row.value.properties" :key="key" class="notion-simple-table-data" :style="isColumnStyle(rowIndex) || isRowStyle(index) ? headerStyle : null">
4-
<div class="notion-simple-table-cell">
5-
<div class="notion-simple-table-cell-text">
6-
<NotionTextRenderer :text="cell" v-bind="pass" />
7-
</div>
8-
</div>
9-
</td>
10-
</tr>
2+
<tr class="notion-simple-table-row">
3+
<td
4+
v-for="(cell, key, index) in row.value.properties"
5+
:key="key"
6+
class="notion-simple-table-data"
7+
:style="isColumnStyle(rowIndex) || isRowStyle(index) ? headerStyle : null"
8+
>
9+
<div class="notion-simple-table-cell">
10+
<div class="notion-simple-table-cell-text">
11+
<NotionTextRenderer :text="cell" v-bind="pass" />
12+
</div>
13+
</div>
14+
</td>
15+
</tr>
1116
</template>
1217

1318
<script>
1419
import Blockable, { blockComputed } from "@/lib/blockable";
1520
import NotionTextRenderer from "@/blocks/helpers/text-renderer";
1621
export default {
17-
extends: Blockable,
18-
name: "NotionTableRow",
19-
props: {
20-
row: {
21-
type: Object
22-
},
23-
hasColumnHeader: {
24-
type: Boolean,
25-
default: false
26-
},
27-
hasRowHeader: {
28-
type: Boolean,
29-
default: false
30-
},
31-
rowIndex: {
32-
type: Number,
33-
}
22+
extends: Blockable,
23+
name: "NotionTableRow",
24+
props: {
25+
row: {
26+
type: Object,
3427
},
35-
components: {
36-
NotionTextRenderer
28+
hasColumnHeader: {
29+
type: Boolean,
30+
default: false,
3731
},
38-
computed: {
32+
hasRowHeader: {
33+
type: Boolean,
34+
default: false,
35+
},
36+
rowIndex: {
37+
type: Number,
38+
},
39+
},
40+
components: {
41+
NotionTextRenderer,
42+
},
43+
computed: {
3944
...blockComputed,
4045
headerStyle() {
41-
return {
42-
'background': 'rgb(247, 246, 243)',
43-
'font-weight': 500
44-
}
45-
}
46+
return {
47+
background: "rgb(247, 246, 243)",
48+
"font-weight": 500,
49+
};
50+
},
4651
},
4752
methods: {
48-
isColumnStyle(index) {
49-
return this.hasColumnHeader && index === 0
50-
},
51-
isRowStyle(index) {
52-
return this.hasRowHeader && index === 0
53-
}
54-
}
55-
}
53+
isColumnStyle(index) {
54+
return this.hasColumnHeader && index === 0;
55+
},
56+
isRowStyle(index) {
57+
return this.hasRowHeader && index === 0;
58+
},
59+
},
60+
};
5661
</script>

src/blocks/table.vue

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
<template>
22
<div>
33
<table class="notion-simple-table">
4-
<tbody>
5-
<NotionTableRow v-for="(row, index) in rows" :key="row.value.id" :row="row" :rowIndex="index" :hasColumnHeader="hasColumnHeader" :hasRowHeader="hasRowHeader" v-bind="pass" />
6-
</tbody>
4+
<tbody>
5+
<NotionTableRow
6+
v-for="(row, index) in rows"
7+
:key="row.value.id"
8+
:row="row"
9+
:rowIndex="index"
10+
:hasColumnHeader="hasColumnHeader"
11+
:hasRowHeader="hasRowHeader"
12+
v-bind="pass"
13+
/>
14+
</tbody>
715
</table>
816
</div>
917
</template>
@@ -16,19 +24,19 @@ export default {
1624
extends: Blockable,
1725
name: "NotionTable",
1826
components: {
19-
NotionTableRow
27+
NotionTableRow,
2028
},
2129
computed: {
2230
...blockComputed,
2331
rows() {
24-
return this.value.content.map(id => this.blockMap[id])
32+
return this.value.content.map((id) => this.blockMap[id]);
2533
},
2634
hasColumnHeader() {
27-
return this.value.format.table_block_column_header
35+
return this.value.format.table_block_column_header;
2836
},
2937
hasRowHeader() {
30-
return this.value.format.table_block_row_header
31-
}
38+
return this.value.format.table_block_row_header;
39+
},
3240
},
3341
};
3442
</script>

src/components/block.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ import NotionToggle from "@/blocks/toggle";
5959
import NotionQuote from "@/blocks/quote";
6060
import NotionEquation from "@/blocks/equation";
6161
import NotionTodo from "@/blocks/todo";
62-
import NotionTable from '@/blocks/table'
62+
import NotionTable from "@/blocks/table";
6363
6464
export default {
6565
extends: Blockable,
66-
name: 'NotionBlock',
66+
name: "NotionBlock",
6767
components: {
6868
NotionBookmark,
6969
NotionCallout,
@@ -80,5 +80,5 @@ export default {
8080
NotionEquation,
8181
NotionTodo,
8282
},
83-
}
83+
};
8484
</script>

src/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,4 +713,4 @@ img.notion-nav-icon {
713713
background-color: transparent;
714714
font-size: 14px;
715715
line-height: 20px;
716-
}
716+
}

0 commit comments

Comments
 (0)