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.
33 lines
576 B
33 lines
576 B
import { Model } from 'common';
|
|
|
|
/**
|
|
* @typedef State
|
|
* @property {String} name State name, eg. `hover`, `nth-of-type(2n)`
|
|
* @property {String} label State label, eg. `Hover`, `Even/Odd`
|
|
*/
|
|
export default class State extends Model {
|
|
defaults() {
|
|
return {
|
|
name: '',
|
|
label: ''
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Get state name
|
|
* @returns {String}
|
|
*/
|
|
getName() {
|
|
return this.get('name');
|
|
}
|
|
|
|
/**
|
|
* Get state label
|
|
* @returns {String}
|
|
*/
|
|
getLabel() {
|
|
return this.get('label') || this.getName();
|
|
}
|
|
}
|
|
|
|
State.prototype.idAttribute = 'name';
|
|
|