Skip to content
This repository was archived by the owner on Mar 17, 2024. It is now read-only.

Commit 927fade

Browse files
committed
fix(vuefer): grid position generics
1 parent 24c80eb commit 927fade

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/vuefer/lib/abstract/Navigation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { DrawerBuilder } from 'lib/components'
21
import { Component, markRaw, reactive, ref } from 'vue'
2+
import { DrawerBuilder } from '../components/Drawer'
33
import { Alignment } from './Alignment'
44
import { Maybe } from './BasicTypes'
55

packages/vuefer/lib/components/GridView.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { computed, defineComponent, h, Ref } from 'vue'
22
import { Maybe, ValueChanged } from '../abstract/BasicTypes'
33
import { GridViewDelegate, GridViewItemPosition } from '../abstract/Grid'
44
import GridViewBuilder from './GridViewBuilder.vue'
5-
interface GridViewBuilderI {
5+
interface GridViewBuilderI<TPosition extends GridViewItemPosition> {
66
crossAxisCount?: Ref<number>
77
itemHeight?: Ref<Maybe<number>>
88
isDraggable?: Ref<boolean>
99
isResizable?: Ref<boolean>
1010
placeAnywhere?: Ref<boolean>
11-
delegate: GridViewDelegate
12-
onPositionUpdate?: Maybe<ValueChanged<GridViewItemPosition>>
11+
delegate: GridViewDelegate<TPosition>
12+
onPositionUpdate?: Maybe<ValueChanged<TPosition>>
1313
}
1414
/**
1515
* GridView provide a way to manage resized and draggable items
@@ -51,15 +51,15 @@ interface GridViewBuilderI {
5151
* ```
5252
*/
5353
export class GridView {
54-
static count({
54+
static count<TPosition extends GridViewItemPosition>({
5555
crossAxisCount,
5656
isDraggable,
5757
isResizable,
5858
itemHeight,
5959
delegate,
6060
onPositionUpdate,
6161
placeAnywhere,
62-
}: GridViewBuilderI) {
62+
}: GridViewBuilderI<TPosition>) {
6363
return defineComponent({
6464
name: 'GridView',
6565
components: {

0 commit comments

Comments
 (0)