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.
44 lines
693 B
44 lines
693 B
import { Model } from '../common';
|
|
import CategoryView from './ModuleCategoryView';
|
|
|
|
export interface CategoryProperties {
|
|
/**
|
|
* Category id.
|
|
*/
|
|
id: string;
|
|
/**
|
|
* Category label.
|
|
*/
|
|
label: string;
|
|
/**
|
|
* Category open state.
|
|
* @default true
|
|
*/
|
|
open?: boolean;
|
|
/**
|
|
* Category order.
|
|
*/
|
|
order?: string | number;
|
|
/**
|
|
* Category attributes.
|
|
* @default {}
|
|
*/
|
|
attributes?: Record<string, any>;
|
|
}
|
|
|
|
export default class Category extends Model<CategoryProperties> {
|
|
view?: CategoryView;
|
|
|
|
defaults() {
|
|
return {
|
|
id: '',
|
|
label: '',
|
|
open: true,
|
|
attributes: {},
|
|
};
|
|
}
|
|
|
|
getId() {
|
|
return this.get('id')!;
|
|
}
|
|
}
|
|
|