mirror of https://github.com/artf/grapesjs.git
8 changed files with 265 additions and 33 deletions
@ -0,0 +1,122 @@ |
|||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> |
|||
|
|||
## Property |
|||
|
|||
|
|||
|
|||
### Properties |
|||
|
|||
* `id` **[String][1]** Property id, eg. `my-property-id`. |
|||
* `property` **[String][1]** Related CSS property name, eg. `text-align`. |
|||
* `label` **[String][1]** Label to use in UI, eg. `Text Align`. |
|||
* `default` **[String][1]** Defaul value of the property. |
|||
|
|||
### getId |
|||
|
|||
Get property id. |
|||
|
|||
Returns **[String][1]** |
|||
|
|||
### getType |
|||
|
|||
Get the property type. |
|||
The type of the property is defined on property creation and based on its value the proper Property class is assigned. |
|||
The default type is `base`. |
|||
|
|||
Returns **[String][1]** |
|||
|
|||
### getName |
|||
|
|||
Get name (the CSS property name). |
|||
|
|||
Returns **[String][1]** |
|||
|
|||
### getLabel |
|||
|
|||
Get property label. |
|||
|
|||
#### Parameters |
|||
|
|||
* `opts` **[Object][2]** Options (optional, default `{}`) |
|||
|
|||
* `opts.locale` **[Boolean][3]** Use the locale string from i18n module (optional, default `true`) |
|||
|
|||
Returns **[String][1]** |
|||
|
|||
### getValue |
|||
|
|||
Get property value. |
|||
|
|||
#### Parameters |
|||
|
|||
* `opts` **[Object][2]** Options (optional, default `{}`) |
|||
|
|||
* `opts.noDefault` **[Boolean][3]** Avoid returning the default value (optional, default `false`) |
|||
|
|||
Returns **[String][1]** |
|||
|
|||
### hasValue |
|||
|
|||
Check if the property has value. |
|||
|
|||
#### Parameters |
|||
|
|||
* `opts` **[Object][2]** Options (optional, default `{}`) |
|||
|
|||
* `opts.noParent` **[Boolean][3]** Ignore the value if it comes from the parent target. (optional, default `false`) |
|||
|
|||
Returns **[Boolean][3]** |
|||
|
|||
### getStyle |
|||
|
|||
Get the CSS style object of the property. |
|||
|
|||
#### Parameters |
|||
|
|||
* `opts` (optional, default `{}`) |
|||
|
|||
#### Examples |
|||
|
|||
```javascript |
|||
// In case the property is `color` with a value of `red`. |
|||
console.log(property.getStyle()); |
|||
// { color: 'red' }; |
|||
``` |
|||
|
|||
Returns **[Object][2]** |
|||
|
|||
### getDefaultValue |
|||
|
|||
Get the default value. |
|||
|
|||
Returns **[string][1]** |
|||
|
|||
### upValue |
|||
|
|||
Update the value. |
|||
The change is also propagated to the selected targets (eg. CSS rule). |
|||
|
|||
#### Parameters |
|||
|
|||
* `value` **[String][1]** New value |
|||
* `opts` **[Object][2]** Options (optional, default `{}`) |
|||
|
|||
* `opts.partial` **[Boolean][3]** If `true` the update on targets won't be considered complete (not stored in UndoManager) (optional, default `false`) |
|||
* `opts.noTarget` **[Boolean][3]** If `true` the change won't be propagated to selected targets. (optional, default `false`) |
|||
|
|||
### clear |
|||
|
|||
Clear the value. |
|||
The change is also propagated to the selected targets (eg. the css property is cleared). |
|||
|
|||
#### Parameters |
|||
|
|||
* `opts` **[Object][2]** Options (optional, default `{}`) |
|||
|
|||
* `opts.noTarget` **[Boolean][3]** If `true` the change won't be propagated to selected targets. (optional, default `false`) |
|||
|
|||
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String |
|||
|
|||
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object |
|||
|
|||
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean |
|||
Loading…
Reference in new issue