ldx-widgets
Version:
widgets
138 lines (103 loc) • 2.42 kB
Markdown
[<< Component Index](../README.md)
# [Modal](https://github.com/tmfi/ldx-web-utilities/blob/develop/src/components/modal.coffee)
## Mixins: `dialogueMixin`
### title
**`String`**
_Optional_
title for the modal header
### buttons
**`Array`**
_Optional_
Array of button objects with name, handler to be called on click, and disabled boolean, eg...
```
[
{
name: 'Save'
handler: @save
disabled: no
}
]
```
### children
**`Element`**
_Required_
React element (or array of elements) to inserted as the modal body
### styleOverride
**`Object`**
_Optional_
aphrodite style object, optionally can contain .modal, .header, .title, .actionButton class defs, eg...
```
{
modalBase: {}
modalEnter: {}
modal: {}
header: {}
title: {}
actionButton: {}
}
```
### close
**`Function`**
_Optional_
Function that closes the overlay, passed automatically by the overlay framework
### onClose
**`Function`**
_Optional_
Function that is called right before the modal closes
### showClose
**`Boolean`**
_Optional_
Defaults to yes, set it to no to not show the close button
### closeAfterSave
**`Boolean`**
_Optional_
### close
_Optional_
Note: in this case you MUST pass an onSaveComplete handler that sets the saveState to null after a save
### onSaveComplete
**`Function`**
_Optional_
Function that is called right after the saveState is set to complete and the success indicator finishes animating
### closeBtnText
**`String`**
_Optional_
Defaults to 'Cancel', text to display in the close button
### animateIn
**`Boolean`**
_Optional_
Defaults to yes, whether or not to bouce the modal on enter
### loading
**`Boolean`**
_Optional_
Defaults to no, whether or not to show the spinner instead of the children
### draggable
**`Boolean`**
_Optional_
Defaults to yes, whether or not the modal can be dragged from it's header
### stopPropagation
**`Boolean`**
_Optional_
Defaults to yes, whether or not the modal stop click from bubbling above it
### displayProgressBar
**`Boolean`**
_Optional_
Defaults to no, whether or not the confirm/save show the progress bar instead of the spinner
### uploadProgress
_Optional_
Progress of a file being uploaded