mirror of https://github.com/artf/grapesjs.git
3 changed files with 12 additions and 9 deletions
@ -1,25 +1,28 @@ |
|||
import Component from './Component'; |
|||
import { toLowerCase } from 'utils/mixins'; |
|||
import { toLowerCase } from '../../utils/mixins'; |
|||
|
|||
const type = 'svg'; |
|||
|
|||
export default class ComponentSvg extends Component { |
|||
get defaults() { |
|||
return { |
|||
// @ts-ignore
|
|||
...super.defaults, |
|||
type, |
|||
tagName: type, |
|||
highlightable: 0, |
|||
resizable: { ratioDefault: 1 }, |
|||
highlightable: false, |
|||
resizable: { ratioDefault: true }, |
|||
}; |
|||
} |
|||
|
|||
getName() { |
|||
let name = this.get('tagName'); |
|||
let customName = this.get('custom-name'); |
|||
let name = this.get('tagName')!; |
|||
const customName = this.get('custom-name'); |
|||
name = name.charAt(0).toUpperCase() + name.slice(1); |
|||
return customName || name; |
|||
} |
|||
} |
|||
|
|||
ComponentSvg.isComponent = el => toLowerCase(el.tagName) === type; |
|||
static isComponent(el: HTMLElement) { |
|||
return toLowerCase(el.tagName) === type; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue