From 7b0274a6574954dc3ff6063c9910043eaf693498 Mon Sep 17 00:00:00 2001 From: Lea Verou Date: Sat, 14 Dec 2024 19:51:04 -0500 Subject: [PATCH] Refactor: Normalize order of alternatives --- src/components/color-picker/color-picker.ts | 2 +- src/components/input/input.ts | 2 +- src/components/radio-group/radio-group.ts | 2 +- src/components/range/range.ts | 2 +- src/components/switch/switch.ts | 2 +- src/components/tooltip/tooltip.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/color-picker/color-picker.ts b/src/components/color-picker/color-picker.ts index 790b96bf8..41d07f1af 100644 --- a/src/components/color-picker/color-picker.ts +++ b/src/components/color-picker/color-picker.ts @@ -177,7 +177,7 @@ export default class WaColorPicker extends WebAwesomeFormAssociatedElement { } /** The default value of the form control. Primarily used for resetting the form control. */ - @property({ attribute: 'value', reflect: true }) defaultValue: null | string = this.getAttribute('value') || null; + @property({ attribute: 'value', reflect: true }) defaultValue: string | null = this.getAttribute('value') || null; @property({ attribute: 'with-label', reflect: true, type: Boolean }) withLabel = false; @property({ attribute: 'with-hint', reflect: true, type: Boolean }) withHint = false; diff --git a/src/components/input/input.ts b/src/components/input/input.ts index 41c8fdbb5..6ec900581 100644 --- a/src/components/input/input.ts +++ b/src/components/input/input.ts @@ -116,7 +116,7 @@ export default class WaInput extends WebAwesomeFormAssociatedElement { } /** The default value of the form control. Primarily used for resetting the form control. */ - @property({ attribute: 'value', reflect: true }) defaultValue: null | string = this.getAttribute('value') || null; + @property({ attribute: 'value', reflect: true }) defaultValue: string | null = this.getAttribute('value') || null; /** The input's size. */ @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium'; diff --git a/src/components/radio-group/radio-group.ts b/src/components/radio-group/radio-group.ts index ccdf10b0f..1f78b9ef9 100644 --- a/src/components/radio-group/radio-group.ts +++ b/src/components/radio-group/radio-group.ts @@ -99,7 +99,7 @@ export default class WaRadioGroup extends WebAwesomeFormAssociatedElement { } /** The default value of the form control. Primarily used for resetting the form control. */ - @property({ attribute: 'value', reflect: true }) defaultValue: null | string = this.getAttribute('value') || null; + @property({ attribute: 'value', reflect: true }) defaultValue: string | null = this.getAttribute('value') || null; /** The radio group's size. This size will be applied to all child radios and radio buttons. */ @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium'; diff --git a/src/components/range/range.ts b/src/components/range/range.ts index ff805d56a..f58e3fd7a 100644 --- a/src/components/range/range.ts +++ b/src/components/range/range.ts @@ -126,7 +126,7 @@ export default class WaRange extends WebAwesomeFormAssociatedElement { * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in * the same document or shadow root for this to work. */ - @property({ reflect: true }) form: null | string = null; + @property({ reflect: true }) form: string | null = null; /** * Used for SSR to render slotted labels. If true, will render slotted label content on first paint. diff --git a/src/components/switch/switch.ts b/src/components/switch/switch.ts index 7e43149f9..8e2d64025 100644 --- a/src/components/switch/switch.ts +++ b/src/components/switch/switch.ts @@ -90,7 +90,7 @@ export default class WaSwitch extends WebAwesomeFormAssociatedElement { } /** The default value of the form control. Primarily used for resetting the form control. */ - @property({ attribute: 'value', reflect: true }) defaultValue: null | string = this.getAttribute('value') || null; + @property({ attribute: 'value', reflect: true }) defaultValue: string | null = this.getAttribute('value') || null; /** The switch's size. */ @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium'; diff --git a/src/components/tooltip/tooltip.ts b/src/components/tooltip/tooltip.ts index 02127c79a..d5cfe4918 100644 --- a/src/components/tooltip/tooltip.ts +++ b/src/components/tooltip/tooltip.ts @@ -103,7 +103,7 @@ export default class WaTooltip extends WebAwesomeElement { */ @property({ type: Boolean }) hoist = false; - @property() for: null | string = null; + @property() for: string | null = null; @state() anchor: null | Element = null;