@orcden/odp-event-registration-form
Version:
OrcDen Platform Event Registration Form Component
89 lines (69 loc) • 3.07 kB
Markdown
> A component to register for events on ODP.
`<odp-event-registration-form>` is a complex component that can be configured to accept event data from ODP and provide a registration form. It generates and object that can be sent back to ODP to register the user.
- Install with [npm](https://www.npmjs.com/)
```
npm i @orcden/odp-event-registration-form
```
```
import '@orcden/odp-event-registration-form';
```
```
<script>
function httpGet( theUrl ) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
xmlHttp.send( null );
return JSON.parse( xmlHttp.responseText );
}
document.querySelector( '#form' ).eventData = httpGet( 'YOUR ODP EVENT ENDPOINT HERE' );
</script>
<odp-event-registration-form id='form' inline is-member></odp-event-registration-form>
```
| Attribute | Type | Default | Description |
|-----------|---------|---------|-----------------------------------------------------------------------------------------|
| `inline` | Boolean | true | Useful for mobile, set to false to decrease width. |
| `is-member` | Boolean | false | Used to set member prices display and calculation |
| `closed` | Boolean | false | Can be used to manually display the registration closed message. |
| Attribute | Type | Default | Description |
|-----------|---------|---------|-----------------------------------------------------------------------------------------|
| `eventData` | Object | {} | Get. Set. The form requires this to build itself. |
| `inline` | Boolean | true | Useful for mobile, set to false to decrease width. |
| `isMember` | Boolean | false | Used to set member prices display and calculation |
| `invalidMessage` | String | "" | Get Only, used with validation; if the form fails display this. |
| `closed` | Boolean | false | Can be used to manually display the registration closed message. |
| Name | Parameters | Description |
|-----------|------|-----------------------------------------------|
| `getData` | None | Get the event registration data |
| `validate` | None | Validates if the required info has been filled out |
| Shadow Parts | Description |
|------------------|-----------------------|
| ex. mode-item-title | The div used to house the title slot |
| ... | Find the associated part in the DOM for now; docs to be updated |
```
npm run demo
```
```
npm run lint
```
```
npm run fix
```
```
npm run test
```
```
npm run build
```