radh-ui
Version:
Stencil Component Starter
32 lines (28 loc) • 969 B
JavaScript
import { r as registerInstance, c as createEvent, h } from './index-a9700b09.js';
const radhLocaleSelectCss = "";
class RadhLocaleSelect {
constructor(hostRef) {
registerInstance(this, hostRef);
this.sendLocale = createEvent(this, "sendLocale", 7);
}
parseLocale(newValue) {
if (newValue)
this.innerLocales = JSON.parse(this.locales);
}
componentWillLoad() {
this.parseLocale(this.locales);
}
handleSelect(event) {
this.sendLocale.emit(event.target.value);
}
render() {
if (this.innerLocales) {
return (h("div", null, h("select", { onChange: (ev) => this.handleSelect(ev) }, this.innerLocales.map(locale => h("option", { value: locale.value }, locale.name)))));
}
}
static get watchers() { return {
"locales": ["parseLocale"]
}; }
}
RadhLocaleSelect.style = radhLocaleSelectCss;
export { RadhLocaleSelect as radh_locale_select };