Skip to content

Commit

Permalink
refactor(data-table): fixing details from reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavomelki committed Dec 8, 2020
1 parent 0bfb569 commit d422c39
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/DataTable/DataTable.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export const Slots = (args) => ({
</SbDataTableColumn>
<SbDataTableColumn label="Static">
Teste de conteúdo estático
Static content testing
</SbDataTableColumn>
</SbDataTable>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/DataTable/components/SbDataTableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const SbDataTableBodyRow = {
type: Array,
},
row: {
type: Object | Array,
type: [Object, Array],
},
selectedRows: {
type: Array,
Expand Down Expand Up @@ -131,7 +131,7 @@ export const SbDataTableBody = {

render(h) {
return h('tbody', [
this.items.map((row, index) => {
this.items.map((row) => {
return h(SbDataTableBodyRow, {
props: {
allowSelection: this.allowSelection,
Expand Down
6 changes: 3 additions & 3 deletions src/components/DataTable/components/SbDataTableColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export const SbDataTableColumn = {
label: {
type: String,
},
row: {
type: Object,
},
sortable: {
type: Boolean,
},
value: {
type: String,
},
row: {
type: Object,
},
width: {
type: String,
},
Expand Down
8 changes: 4 additions & 4 deletions src/components/DataTable/data-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
transform: translateY(-50%);
}

br {
* {
display: none;
}
}
Expand Down Expand Up @@ -79,7 +79,7 @@

&__head-cell, &__body-cell {
color: $light-gray;
font-size: 14px;
font-size: $font-size-md;
line-height: 1.3;
font-weight: normal;
text-align: left;
Expand All @@ -93,7 +93,7 @@
}

&__col-main {
font-weight: 500;
font-weight: $font-weight-medium;
color: $sb-dark-blue;
}

Expand All @@ -106,7 +106,7 @@
}

&__sort-icon {
margin-left: 10px;
margin-left: 1rem;
opacity: 0;

.sb-data-table--show-icon & {
Expand Down
6 changes: 5 additions & 1 deletion src/components/DataTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ const SbDataTable = {
}
},

showHeader() {
return !this.hideHeader && this.headers.length
},

sortedData() {
if (this.sortKey && this.sortOrder !== 0) {
return this.doSort()
Expand Down Expand Up @@ -257,7 +261,7 @@ const SbDataTable = {
staticClass: 'sb-data-table__container',
},
[
!this.hideHeader && this.headers.length
this.showHeader
? h(SbDataTableHeader, {
props: {
allowSelection: this.allowSelection,
Expand Down

0 comments on commit d422c39

Please sign in to comment.