How to use hybrids - 10 common examples

To help you get started, we’ve selected a few hybrids examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vogloblinsky / web-components-benchmark / todomvc / hybrids / js / todo-input.js View on Github external
border: 0;
        outline: none;
        color: inherit;
        padding: 6px;
        border: 1px solid #CCC;
        box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);
        box-sizing: border-box;
    }

<form id="new-todo-form">
    <input placeholder="What needs to be done?" type="text" id="new-todo">
</form>
      `,
};

define('todo-input', TodoInput);
github vogloblinsky / web-components-benchmark / todomvc / hybrids / js / my-todo.js View on Github external
#list-container {
        margin: 0;
        padding: 0;
        list-style: none;
        border-top: 1px solid #e6e6e6;
    }
    
    <h1>Todos Hybrids</h1>
    
    <ul id="list-container">
        ${list.map((element, index) =&gt; html``)}
    </ul>
    `,
};

define('my-todo', MyTodo);
github vogloblinsky / web-components-benchmark / pascal-triangle / hybrids / js / pascal-triangle.js View on Github external
html`
                            <div>
                                ${
                                    line.map(item =&gt;
                                        html``.key(item)
                                    )
                                }
                            </div>
                        `
                )
            }
        
    `
};

define('pascal-triangle', PascalTriangle);
github vogloblinsky / web-components-benchmark / todomvc / hybrids / js / todo-item.js View on Github external
margin-bottom: 11px;
        transition: color 0.2s ease-out;
    }

    li.item .destroy:hover {
        color: #af5b5e;
    }

<li class="item">
    <input type="checkbox">
    <label>${text}</label>
    <button class="destroy">x</button>
</li>`,
};

define('todo-item', TodoItem);
github vogloblinsky / web-components-benchmark / todomvc / hybrids / js / todo-input.js View on Github external
const onSubmit = (host, e) => {
    e.preventDefault();
    dispatch(host, 'submit', {
        detail: host.val
    });
    let $input = host.shadowRoot.querySelector('#new-todo');
    $input.value = '';
    $input.blur();
}
github vogloblinsky / web-components-benchmark / todomvc / hybrids / js / todo-item.js View on Github external
const onchange = (host, event) => {
    dispatch(host, 'checked', {
        detail: parseInt(host.index)
    });
};
github vogloblinsky / web-components-benchmark / todomvc / hybrids / js / todo-item.js View on Github external
const onclick = (host, event) => {
    dispatch(host, 'removed', {
        detail: parseInt(host.index)
    });
};
github vogloblinsky / web-components-benchmark / todomvc / hybrids / js / todo-item.js View on Github external
} from 'hybrids';

const onchange = (host, event) =&gt; {
    dispatch(host, 'checked', {
        detail: parseInt(host.index)
    });
};

const onclick = (host, event) =&gt; {
    dispatch(host, 'removed', {
        detail: parseInt(host.index)
    });
};

const TodoItem = {
    text: property('text'),
    checked: property('checked'),
    index: property('index'),
    render: ({
        text
    }) =&gt; html `
    <style>
    :host {
        display: block;
    }

    li.item {
        font-size: 24px;
        display: block;
        position: relative;
        border-bottom: 1px solid #ededed;
    }</style>
github vogloblinsky / web-components-benchmark / todomvc / hybrids / js / todo-item.js View on Github external
const onchange = (host, event) =&gt; {
    dispatch(host, 'checked', {
        detail: parseInt(host.index)
    });
};

const onclick = (host, event) =&gt; {
    dispatch(host, 'removed', {
        detail: parseInt(host.index)
    });
};

const TodoItem = {
    text: property('text'),
    checked: property('checked'),
    index: property('index'),
    render: ({
        text
    }) =&gt; html `
    <style>
    :host {
        display: block;
    }

    li.item {
        font-size: 24px;
        display: block;
        position: relative;
        border-bottom: 1px solid #ededed;
    }
</style>
github vogloblinsky / web-components-benchmark / todomvc / hybrids / js / todo-item.js View on Github external
const onchange = (host, event) =&gt; {
    dispatch(host, 'checked', {
        detail: parseInt(host.index)
    });
};

const onclick = (host, event) =&gt; {
    dispatch(host, 'removed', {
        detail: parseInt(host.index)
    });
};

const TodoItem = {
    text: property('text'),
    checked: property('checked'),
    index: property('index'),
    render: ({
        text
    }) =&gt; html `
    <style>
    :host {
        display: block;
    }

    li.item {
        font-size: 24px;
        display: block;
        position: relative;
        border-bottom: 1px solid #ededed;
    }

    li.item input {</style>

hybrids

A JavaScript framework for creating fully-featured web applications, components libraries, and single web components with unique declarative and functional architecture

MIT
Latest version published 2 days ago

Package Health Score

87 / 100
Full package analysis