UNPKG

radh-ui

Version:

Stencil Component Starter

37 lines (36 loc) 1.42 kB
import { r as registerInstance, c as createEvent, h } from './index-a9700b09.js'; var radhLocaleSelectCss = ""; var RadhLocaleSelect = /** @class */ (function () { function RadhLocaleSelect(hostRef) { registerInstance(this, hostRef); this.sendLocale = createEvent(this, "sendLocale", 7); } RadhLocaleSelect.prototype.parseLocale = function (newValue) { if (newValue) this.innerLocales = JSON.parse(this.locales); }; RadhLocaleSelect.prototype.componentWillLoad = function () { this.parseLocale(this.locales); }; RadhLocaleSelect.prototype.handleSelect = function (event) { this.sendLocale.emit(event.target.value); }; RadhLocaleSelect.prototype.render = function () { var _this = this; if (this.innerLocales) { return (h("div", null, h("select", { onChange: function (ev) { return _this.handleSelect(ev); } }, this.innerLocales.map(function (locale) { return h("option", { value: locale.value }, locale.name); })))); } }; Object.defineProperty(RadhLocaleSelect, "watchers", { get: function () { return { "locales": ["parseLocale"] }; }, enumerable: false, configurable: true }); return RadhLocaleSelect; }()); RadhLocaleSelect.style = radhLocaleSelectCss; export { RadhLocaleSelect as radh_locale_select };