Skip to content

Commit

Permalink
Merge pull request #969 from 3YOURMIND/remove-dollar-on-from-kt-table
Browse files Browse the repository at this point in the history
refact(kt-table): remove $on call from KtTable
  • Loading branch information
Isokaeder committed Jul 17, 2024
2 parents cf13313 + 3a51deb commit b3ee2bf
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 22 deletions.
1 change: 0 additions & 1 deletion packages/documentation/pages/usage/components/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,6 @@ The above code for `orderBeforeColumn` function, is meant to map the UI drag/dro
| `trClasses` | classes to apply to all table data rows: `<tr />` elements | `String`, `Array`, `Object` | `"responsive"` | - |
| `useColumnDragToOrder` | enable dragging columns to change their order | `Boolean` | - | `false` |
| `useQuickSortControl` | enable toggle sort by column click UI (arrow keys) | `Boolean` | - | `false` |
| `value` (deprecated) | used when v-model was used instead of `selected` | `Array` | — | — |

### Column Attributes

Expand Down
2 changes: 1 addition & 1 deletion packages/kotti-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@
"style": "./dist/style.css",
"type": "module",
"types": "./dist/index.d.ts",
"version": "6.0.0"
"version": "6.0.1"
}
12 changes: 0 additions & 12 deletions packages/kotti-ui/source/kotti-table/KtTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ export default {
'expand', // FIXME: Seems unused
'expandChange', // FIXME: Seems unused
'hiddenChange', // FIXME: Seems unused
'input',
'orderChange', // FIXME: Seems unused
'rowBlur', // FIXME: Seems unused
'rowClick',
Expand Down Expand Up @@ -337,17 +336,6 @@ export default {
this.$ready = true
// @ts-expect-error store will exist at runtime
this.store.commit('updateColumns', { emitChange: false })
// eslint-disable-next-line vue/no-deprecated-events-api
this.$on('selectionChange', (selection: any) => {
// @ts-expect-error value will exist at runtime
if (this.value) {
this.$emit(
'input',
// @ts-expect-error store will exist at runtime
selection.map((row: any) => this.store.get('getIndexByRow', row)),
)
}
})
},
methods: {
isSelected(index: unknown): unknown {
Expand Down
3 changes: 0 additions & 3 deletions packages/kotti-ui/source/kotti-table/logic/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ export const getters: Store.GetterComponents.Select = {
getRowByVisibleIndex(state, index) {
return state.rows[index]
},
getIndexByRow(state, row) {
return state.rows.indexOf(row)
},
getRowKey(state, row) {
return typeof state.rowKey === 'function'
? state.rowKey(row)
Expand Down
5 changes: 0 additions & 5 deletions packages/kotti-ui/source/kotti-table/logic/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,6 @@ export module Store {
state: State,
index: number,
): State['rows'][number]
getIndexByRow(
this: TableStore,
state: State,
row: State['rows'][number],
): number
getRowKey(this: TableStore, state: State, row: any): string | number
isSelected(
this: TableStore,
Expand Down

0 comments on commit b3ee2bf

Please sign in to comment.