@duetds/components
Version:
This package includes Duet Components and related tools.
1 lines • 1.74 kB
JavaScript
System.register(["./p-dff1acd5.system.js"],function(e){"use strict";var t,n,r,u;return{setters:[function(e){t=e.r;n=e.c;r=e.h;u=e.g}],execute:function(){var o=function(){function e(e){t(this,e);this.radioButtons=[];this.direction="vertical";this.valueChanged=n(this,"valueChanged",7)}e.prototype.nameChanged=function(){this.updateButtons()};e.prototype.handleValueChange=function(){this.updateButtons()};e.prototype.disabledChanged=function(){this.updateButtons()};e.prototype.componentWillLoad=function(){var e=this;this.radioButtons=Array.from(this.element.querySelectorAll("duet-radio"));this.updateButtons();this.radioButtons.forEach(function(t){t.addEventListener("changed",function(t){return e.selectedRadioButtonChanged(t)})})};e.prototype.selectedRadioButtonChanged=function(e){this.value=e.target.value;this.valueChanged.emit(this.value);e.cancelBubble=true};e.prototype.updateButtons=function(){var e=this;this.radioButtons.forEach(function(t){t.name=e.name;t.groupDisabled=e.disabled;t.checked=t.value===e.value;t.groupDirection=e.direction})};e.prototype.render=function(){return r("slot",null)};Object.defineProperty(e.prototype,"element",{get:function(){return u(this)},enumerable:true,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{name:["nameChanged"],value:["handleValueChange"],disabled:["disabledChanged"]}},enumerable:true,configurable:true});Object.defineProperty(e,"style",{get:function(){return":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box;background:transparent;border:0;padding:0;margin:0;margin-bottom:12px;display:block;width:100%}"},enumerable:true,configurable:true});return e}();e("duet_radio_group",o)}}});