You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Go to file
HerrHase add58b4084
adding
2 years ago
example adding 2 years ago
src adding 2 years ago
.gitignore Initial commit 3 years ago
LICENSE Initial commit 3 years ago
README.md adding 2 years ago
package-lock.json adding 2 years ago
package.json adding 2 years ago
webpack.mix.js adding 2 years ago

README.md

Tiny Components - Sidebar Form

Created with Riot.js

Handle Form in a Sidebar. Sidebar is from Plain-UI.

Install

npm install @tiny-components\sidebar-form --save

How to use

Create your own Component that will include a form. The Tiny Sidebar Form uses Slot.

<tiny-sidebar-form form-id="example-form" open={ state.isOpen } close={ () => { handleClose() }} loading={ state.isLoading }>

    <!-- slot:title -->
    <span slot="title">
        New
    </span>

    <!-- slot:header -->
    <form id="example-form" class="form" slot="form" onsubmit={ (event) => { handleSubmit(event) }}>
        <div class="field-group">
            <label class="field-label">
                Note
                <textarea class="field-text" name="name"></textarea>
            </label>
        </div>
    </form>

</tiny-sidebar-form>

You have to add the Mixin "sidebarFormMixin.js".

export default () => {
    return {

        ...sidebar,  // adding basic funtion for sidebar

Add Function to handle the submit.

handleSubmit(event) {
    event.preventDefault()

    this.state.isLoading = true
    this.update()
    ...

You can find a full Example in src/ and a running version under example/.