radh-ui
Version:
Stencil Component Starter
36 lines (30 loc) • 1.04 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-710e648a.js');
const radhLocaleSelectCss = "";
class RadhLocaleSelect {
constructor(hostRef) {
index.registerInstance(this, hostRef);
this.sendLocale = index.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 (index.h("div", null, index.h("select", { onChange: (ev) => this.handleSelect(ev) }, this.innerLocales.map(locale => index.h("option", { value: locale.value }, locale.name)))));
}
}
static get watchers() { return {
"locales": ["parseLocale"]
}; }
}
RadhLocaleSelect.style = radhLocaleSelectCss;
exports.radh_locale_select = RadhLocaleSelect;