mirror of https://github.com/artf/grapesjs.git
1 changed files with 6 additions and 3 deletions
@ -1,17 +1,20 @@ |
|||||
import ComponentText from './ComponentText'; |
import ComponentText from './ComponentText'; |
||||
import { toLowerCase } from 'utils/mixins'; |
import { toLowerCase } from '../../utils/mixins'; |
||||
|
|
||||
const type = 'label'; |
const type = 'label'; |
||||
|
|
||||
export default class ComponentLabel extends ComponentText { |
export default class ComponentLabel extends ComponentText { |
||||
get defaults() { |
get defaults() { |
||||
return { |
return { |
||||
|
// @ts-ignore
|
||||
...super.defaults, |
...super.defaults, |
||||
type, |
type, |
||||
tagName: type, |
tagName: type, |
||||
traits: ['id', 'title', 'for'], |
traits: ['id', 'title', 'for'], |
||||
}; |
}; |
||||
} |
} |
||||
} |
|
||||
|
|
||||
ComponentLabel.isComponent = el => toLowerCase(el.tagName) === type; |
static isComponent(el: HTMLElement) { |
||||
|
return toLowerCase(el.tagName) === type; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue