Skip to content

Commit

Permalink
refactor: mark disabled and checked as boolean values in lit temp…
Browse files Browse the repository at this point in the history
…lates.

PiperOrigin-RevId: 462716556
  • Loading branch information
material-web-copybara authored and copybara-github committed Jul 22, 2022
1 parent 42168d3 commit 10a6d35
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion button/lib/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export abstract class Button extends ActionElement implements ButtonState {

/** @soyTemplate */
protected renderRipple(): TemplateResult|string {
return html`<md-ripple class="md3-button__ripple" .disabled="${
return html`<md-ripple class="md3-button__ripple" ?disabled="${
this.disabled}"></md-ripple>`;
}

Expand Down
4 changes: 2 additions & 2 deletions checkbox/lib/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class Checkbox extends ActionElement {
/** @soyTemplate */
protected renderRipple(): TemplateResult {
return html`<md-ripple
.disabled="${this.disabled}"
?disabled="${this.disabled}"
unbounded></md-ripple>`;
}

Expand Down Expand Up @@ -158,7 +158,7 @@ export class Checkbox extends ActionElement {
data-indeterminate="${this.indeterminate ? 'true' : 'false'}"
?disabled="${this.disabled}"
.indeterminate="${this.indeterminate}"
.checked="${this.checked}"
?checked="${this.checked}"
.value="${this.value}"
@change="${this.handleChange}"
@focus="${this.handleFocus}"
Expand Down
2 changes: 1 addition & 1 deletion fab/lib/fab-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export abstract class FabShared extends ActionElement {

/** @soyTemplate */
protected renderRipple(): TemplateResult {
return html`<md-ripple class="md3-fab__ripple" .disabled="${
return html`<md-ripple class="md3-fab__ripple" ?disabled="${
this.disabled}"></md-ripple>`;
}

Expand Down
2 changes: 1 addition & 1 deletion field/test/field_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Field', () => {
return html`
<md-test-field
.label=${props.label}
.disabled=${props.disabled ?? false}
?disabled=${props.disabled ?? false}
.error=${props.error ?? false}
.populated=${props.populated ?? false}
.required=${props.required ?? false}
Expand Down
2 changes: 1 addition & 1 deletion field/test/filled-field_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Field', () => {
return html`
<md-test-filled-field
.label=${props.label}
.disabled=${props.disabled ?? false}
?disabled=${props.disabled ?? false}
.error=${props.error ?? false}
.populated=${props.populated ?? false}
.required=${props.required ?? false}
Expand Down
2 changes: 1 addition & 1 deletion field/test/outlined-field_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Field', () => {
return html`
<md-test-outlined-field
.label=${props.label}
.disabled=${props.disabled ?? false}
?disabled=${props.disabled ?? false}
.error=${props.error ?? false}
.populated=${props.populated ?? false}
.required=${props.required ?? false}
Expand Down
2 changes: 1 addition & 1 deletion iconbutton/lib/icon-button-toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export abstract class IconButtonToggle extends ActionElement {

/** @soyTemplate */
protected renderRipple(): TemplateResult {
return html`<md-ripple .disabled="${
return html`<md-ripple ?disabled="${
this.disabled}" unbounded> </md-ripple>`;
}

Expand Down
2 changes: 1 addition & 1 deletion iconbutton/lib/icon-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export abstract class IconButton extends ActionElement {

/** @soyTemplate */
protected renderRipple(): TemplateResult|string {
return html`<md-ripple .disabled="${
return html`<md-ripple ?disabled="${
this.disabled}" unbounded> </md-ripple>`;
}

Expand Down
6 changes: 3 additions & 3 deletions radio/lib/radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ export class Radio extends ActionElement {

/** @soyTemplate */
protected renderRipple(): TemplateResult|string {
return html`<md-ripple unbounded
.disabled="${this.disabled}"></md-ripple>`;
return html`<md-ripple unbounded
?disabled="${this.disabled}"></md-ripple>`;
}

/** @soyTemplate */
Expand Down Expand Up @@ -248,7 +248,7 @@ export class Radio extends ActionElement {
aria-label="${ifDefined(this.ariaLabel)}"
aria-labelledby="${ifDefined(this.ariaLabelledBy)}"
aria-describedby="${ifDefined(this.ariaDescribedBy)}"
.checked="${this.checked}"
?checked="${this.checked}"
.value="${this.value}"
?disabled="${this.disabled}"
@change="${this.changeHandler}"
Expand Down
4 changes: 2 additions & 2 deletions segmented_button/lib/segmented-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class SegmentedButton extends ActionElement {
tabindex="${this.disabled ? '-1' : '0'}"
aria-label="${ifDefined(this.ariaLabel)}"
aria-pressed=${this.selected}
.disabled=${this.disabled}
?disabled=${this.disabled}
@focus="${this.handleFocus}"
@blur="${this.handleBlur}"
@pointerdown="${this.handlePointerDown}"
Expand Down Expand Up @@ -159,7 +159,7 @@ export class SegmentedButton extends ActionElement {

/** @soyTemplate */
protected renderRipple(): TemplateResult|string {
return html`<md-ripple .disabled="${
return html`<md-ripple ?disabled="${
this.disabled}" class="md3-segmented-button__ripple"> </md-ripple>`;
}

Expand Down
4 changes: 2 additions & 2 deletions switch/lib/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class Switch extends ActionElement {
aria-checked="${this.selected}"
aria-label="${ifDefined(ariaLabelValue)}"
aria-labelledby="${ifDefined(ariaLabelledByValue)}"
.disabled=${this.disabled}
?disabled=${this.disabled}
@click=${this.handleClick}
@focus="${this.handleFocus}"
@blur="${this.handleBlur}"
Expand All @@ -95,7 +95,7 @@ export class Switch extends ActionElement {
type="checkbox"
aria-hidden="true"
name="${this.name}"
.checked=${this.selected}
?checked=${this.selected}
.value=${this.value}
>
`;
Expand Down
2 changes: 1 addition & 1 deletion textfield/filled-text-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class MdFilledTextField extends FilledTextField {
<md-filled-field
class="md3-text-field__field"
id=${this.fieldId}
.disabled=${this.disabled}
?disabled=${this.disabled}
.error=${this.error}
.label=${this.label}
.populated=${!!this.value}
Expand Down
2 changes: 1 addition & 1 deletion textfield/lib/filled-text-field_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TestTextField extends FilledTextField {
<md-filled-field
class="md3-text-field__field"
id=${this.fieldId}
.disabled=${this.disabled}
?disabled=${this.disabled}
.error=${this.error}
.label=${this.label}
.populated=${Boolean(this.value)}
Expand Down
2 changes: 1 addition & 1 deletion textfield/lib/outlined-text-field_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TestTextField extends OutlinedTextField {
<md-outlined-field
class="md3-text-field__field"
id=${this.fieldId}
.disabled=${this.disabled}
?disabled=${this.disabled}
.error=${this.error}
.label=${this.label}
.populated=${Boolean(this.value)}
Expand Down
2 changes: 1 addition & 1 deletion textfield/lib/text-field_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TestTextField extends TextField {
<md-filled-field
class="md3-text-field__field"
id=${this.fieldId}
.disabled=${this.disabled}
?disabled=${this.disabled}
.error=${this.error}
.label=${this.label}
.populated=${Boolean(this.value)}
Expand Down
2 changes: 1 addition & 1 deletion textfield/outlined-text-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class MdOutlinedTextField extends OutlinedTextField {
<md-outlined-field
class="md3-text-field__field"
id=${this.fieldId}
.disabled=${this.disabled}
?disabled=${this.disabled}
.error=${this.error}
.label=${this.label}
.populated=${!!this.value}
Expand Down

0 comments on commit 10a6d35

Please sign in to comment.