remove guards that were added for old @watch

pull/366/head^2
Cory LaViska 2021-03-11 08:58:30 -05:00
rodzic c5614bfc95
commit 3b3aef7c63
9 zmienionych plików z 26 dodań i 40 usunięć

Wyświetl plik

@ -6,12 +6,16 @@ Components with the <sl-badge type="warning" pill>Experimental</sl-badge> badge
_During the beta period, these restrictions may be relaxed in the event of a mission-critical bug._ 🐛
## Next
- Improved `@watch` decorator so watch handlers don't run before the first render
- Removed guards that were added due to previous watch handler behavior
## 2.0.0-beta.31
- Add touch support to `sl-rating` [#362](https://github.com/shoelace-style/shoelace/pull/362)
- Fixed a bug where the `open` attribute on `sl-details` would prevent it from opening [#357](https://github.com/shoelace-style/shoelace/issues/357)
- Fixed event detail type parsing so component class names are shown instead of `default`
- Improved `@watch` decorator so watch handlers don't run before the first render
## 2.0.0-beta.30

Wyświetl plik

@ -105,11 +105,9 @@ export default class SlCheckbox extends LitElement {
}
handleStateChange() {
if (this.input) {
this.input.checked = this.checked;
this.input.indeterminate = this.indeterminate;
this.slChange.emit();
}
this.input.checked = this.checked;
this.input.indeterminate = this.indeterminate;
this.slChange.emit();
}
checkedChanged() {

Wyświetl plik

@ -162,9 +162,7 @@ export default class SlDetails extends LitElement {
@watch('open')
handleOpenChange() {
if (this.details) {
this.open ? this.show() : this.hide();
}
this.open ? this.show() : this.hide();
}
render() {

Wyświetl plik

@ -257,9 +257,7 @@ export default class SlInput extends LitElement {
@watch('value')
handleValueChange() {
if (this.input) {
this.invalid = !this.input.checkValidity();
}
this.invalid = !this.input.checkValidity();
}
render() {

Wyświetl plik

@ -32,9 +32,7 @@ export default class SlProgressRing extends LitElement {
@watch('percentage')
handlePercentageChange() {
if (this.indicator) {
this.updateProgress();
}
this.updateProgress();
}
updateProgress() {

Wyświetl plik

@ -89,13 +89,11 @@ export default class SlRadio extends LitElement {
@watch('checked')
handleCheckedChange() {
if (this.input) {
if (this.checked) {
this.getSiblingRadios().map(radio => (radio.checked = false));
}
this.input.checked = this.checked;
this.slChange.emit();
if (this.checked) {
this.getSiblingRadios().map(radio => (radio.checked = false));
}
this.input.checked = this.checked;
this.slChange.emit();
}
handleClick() {

Wyświetl plik

@ -22,13 +22,11 @@ export default class SlResponsiveEmbed extends LitElement {
@watch('aspectRatio')
updateAspectRatio() {
if (this.base) {
const split = this.aspectRatio.split(':');
const x = parseInt(split[0]);
const y = parseInt(split[1]);
const split = this.aspectRatio.split(':');
const x = parseInt(split[0]);
const y = parseInt(split[1]);
this.base.style.paddingBottom = x && y ? `${(y / x) * 100}%` : '';
}
this.base.style.paddingBottom = x && y ? `${(y / x) * 100}%` : '';
}
render() {

Wyświetl plik

@ -197,13 +197,11 @@ export default class SlTabGroup extends LitElement {
@watch('noScrollControls')
updateScrollControls() {
if (this.nav) {
if (this.noScrollControls) {
this.hasScrollControls = false;
} else {
this.hasScrollControls =
['top', 'bottom'].includes(this.placement) && this.nav.scrollWidth > this.nav.clientWidth;
}
if (this.noScrollControls) {
this.hasScrollControls = false;
} else {
this.hasScrollControls =
['top', 'bottom'].includes(this.placement) && this.nav.scrollWidth > this.nav.clientWidth;
}
}

Wyświetl plik

@ -214,9 +214,7 @@ export default class SlTextarea extends LitElement {
@watch('rows')
handleRowsChange() {
if (this.input) {
this.setTextareaHeight();
}
this.setTextareaHeight();
}
@watch('helpText')
@ -228,9 +226,7 @@ export default class SlTextarea extends LitElement {
@watch('value')
handleValueChange() {
if (this.input) {
this.invalid = !this.input.checkValidity();
}
this.invalid = !this.input.checkValidity();
}
setTextareaHeight() {