Skip to content

Commit

Permalink
Merge pull request #2 from samueldjack/custom-templates
Browse files Browse the repository at this point in the history
Enabled default template to be replaced
  • Loading branch information
istrau2 authored Mar 7, 2017
2 parents ffff993 + 4847900 commit 3baba3e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,20 @@ Then use as a custom element anywhere throughout your application:
```html
<aurelia-flatpickr config.bind="config" value.bind="value"></aurelia-flatpickr>
```
### Using Custom Input Groups
The default template for the input element can be replaced to customise the buttons available. Here's an example:

```html
<aurelia-flatpickr config.bind="{wrap:true}">
<div class="input-group aurelia-flatpickr">
<input type="text" class="form-control" placeholder="Select date" data-input>
<span class="input-group-btn">
<button class="btn btn-default" type="button" data-clear>Clear</button>
<button class="btn btn-default" type="button" data-toggle>Show</button>
</span>
</div>
</aurelia-flatpickr>
```
## Running The Tests

To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:
Expand Down
4 changes: 3 additions & 1 deletion dist/amd/aurelia-flatpickr.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<template>
<require from="flatpickr/dist/flatpickr.css"></require>
<input class="aurelia-flatpickr" type="text" placeholder="Select Date..">
<slot>
<input class="aurelia-flatpickr" type="text" placeholder="Select Date..">
<slot>
</template>
4 changes: 3 additions & 1 deletion dist/commonjs/aurelia-flatpickr.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<template>
<require from="flatpickr/dist/flatpickr.css"></require>
<input class="aurelia-flatpickr" type="text" placeholder="Select Date..">
<slot>
<input class="aurelia-flatpickr" type="text" placeholder="Select Date..">
<slot>
</template>
4 changes: 3 additions & 1 deletion dist/es2015/aurelia-flatpickr.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<template>
<require from="flatpickr/dist/flatpickr.css"></require>
<input class="aurelia-flatpickr" type="text" placeholder="Select Date..">
<slot>
<input class="aurelia-flatpickr" type="text" placeholder="Select Date..">
<slot>
</template>
4 changes: 3 additions & 1 deletion dist/system/aurelia-flatpickr.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<template>
<require from="flatpickr/dist/flatpickr.css"></require>
<input class="aurelia-flatpickr" type="text" placeholder="Select Date..">
<slot>
<input class="aurelia-flatpickr" type="text" placeholder="Select Date..">
<slot>
</template>
4 changes: 3 additions & 1 deletion src/aurelia-flatpickr.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<template>
<require from="flatpickr/dist/flatpickr.css"></require>
<input class="aurelia-flatpickr" type="text" placeholder="Select Date..">
<slot>
<input class="aurelia-flatpickr" type="text" placeholder="Select Date..">
<slot>
</template>

0 comments on commit 3baba3e

Please sign in to comment.