Skip to content

Commit

Permalink
- Linting: Nuke unused var.; specify more param types
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Oct 6, 2020
1 parent 420f944 commit 6632799
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/components/compounds/Table/DataGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class DataGrid {
}
}

deleteRow(index) {
deleteRow(index: number) {
this.rows.splice(index, 1)
this.originalRows.splice(index, 1)
}
Expand Down Expand Up @@ -96,20 +96,20 @@ class DataGrid {
this.draggingRowIdx = idx;
}

onDropRow(event, row, idx: number) {
onDropRow(evt: Event, row, idx: number) {
const chunk = this.rows.splice(this.draggingRowIdx, 1)
this.rows.splice(idx, 0, chunk[0])
this.resetDraggingRow()
}

onDragOverRow(event, row, idx: number) {
onDragOverRow(evt: Event, row, idx: number) {
if (this.draggingRowIdx === null) return;

this.rows[idx].selected = true
event.preventDefault()
evt.preventDefault()
}

onDragLeaveRow(event, row, idx) {
onDragLeaveRow(evt: Event, row, idx) {
this.rows[idx].selected = false
}

Expand All @@ -119,27 +119,27 @@ class DataGrid {
this.draggingRowIdx = null;
}

onDragStartColumn(event, column, idx: number) {
onDragStartColumn(evt: Event, column, idx: number) {
this.draggingColumn = column;
this.draggingColumnIdx = idx;
}

// callback called when user drops a column
onDropColumn(event, column, idx: number) {
onDropColumn(evt: Event, column, idx: number) {
const chunk = this.columns.splice(this.draggingColumnIdx, 1)
this.columns.splice(idx, 0, chunk[0])
this.resetDraggingColumn()
}

// the event must be prevented for the onDrop method to get called
onDragOverColumn(event, column, idx: number) {
onDragOverColumn(evt: Event, column, idx: number) {
if (this.draggingColumnIdx === null) return;

this.columns[idx].selected = true
event.preventDefault()
evt.preventDefault()
}

onDragLeaveColumn(event, column, idx: number) {
onDragLeaveColumn(evt: Event, column, idx: number) {
this.columns[idx].selected = false
}

Expand Down
1 change: 0 additions & 1 deletion src/components/compounds/Table/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ const Table = {
setup(props, { emit }) {
// datagrid instance reference
const data = ref(props.data)
const pagination = ref(props.pagination)
const rowsPerPage = ref(props.rowsPerPage)
const currentPage = ref(0)
const search = reactive({})
Expand Down

0 comments on commit 6632799

Please sign in to comment.