mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
608 B
29 lines
608 B
const Component = require('./Component');
|
|
|
|
module.exports = Component.extend(
|
|
{
|
|
defaults: {
|
|
...Component.prototype.defaults,
|
|
type: 'table',
|
|
tagName: 'table',
|
|
droppable: ['tbody', 'thead', 'tfoot']
|
|
},
|
|
|
|
initialize(o, opt) {
|
|
Component.prototype.initialize.apply(this, arguments);
|
|
const components = this.get('components');
|
|
!components.length && components.add({ type: 'tbody' });
|
|
}
|
|
},
|
|
{
|
|
isComponent(el) {
|
|
let result = '';
|
|
|
|
if (el.tagName == 'TABLE') {
|
|
result = { type: 'table' };
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
);
|
|
|