Skip to content

Commit

Permalink
fix(style-binding): replace class-name.bind with class.bind
Browse files Browse the repository at this point in the history
`class-name.bind` replaces any existing classes on the element. This interferes with validation where `form-group` or `form-group-sm` are chosen via a binding.
  • Loading branch information
simonfox committed Jun 20, 2017
1 parent 8db7d8b commit 52283f9
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 21 deletions.
4 changes: 2 additions & 2 deletions dist/amd/checkbox.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<button click.delegate="checkboxSelected()" focus.bind="grabFocus" disabled.bind="!enabled" type="button" class="btn btn-link form-control checkbox noselect">
<div class="checkbox-selector ${enabled ? 'checkbox-selector-enabled' : 'checkbox-disabled'}">
<i class="${iconFamilyClass} ${ checked ? checkedIconClass : '' }"></i>
</div>
<div class-name.bind="'checkbox-label ' + (enabled ? '' : 'text-muted')">
<div class.bind="'checkbox-label ' + (enabled ? '' : 'text-muted')">
<slot><span>${label}</span></slot>
</div>
</button>
Expand Down
2 changes: 1 addition & 1 deletion dist/amd/currency-input.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<label if.bind="label.length > 0" for="${'au-currency-' + id}" class="control-label">${label}</label>
<input id="${'au-currency-' + id}" value.bind="displayValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" blur.trigger="blur()" selectonfocus type="text" autocomplete="off" class="form-control currency-input ${customCSS}" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion dist/amd/text-widget.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<label if.bind="label.length > 0" class="control-label">${label}</label>
<input if.bind="!multiline" value.bind="textValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" readonly.bind="readonly" blur.trigger="blur()" type="text" autocomplete="off" class="form-control" />
<textarea if.bind="multiline" value.bind="textValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" readonly.bind="readonly" blur.trigger="blur()" autcomplete="off" class="form-control"></textarea>
Expand Down
4 changes: 2 additions & 2 deletions dist/commonjs/checkbox.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<button click.delegate="checkboxSelected()" focus.bind="grabFocus" disabled.bind="!enabled" type="button" class="btn btn-link form-control checkbox noselect">
<div class="checkbox-selector ${enabled ? 'checkbox-selector-enabled' : 'checkbox-disabled'}">
<i class="${iconFamilyClass} ${ checked ? checkedIconClass : '' }"></i>
</div>
<div class-name.bind="'checkbox-label ' + (enabled ? '' : 'text-muted')">
<div class.bind="'checkbox-label ' + (enabled ? '' : 'text-muted')">
<slot><span>${label}</span></slot>
</div>
</button>
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/currency-input.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<label if.bind="label.length > 0" for="${'au-currency-' + id}" class="control-label">${label}</label>
<input id="${'au-currency-' + id}" value.bind="displayValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" blur.trigger="blur()" selectonfocus type="text" autocomplete="off" class="form-control currency-input ${customCSS}" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/text-widget.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<label if.bind="label.length > 0" class="control-label">${label}</label>
<input if.bind="!multiline" value.bind="textValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" readonly.bind="readonly" blur.trigger="blur()" type="text" autocomplete="off" class="form-control" />
<textarea if.bind="multiline" value.bind="textValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" readonly.bind="readonly" blur.trigger="blur()" autcomplete="off" class="form-control"></textarea>
Expand Down
4 changes: 2 additions & 2 deletions dist/es2015/checkbox.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<button click.delegate="checkboxSelected()" focus.bind="grabFocus" disabled.bind="!enabled" type="button" class="btn btn-link form-control checkbox noselect">
<div class="checkbox-selector ${enabled ? 'checkbox-selector-enabled' : 'checkbox-disabled'}">
<i class="${iconFamilyClass} ${ checked ? checkedIconClass : '' }"></i>
</div>
<div class-name.bind="'checkbox-label ' + (enabled ? '' : 'text-muted')">
<div class.bind="'checkbox-label ' + (enabled ? '' : 'text-muted')">
<slot><span>${label}</span></slot>
</div>
</button>
Expand Down
2 changes: 1 addition & 1 deletion dist/es2015/currency-input.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<label if.bind="label.length > 0" for="${'au-currency-' + id}" class="control-label">${label}</label>
<input id="${'au-currency-' + id}" value.bind="displayValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" blur.trigger="blur()" selectonfocus type="text" autocomplete="off" class="form-control currency-input ${customCSS}" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion dist/es2015/text-widget.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<label if.bind="label.length > 0" class="control-label">${label}</label>
<input if.bind="!multiline" value.bind="textValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" readonly.bind="readonly" blur.trigger="blur()" type="text" autocomplete="off" class="form-control" />
<textarea if.bind="multiline" value.bind="textValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" readonly.bind="readonly" blur.trigger="blur()" autcomplete="off" class="form-control"></textarea>
Expand Down
4 changes: 2 additions & 2 deletions dist/system/checkbox.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<button click.delegate="checkboxSelected()" focus.bind="grabFocus" disabled.bind="!enabled" type="button" class="btn btn-link form-control checkbox noselect">
<div class="checkbox-selector ${enabled ? 'checkbox-selector-enabled' : 'checkbox-disabled'}">
<i class="${iconFamilyClass} ${ checked ? checkedIconClass : '' }"></i>
</div>
<div class-name.bind="'checkbox-label ' + (enabled ? '' : 'text-muted')">
<div class.bind="'checkbox-label ' + (enabled ? '' : 'text-muted')">
<slot><span>${label}</span></slot>
</div>
</button>
Expand Down
2 changes: 1 addition & 1 deletion dist/system/currency-input.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<label if.bind="label.length > 0" for="${'au-currency-' + id}" class="control-label">${label}</label>
<input id="${'au-currency-' + id}" value.bind="displayValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" blur.trigger="blur()" selectonfocus type="text" autocomplete="off" class="form-control currency-input ${customCSS}" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion dist/system/text-widget.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<label if.bind="label.length > 0" class="control-label">${label}</label>
<input if.bind="!multiline" value.bind="textValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" readonly.bind="readonly" blur.trigger="blur()" type="text" autocomplete="off" class="form-control" />
<textarea if.bind="multiline" value.bind="textValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" readonly.bind="readonly" blur.trigger="blur()" autcomplete="off" class="form-control"></textarea>
Expand Down
3 changes: 3 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 2.0.4 (2017-06-20)


### 2.0.3 (2017-05-12)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-widgets",
"version": "2.0.3",
"version": "2.0.4",
"description": "A Collection of UI Widgets for use in Aurelia applications",
"homepage": "http://drivesoftware.co.nz",
"main": "index",
Expand Down
4 changes: 2 additions & 2 deletions src/checkbox.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<button click.delegate="checkboxSelected()" focus.bind="grabFocus" disabled.bind="!enabled" type="button" class="btn btn-link form-control checkbox noselect">
<div class="checkbox-selector ${enabled ? 'checkbox-selector-enabled' : 'checkbox-disabled'}">
<i class="${iconFamilyClass} ${ checked ? checkedIconClass : '' }"></i>
</div>
<div class-name.bind="'checkbox-label ' + (enabled ? '' : 'text-muted')">
<div class.bind="'checkbox-label ' + (enabled ? '' : 'text-muted')">
<slot><span>${label}</span></slot>
</div>
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/currency-input.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<label if.bind="label.length > 0" for="${'au-currency-' + id}" class="control-label">${label}</label>
<input id="${'au-currency-' + id}" value.bind="displayValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" blur.trigger="blur()" selectonfocus type="text" autocomplete="off" class="form-control currency-input ${customCSS}" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/text-widget.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class-name.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<div class.bind="'form-group ' + (small ? 'form-group-sm' : '')">
<label if.bind="label.length > 0" class="control-label">${label}</label>
<input if.bind="!multiline" value.bind="textValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" readonly.bind="readonly" blur.trigger="blur()" type="text" autocomplete="off" class="form-control" />
<textarea if.bind="multiline" value.bind="textValue" placeholder.bind="placeholder" focus.bind="grabFocus" disabled.bind="disabled" readonly.bind="readonly" blur.trigger="blur()" autcomplete="off" class="form-control"></textarea>
Expand Down

0 comments on commit 52283f9

Please sign in to comment.