Skip to content

Commit

Permalink
refactor(hx-radio-set): refactor missing js props and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
catsiller committed Apr 30, 2019
1 parent 6172c61 commit 718f793
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/elements/hx-radio-set/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,31 @@
</dd>
</dl>
{% endblock %}

{% block properties %}
<dl class="memberList">
<dt>
isDirty {Boolean [false]}
<hx-pill class="hxSubBody" persist>read-only</hx-pill>
</dt>
<dd>
True if the <code>hx-dirty</code> attribute is present.
</dd>

<dt>
wasChanged {Boolean [false]}
<hx-pill class="hxSubBody" persist>read-only</hx-pill>
</dt>
<dd>
True if the <code>hx-changed</code> attribute is present.
</dd>

<dt>
wasTouched {Boolean [false]}
<hx-pill class="hxSubBody" persist>read-only</hx-pill>
</dt>
<dd>
True if the <code>hx-touched</code> attribute is present.
</dd>
</dl>
{% endblock %}
24 changes: 24 additions & 0 deletions src/helix-ui/elements/HXRadioSetElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,30 @@ export class HXRadioSetElement extends HXElement {
this.removeEventListener('hxtouch', this._onHxtouch);
}

/**
* @readonly
* @type {Boolean} [false]
*/
get isDirty () {
return this.hasAttribute(STATE.dirty);
}

/**
* @readonly
* @type {Boolean} [false]
*/
get wasChanged () {
return this.hasAttribute(STATE.changed);
}

/**
* @readonly
* @type {Boolean} [false]
*/
get wasTouched () {
return this.hasAttribute(STATE.touched);
}

/** @private */
_onHxchange (evt) {
evt.stopPropagation();
Expand Down
4 changes: 4 additions & 0 deletions src/helix-ui/styles/components/radios.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ hx-radio {
width: 1rem;
}

hx-radio-set {
display: block;
}

// LAYOUT GEOMETRY
hx-radio-control {
-ms-grid-column-align: start;
Expand Down

0 comments on commit 718f793

Please sign in to comment.