mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 20:19:13 +00:00
51 lines
1.4 KiB
Handlebars
51 lines
1.4 KiB
Handlebars
import { customElement, property } from 'lit/decorators.js';
|
|
import { html } from 'lit';
|
|
import { LocalizeController } from '../../utilities/localize.js';
|
|
import { watch } from '../../internal/watch.js';
|
|
import componentStyles from '../../styles/component.styles.js';
|
|
import styles from './test-element.styles.js';
|
|
import WebAwesomeElement from '../../internal/webawesome-element.js';
|
|
import type { CSSResultGroup } from 'lit';
|
|
|
|
/**
|
|
* @summary Short summary of the component's intended use.
|
|
* @documentation https://backers.webawesome.com/docs/components/{{ tagWithoutPrefix tag }}
|
|
* @status experimental
|
|
* @since 3.0
|
|
*
|
|
* @dependency wa-example
|
|
*
|
|
* @event wa-event-name - Emitted as an example.
|
|
*
|
|
* @slot - The default slot.
|
|
* @slot example - An example slot.
|
|
*
|
|
* @csspart base - The component's base wrapper.
|
|
*
|
|
* @cssproperty --example - An example CSS custom property.
|
|
*/
|
|
@customElement("{{ tag }}")
|
|
export default class {{ properCase tag }} extends WebAwesomeElement {
|
|
static styles: CSSResultGroup = [componentStyles, styles];
|
|
|
|
private readonly localize = new LocalizeController(this);
|
|
|
|
/** An example attribute. */
|
|
@property() attr = 'example';
|
|
|
|
@watch('example')
|
|
handleExampleChange() {
|
|
// do something
|
|
}
|
|
|
|
render() {
|
|
return html` <slot></slot> `;
|
|
}
|
|
}
|
|
|
|
declare global {
|
|
interface HTMLElementTagNameMap {
|
|
'{{ tag }}': {{ properCase tag }};
|
|
}
|
|
}
|