ldx-widgets
Version:
widgets
135 lines (101 loc) • 2.24 kB
Markdown
[<< Component Index](../README.md)
# [Form](https://github.com/tmfi/ldx-web-utilities/blob/develop/src/components/form.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: 'Create'
handler: @create
disabled: no
}
]
```
### children
**`Element`**
_Required_
React element (or array of elements) to inserted as the form body
### styleOverride
**`Object`**
_Optional_
aphrodite style object, optionally can contain .form, .title, .bar, .btn, .class defs, eg...
```
{
formBase: {}
form: {}
title: {}
bar: {}
btn: {}
}
```
### canUpdate
**`Boolean`**
_Optional_
Defaults to no, whether or not the user can update and save the form
### save
**`Function`**
_Optional_
Function that save the form
### close
**`Function`**
_Optional_
Function that closes the form
### 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
### loading
**`Boolean`**
_Optional_
Defaults to no, whether or not to show the spinner instead of the children
### 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
### unSavedMessage
_Optional_
Message to be displayed in dialog if you have unsaved changes