Open Web Components: guides, tools and libraries for developing web components.
MIT License
Bot releases are visible (Hide)
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
89fb5601: Add type entrypoint which enables you to get more advanced type information like
import { ScopedElementsHost } from '@open-wc/scoped-elements/types.js';
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] almost 2 years ago
Published by github-actions[bot] about 2 years ago
667b6786: Add "spread", "spreadEvents", and "spreadProps" directives to support spreading objects of data onto elements in a lit-html
template literal.
Example of spread
:
import { spread } from '@open-wc/lit-helpers';
const elementTemplate = (
obj = {
'my-attribute': 'foo',
'?my-boolean-attribute': true,
'@my-event': () => console.log('my-event fired'),
'.myProperty': { foo: 'bar' },
},
) => html` <custom-element ${spread(obj)}></custom-element> `;
Example of spreadEvents
:
import { spreadEvents } from '@open-wc/lit-helpers';
const elementTemplate = (
obj = {
'my-event': () => {
console.log('my-event');
},
'my-other-event': () => {
console.log('my-other-event');
},
'my-additional-event': () => {
console.log('my-additional-event');
},
},
) => html` <custom-element ${spreadEvents(obj)}></custom-element> `;
Example of spreadProps
:
import { spreadProps } from '@open-wc/lit-helpers';
const elementTemplate = (
obj = {
string: 'string',
number: 10,
array: ['This', 'is', 'an', 'array.'],
object: {
foo: 'bar',
baz: true,
bar: false,
},
},
) => html` <custom-element ${spreadProps(obj)}></custom-element> `;
Published by github-actions[bot] about 2 years ago