Skip to content

Commit

Permalink
feat: cell id can be numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Dec 19, 2019
1 parent 40e7ded commit 4462ea4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/x6/src/core/cell.ts
Expand Up @@ -6,7 +6,7 @@ import { Style } from '../types'
import { Overlay, Point, Rectangle } from '../struct'

export class Cell extends Disposable {
public id?: string | null
public id?: string | number | null
public data: any
public style: Style
public visible: boolean
Expand Down Expand Up @@ -322,7 +322,7 @@ export class Cell extends Disposable {
return this.id
}

setId(id?: string | null) {
setId(id?: string | number | null) {
this.id = id
}

Expand Down Expand Up @@ -411,7 +411,7 @@ export namespace Cell {
// Cell Creation
export namespace Cell {
export interface CreateCellOptions {
id?: string | null
id?: string | number | null
data?: any
visible?: boolean
overlays?: Overlay[]
Expand Down
2 changes: 1 addition & 1 deletion packages/x6/src/core/model.ts
Expand Up @@ -115,7 +115,7 @@ export class Model extends Events<Model.EventArgs> {

// #endregion

getCell(id: string) {
getCell(id: string | number) {
return this.cells != null ? this.cells[id] : null
}

Expand Down

0 comments on commit 4462ea4

Please sign in to comment.