From 2ea5b65cb860172a35940b61450527529416075a Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Wed, 30 Jun 2021 20:04:46 -0400 Subject: [PATCH] remove redundant types --- src/components/alert/alert.ts | 4 ++-- src/components/animation/animation.ts | 16 +++++++-------- src/components/badge/badge.ts | 4 ++-- src/components/button-group/button-group.ts | 2 +- src/components/button/button.ts | 12 +++++------ src/components/checkbox/checkbox.ts | 10 +++++----- src/components/color-picker/color-picker.ts | 18 ++++++++--------- src/components/details/details.ts | 4 ++-- src/components/dialog/dialog.ts | 6 +++--- src/components/drawer/drawer.ts | 8 ++++---- src/components/dropdown/dropdown.ts | 12 +++++------ src/components/form/form.ts | 2 +- src/components/format-bytes/format-bytes.ts | 2 +- src/components/format-number/format-number.ts | 6 +++--- src/components/icon-button/icon-button.ts | 4 ++-- src/components/icon/icon.ts | 2 +- .../image-comparer/image-comparer.ts | 2 +- src/components/include/include.ts | 2 +- src/components/input/input.ts | 18 ++++++++--------- src/components/menu-item/menu-item.ts | 6 +++--- src/components/progress-bar/progress-bar.ts | 4 ++-- src/components/progress-ring/progress-ring.ts | 4 ++-- src/components/qr-code/qr-code.ts | 12 +++++------ src/components/radio-group/radio-group.ts | 4 ++-- src/components/radio/radio.ts | 6 +++--- src/components/range/range.ts | 18 ++++++++--------- src/components/rating/rating.ts | 10 +++++----- src/components/relative-time/relative-time.ts | 2 +- .../responsive-media/responsive-media.ts | 2 +- src/components/select/select.ts | 20 +++++++++---------- src/components/switch/switch.ts | 8 ++++---- src/components/tab-group/tab-group.ts | 2 +- src/components/tab-panel/tab-panel.ts | 4 ++-- src/components/tab/tab.ts | 8 ++++---- src/components/tag/tag.ts | 4 ++-- src/components/textarea/textarea.ts | 14 ++++++------- src/components/tooltip/tooltip.ts | 12 +++++------ 37 files changed, 137 insertions(+), 137 deletions(-) diff --git a/src/components/alert/alert.ts b/src/components/alert/alert.ts index 522b6fcf6..84569cb9c 100644 --- a/src/components/alert/alert.ts +++ b/src/components/alert/alert.ts @@ -44,10 +44,10 @@ export default class SlAlert extends LitElement { @query('[part="base"]') base: HTMLElement; /** Indicates whether or not the alert is open. You can use this in lieu of the show/hide methods. */ - @property({ type: Boolean, reflect: true }) open: boolean = false; + @property({ type: Boolean, reflect: true }) open = false; /** Makes the alert closable. */ - @property({ type: Boolean, reflect: true }) closable: boolean = false; + @property({ type: Boolean, reflect: true }) closable = false; /** The type of alert. */ @property({ reflect: true }) type: 'primary' | 'success' | 'info' | 'warning' | 'danger' = 'primary'; diff --git a/src/components/animation/animation.ts b/src/components/animation/animation.ts index 9866c19de..840b9755f 100644 --- a/src/components/animation/animation.ts +++ b/src/components/animation/animation.ts @@ -25,25 +25,25 @@ export default class SlAnimation extends LitElement { @queryAsync('slot') defaultSlot: Promise; /** The name of the built-in animation to use. For custom animations, use the `keyframes` prop. */ - @property() name: string = 'none'; + @property() name = 'none'; /** The number of milliseconds to delay the start of the animation. */ - @property({ type: Number }) delay: number = 0; + @property({ type: Number }) delay = 0; /** Determines the direction of playback as well as the behavior when reaching the end of an iteration. */ @property() direction: PlaybackDirection = 'normal'; /** The number of milliseconds each iteration of the animation takes to complete. */ - @property({ type: Number }) duration: number = 1000; + @property({ type: Number }) duration = 1000; /** * The easing function to use for the animation. This can be a Shoelace easing function or a custom easing function * such as `cubic-bezier(0, 1, .76, 1.14)`. */ - @property() easing: string = 'linear'; + @property() easing = 'linear'; /** The number of milliseconds to delay after the active period of an animation sequence. */ - @property({ attribute: 'end-delay', type: Number }) endDelay: number = 0; + @property({ attribute: 'end-delay', type: Number }) endDelay = 0; /** Sets how the animation applies styles to its target before and after its execution. */ @property() fill: FillMode = 'auto'; @@ -52,7 +52,7 @@ export default class SlAnimation extends LitElement { @property({ type: Number }) iterations: number = Infinity; /** The offset at which to start the animation, usually between 0 (start) and 1 (end). */ - @property({ attribute: 'iteration-start', type: Number }) iterationStart: number = 0; + @property({ attribute: 'iteration-start', type: Number }) iterationStart = 0; /** The keyframes to use for the animation. If this is set, `name` will be ignored. */ @property({ attribute: false }) keyframes: Keyframe[]; @@ -62,10 +62,10 @@ export default class SlAnimation extends LitElement { * to `2`, for example, will double the animation's speed. A negative value can be used to reverse the animation. This * value can be changed without causing the animation to restart. */ - @property({ attribute: 'playback-rate', type: Number }) playbackRate: number = 1; + @property({ attribute: 'playback-rate', type: Number }) playbackRate = 1; /** Pauses the animation. The animation will resume when this prop is removed. */ - @property({ type: Boolean }) pause: boolean = false; + @property({ type: Boolean }) pause = false; connectedCallback() { super.connectedCallback(); diff --git a/src/components/badge/badge.ts b/src/components/badge/badge.ts index 867661d3e..595c472fc 100644 --- a/src/components/badge/badge.ts +++ b/src/components/badge/badge.ts @@ -19,10 +19,10 @@ export default class SlBadge extends LitElement { @property({ reflect: true }) type: 'primary' | 'success' | 'info' | 'warning' | 'danger' = 'primary'; /** Draws a pill-style badge with rounded edges. */ - @property({ type: Boolean, reflect: true }) pill: boolean = false; + @property({ type: Boolean, reflect: true }) pill = false; /** Makes the badge pulsate to draw attention. */ - @property({ type: Boolean, reflect: true }) pulse: boolean = false; + @property({ type: Boolean, reflect: true }) pulse = false; render() { return html` diff --git a/src/components/button-group/button-group.ts b/src/components/button-group/button-group.ts index b8a4da4b2..ed729b86a 100644 --- a/src/components/button-group/button-group.ts +++ b/src/components/button-group/button-group.ts @@ -17,7 +17,7 @@ export default class SlButtonGroup extends LitElement { @query('slot') defaultSlot: HTMLSlotElement; /** A label to use for the button group's `aria-label` attribute. */ - @property() label: string = ''; + @property() label = ''; handleFocus(event: CustomEvent) { const button = findButton(event.target as HTMLElement); diff --git a/src/components/button/button.ts b/src/components/button/button.ts index ae2945161..c34b4bc08 100644 --- a/src/components/button/button.ts +++ b/src/components/button/button.ts @@ -44,22 +44,22 @@ export default class SlButton extends LitElement { @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium'; /** Draws the button with a caret for use with dropdowns, popovers, etc. */ - @property({ type: Boolean, reflect: true }) caret: boolean = false; + @property({ type: Boolean, reflect: true }) caret = false; /** Disables the button. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** Draws the button in a loading state. */ - @property({ type: Boolean, reflect: true }) loading: boolean = false; + @property({ type: Boolean, reflect: true }) loading = false; /** Draws a pill-style button with rounded edges. */ - @property({ type: Boolean, reflect: true }) pill: boolean = false; + @property({ type: Boolean, reflect: true }) pill = false; /** Draws a circle button. */ - @property({ type: Boolean, reflect: true }) circle: boolean = false; + @property({ type: Boolean, reflect: true }) circle = false; /** Indicates if activating the button should submit the form. Ignored when `href` is set. */ - @property({ type: Boolean, reflect: true }) submit: boolean = false; + @property({ type: Boolean, reflect: true }) submit = false; /** An optional name for the button. Ignored when `href` is set. */ @property() name: string; diff --git a/src/components/checkbox/checkbox.ts b/src/components/checkbox/checkbox.ts index 93cf6b772..913cbc4f9 100644 --- a/src/components/checkbox/checkbox.ts +++ b/src/components/checkbox/checkbox.ts @@ -42,19 +42,19 @@ export default class SlCheckbox extends LitElement { @property() value: string; /** Disables the checkbox. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** Makes the checkbox a required field. */ - @property({ type: Boolean, reflect: true }) required: boolean = false; + @property({ type: Boolean, reflect: true }) required = false; /** Draws the checkbox in a checked state. */ - @property({ type: Boolean, reflect: true }) checked: boolean = false; + @property({ type: Boolean, reflect: true }) checked = false; /** Draws the checkbox in an indeterminate state. */ - @property({ type: Boolean, reflect: true }) indeterminate: boolean = false; + @property({ type: Boolean, reflect: true }) indeterminate = false; /** This will be true when the control is in an invalid state. Validity is determined by the `required` prop. */ - @property({ type: Boolean, reflect: true }) invalid: boolean = false; + @property({ type: Boolean, reflect: true }) invalid = false; firstUpdated() { this.invalid = !this.input.checkValidity(); diff --git a/src/components/color-picker/color-picker.ts b/src/components/color-picker/color-picker.ts index 30227e31e..f0ba5b61b 100644 --- a/src/components/color-picker/color-picker.ts +++ b/src/components/color-picker/color-picker.ts @@ -60,7 +60,7 @@ export default class SlColorPicker extends LitElement { @state() private showCopyFeedback = false; /** The current color. */ - @property() value: string = '#ffffff'; + @property() value = '#ffffff'; /** * The format to use for the display value. If opacity is enabled, these will translate to HEXA, RGBA, and HSLA @@ -70,37 +70,37 @@ export default class SlColorPicker extends LitElement { @property() format: 'hex' | 'rgb' | 'hsl' = 'hex'; /** Renders the color picker inline rather than inside a dropdown. */ - @property({ type: Boolean, reflect: true }) inline: boolean = false; + @property({ type: Boolean, reflect: true }) inline = false; /** Determines the size of the color picker's trigger. This has no effect on inline color pickers. */ @property() size: 'small' | 'medium' | 'large' = 'medium'; /** Removes the format toggle. */ - @property({ attribute: 'no-format-toggle', type: Boolean }) noFormatToggle: boolean = false; + @property({ attribute: 'no-format-toggle', type: Boolean }) noFormatToggle = false; /** The input's name attribute. */ - @property() name: string = ''; + @property() name = ''; /** Disables the color picker. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** * This will be true when the control is in an invalid state. Validity is determined by the `setCustomValidity()` * method using the browser's constraint validation API. */ - @property({ type: Boolean, reflect: true }) invalid: boolean = false; + @property({ type: Boolean, reflect: true }) invalid = false; /** * Enable this option to prevent the panel from being clipped when the component is placed inside a container with * `overflow: auto|scroll`. */ - @property({ type: Boolean }) hoist: boolean = false; + @property({ type: Boolean }) hoist = false; /** Whether to show the opacity slider. */ - @property({ type: Boolean }) opacity: boolean = false; + @property({ type: Boolean }) opacity = false; /** By default, the value will be set in lowercase. Set this to true to set it in uppercase instead. */ - @property({ type: Boolean }) uppercase: boolean = false; + @property({ type: Boolean }) uppercase = false; /** * An array of predefined color swatches to display. Can include any format the color picker can parse, including diff --git a/src/components/details/details.ts b/src/components/details/details.ts index 05714cde0..b70e47fe1 100644 --- a/src/components/details/details.ts +++ b/src/components/details/details.ts @@ -45,13 +45,13 @@ export default class SlDetails extends LitElement { private componentId = `details-${++id}`; /** Indicates whether or not the details is open. You can use this in lieu of the show/hide methods. */ - @property({ type: Boolean, reflect: true }) open: boolean = false; + @property({ type: Boolean, reflect: true }) open = false; /** The summary to show in the details header. If you need to display HTML, use the `summary` slot instead. */ @property() summary: string; /** Disables the details so it can't be toggled. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; connectedCallback() { super.connectedCallback(); diff --git a/src/components/dialog/dialog.ts b/src/components/dialog/dialog.ts index 0e78b9bab..e4266c19e 100644 --- a/src/components/dialog/dialog.ts +++ b/src/components/dialog/dialog.ts @@ -72,19 +72,19 @@ export default class SlDialog extends LitElement { @state() private hasFooter = false; /** Indicates whether or not the dialog is open. You can use this in lieu of the show/hide methods. */ - @property({ type: Boolean, reflect: true }) open: boolean = false; + @property({ type: Boolean, reflect: true }) open = false; /** * The dialog's label as displayed in the header. You should always include a relevant label even when using * `no-header`, as it is required for proper accessibility. */ - @property({ reflect: true }) label: string = ''; + @property({ reflect: true }) label = ''; /** * Disables the header. This will also remove the default close button, so please ensure you provide an easy, * accessible way for users to dismiss the dialog. */ - @property({ attribute: 'no-header', type: Boolean, reflect: true }) noHeader: boolean = false; + @property({ attribute: 'no-header', type: Boolean, reflect: true }) noHeader = false; connectedCallback() { super.connectedCallback(); diff --git a/src/components/drawer/drawer.ts b/src/components/drawer/drawer.ts index 33fe6d709..763c2edf3 100644 --- a/src/components/drawer/drawer.ts +++ b/src/components/drawer/drawer.ts @@ -80,13 +80,13 @@ export default class SlDrawer extends LitElement { @state() private hasFooter = false; /** Indicates whether or not the drawer is open. You can use this in lieu of the show/hide methods. */ - @property({ type: Boolean, reflect: true }) open: boolean = false; + @property({ type: Boolean, reflect: true }) open = false; /** * The drawer's label as displayed in the header. You should always include a relevant label even when using * `no-header`, as it is required for proper accessibility. */ - @property({ reflect: true }) label: string = ''; + @property({ reflect: true }) label = ''; /** The direction from which the drawer will open. */ @property({ reflect: true }) placement: 'top' | 'end' | 'bottom' | 'start' = 'end'; @@ -95,13 +95,13 @@ export default class SlDrawer extends LitElement { * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of * its parent element, set this prop and add `position: relative` to the parent. */ - @property({ type: Boolean, reflect: true }) contained: boolean = false; + @property({ type: Boolean, reflect: true }) contained = false; /** * Removes the header. This will also remove the default close button, so please ensure you provide an easy, * accessible way for users to dismiss the drawer. */ - @property({ attribute: 'no-header', type: Boolean, reflect: true }) noHeader: boolean = false; + @property({ attribute: 'no-header', type: Boolean, reflect: true }) noHeader = false; connectedCallback() { super.connectedCallback(); diff --git a/src/components/dropdown/dropdown.ts b/src/components/dropdown/dropdown.ts index c110854d3..7210fbc70 100644 --- a/src/components/dropdown/dropdown.ts +++ b/src/components/dropdown/dropdown.ts @@ -46,7 +46,7 @@ export default class SlDropdown extends LitElement { private popover: PopperInstance; /** Indicates whether or not the dropdown is open. You can use this in lieu of the show/hide methods. */ - @property({ type: Boolean, reflect: true }) open: boolean = false; + @property({ type: Boolean, reflect: true }) open = false; /** * The preferred placement of the dropdown panel. Note that the actual placement may vary as needed to keep the panel @@ -67,25 +67,25 @@ export default class SlDropdown extends LitElement { | 'left-end' = 'bottom-start'; /** Disables the dropdown so the panel will not open. */ - @property({ type: Boolean }) disabled: boolean = false; + @property({ type: Boolean }) disabled = false; /** Determines whether the dropdown should hide when a menu item is selected. */ - @property({ attribute: 'close-on-select', type: Boolean, reflect: true }) closeOnSelect: boolean = true; + @property({ attribute: 'close-on-select', type: Boolean, reflect: true }) closeOnSelect = true; /** The dropdown will close when the user interacts outside of this element (e.g. clicking). */ @property({ attribute: false }) containingElement: HTMLElement; /** The distance in pixels from which to offset the panel away from its trigger. */ - @property({ type: Number }) distance: number = 2; + @property({ type: Number }) distance = 2; /** The distance in pixels from which to offset the panel along its trigger. */ - @property({ type: Number }) skidding: number = 0; + @property({ type: Number }) skidding = 0; /** * Enable this option to prevent the panel from being clipped when the component is placed inside a container with * `overflow: auto|scroll`. */ - @property({ type: Boolean }) hoist: boolean = false; + @property({ type: Boolean }) hoist = false; connectedCallback() { super.connectedCallback(); diff --git a/src/components/form/form.ts b/src/components/form/form.ts index 941155a6c..b6077c85b 100644 --- a/src/components/form/form.ts +++ b/src/components/form/form.ts @@ -41,7 +41,7 @@ export default class SlForm extends LitElement { private formControls: FormControl[]; /** Prevent the form from validating inputs before submitting. */ - @property({ type: Boolean, reflect: true }) novalidate: boolean = false; + @property({ type: Boolean, reflect: true }) novalidate = false; connectedCallback() { super.connectedCallback(); diff --git a/src/components/format-bytes/format-bytes.ts b/src/components/format-bytes/format-bytes.ts index fd1189609..8696bfdd9 100644 --- a/src/components/format-bytes/format-bytes.ts +++ b/src/components/format-bytes/format-bytes.ts @@ -9,7 +9,7 @@ import { formatBytes } from '../../internal/number'; @customElement('sl-format-bytes') export default class SlFormatBytes extends LitElement { /** The number to format in bytes. */ - @property({ type: Number }) value: number = 0; + @property({ type: Number }) value = 0; /** The unit to display. */ @property() unit: 'bytes' | 'bits' = 'bytes'; diff --git a/src/components/format-number/format-number.ts b/src/components/format-number/format-number.ts index ec8c1bf98..66533708a 100644 --- a/src/components/format-number/format-number.ts +++ b/src/components/format-number/format-number.ts @@ -8,7 +8,7 @@ import { customElement, property } from 'lit/decorators.js'; @customElement('sl-format-number') export default class SlFormatNumber extends LitElement { /** The number to format. */ - @property({ type: Number }) value: number = 0; + @property({ type: Number }) value = 0; /** The locale to use when formatting the number. */ @property() locale: string; @@ -17,10 +17,10 @@ export default class SlFormatNumber extends LitElement { @property() type: 'currency' | 'decimal' | 'percent' = 'decimal'; /** Turns off grouping separators. */ - @property({ attribute: 'no-grouping', type: Boolean }) noGrouping: boolean = false; + @property({ attribute: 'no-grouping', type: Boolean }) noGrouping = false; /** The currency to use when formatting. Must be an ISO 4217 currency code such as `USD` or `EUR`. */ - @property() currency: string = 'USD'; + @property() currency = 'USD'; /** How to display the currency. */ @property({ attribute: 'currency-display' }) currencyDisplay: 'symbol' | 'narrowSymbol' | 'code' | 'name' = 'symbol'; diff --git a/src/components/icon-button/icon-button.ts b/src/components/icon-button/icon-button.ts index be5a8d63b..5363d3efe 100644 --- a/src/components/icon-button/icon-button.ts +++ b/src/components/icon-button/icon-button.ts @@ -32,10 +32,10 @@ export default class SlIconButton extends LitElement { * A description that gets read by screen readers and other assistive devices. For optimal accessibility, you should * always include a label that describes what the icon button does. */ - @property() label: string = ''; + @property() label = ''; /** Disables the button. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; connectedCallback() { super.connectedCallback(); diff --git a/src/components/icon/icon.ts b/src/components/icon/icon.ts index 4c904fe2b..252d89f9e 100644 --- a/src/components/icon/icon.ts +++ b/src/components/icon/icon.ts @@ -34,7 +34,7 @@ export default class SlIcon extends LitElement { @property() label: string; /** The name of a registered custom icon library. */ - @property() library: string = 'default'; + @property() library = 'default'; connectedCallback() { super.connectedCallback(); diff --git a/src/components/image-comparer/image-comparer.ts b/src/components/image-comparer/image-comparer.ts index ea11dd905..cc8a03917 100644 --- a/src/components/image-comparer/image-comparer.ts +++ b/src/components/image-comparer/image-comparer.ts @@ -35,7 +35,7 @@ export default class SlImageComparer extends LitElement { @query('.image-comparer__handle') handle: HTMLElement; /** The position of the divider as a percentage. */ - @property({ type: Number, reflect: true }) position: number = 50; + @property({ type: Number, reflect: true }) position = 50; handleDrag(event: any) { const { width } = this.base.getBoundingClientRect(); diff --git a/src/components/include/include.ts b/src/components/include/include.ts index 51e582c25..081711d57 100644 --- a/src/components/include/include.ts +++ b/src/components/include/include.ts @@ -26,7 +26,7 @@ export default class SlInclude extends LitElement { * Allows included scripts to be executed. You must ensure the content you're including is trusted, otherwise this * option can lead to XSS vulnerabilities in your app! */ - @property({ attribute: 'allow-scripts', type: Boolean }) allowScripts: boolean = false; + @property({ attribute: 'allow-scripts', type: Boolean }) allowScripts = false; executeScript(script: HTMLScriptElement) { // Create a copy of the script and swap it out so the browser executes it diff --git a/src/components/input/input.ts b/src/components/input/input.ts index db9fc7dd7..4e67af6b9 100644 --- a/src/components/input/input.ts +++ b/src/components/input/input.ts @@ -67,31 +67,31 @@ export default class SlInput extends LitElement { @property() name: string; /** The input's value attribute. */ - @property() value: string = ''; + @property() value = ''; /** Draws a pill-style input with rounded edges. */ - @property({ type: Boolean, reflect: true }) pill: boolean = false; + @property({ type: Boolean, reflect: true }) pill = false; /** The input's label. Alternatively, you can use the label slot. */ @property() label: string; /** The input's help text. Alternatively, you can use the help-text slot. */ - @property({ attribute: 'help-text' }) helpText: string = ''; + @property({ attribute: 'help-text' }) helpText = ''; /** Adds a clear button when the input is populated. */ - @property({ type: Boolean }) clearable: boolean = false; + @property({ type: Boolean }) clearable = false; /** Adds a password toggle button to password inputs. */ - @property({ attribute: 'toggle-password', type: Boolean }) togglePassword: boolean = false; + @property({ attribute: 'toggle-password', type: Boolean }) togglePassword = false; /** The input's placeholder text. */ @property() placeholder: string; /** Disables the input. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** Makes the input readonly. */ - @property({ type: Boolean, reflect: true }) readonly: boolean = false; + @property({ type: Boolean, reflect: true }) readonly = false; /** The minimum length of input that will be considered valid. */ @property({ type: Number }) minlength: number; @@ -112,13 +112,13 @@ export default class SlInput extends LitElement { @property() pattern: string; /** Makes the input a required field. */ - @property({ type: Boolean, reflect: true }) required: boolean = false; + @property({ type: Boolean, reflect: true }) required = false; /** * This will be true when the control is in an invalid state. Validity is determined by props such as `type`, * `required`, `minlength`, `maxlength`, and `pattern` using the browser's constraint validation API. */ - @property({ type: Boolean, reflect: true }) invalid: boolean = false; + @property({ type: Boolean, reflect: true }) invalid = false; /** The input's autocaptialize attribute. */ @property() autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'; diff --git a/src/components/menu-item/menu-item.ts b/src/components/menu-item/menu-item.ts index 5e1b0c12e..ca38f3089 100644 --- a/src/components/menu-item/menu-item.ts +++ b/src/components/menu-item/menu-item.ts @@ -29,13 +29,13 @@ export default class SlMenuItem extends LitElement { @state() private hasFocus = false; /** Draws the item in a checked state. */ - @property({ type: Boolean, reflect: true }) checked: boolean = false; + @property({ type: Boolean, reflect: true }) checked = false; /** A unique value to store in the menu item. This can be used as a way to identify menu items when selected. */ - @property() value: string = ''; + @property() value = ''; /** Draws the menu item in a disabled state. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** Sets focus on the button. */ focus(options?: FocusOptions) { diff --git a/src/components/progress-bar/progress-bar.ts b/src/components/progress-bar/progress-bar.ts index f8a9727b2..0e805839a 100644 --- a/src/components/progress-bar/progress-bar.ts +++ b/src/components/progress-bar/progress-bar.ts @@ -24,10 +24,10 @@ export default class SlProgressBar extends LitElement { static styles = unsafeCSS(styles); /** The progress bar's percentage, 0 to 100. */ - @property({ type: Number, reflect: true }) percentage: number = 0; + @property({ type: Number, reflect: true }) percentage = 0; /** When true, percentage is ignored, the label is hidden, and the progress bar is drawn in an indeterminate state. */ - @property({ type: Boolean, reflect: true }) indeterminate: boolean = false; + @property({ type: Boolean, reflect: true }) indeterminate = false; render() { return html` diff --git a/src/components/progress-ring/progress-ring.ts b/src/components/progress-ring/progress-ring.ts index 30a221a93..ed03a9417 100644 --- a/src/components/progress-ring/progress-ring.ts +++ b/src/components/progress-ring/progress-ring.ts @@ -22,10 +22,10 @@ export default class SlProgressRing extends LitElement { @query('.progress-ring__indicator') indicator: SVGCircleElement; /** The size of the progress ring in pixels. */ - @property({ type: Number }) size: number = 128; + @property({ type: Number }) size = 128; /** The stroke width of the progress ring in pixels. */ - @property({ attribute: 'stroke-width', type: Number }) strokeWidth: number = 4; + @property({ attribute: 'stroke-width', type: Number }) strokeWidth = 4; /** The current progress percentage, 0 - 100. */ @property({ type: Number, reflect: true }) percentage: number; diff --git a/src/components/qr-code/qr-code.ts b/src/components/qr-code/qr-code.ts index 3805c5d8f..24945423e 100644 --- a/src/components/qr-code/qr-code.ts +++ b/src/components/qr-code/qr-code.ts @@ -18,22 +18,22 @@ export default class SlQrCode extends LitElement { @query('canvas') canvas: HTMLElement; /** The QR code's value. */ - @property() value: string = ''; + @property() value = ''; /** The label used when screen readers announce the code. If unspecified, the value will be used. */ - @property() label: string = ''; + @property() label = ''; /** The size of the code's overall square in pixels. */ - @property({ type: Number }) size: number = 128; + @property({ type: Number }) size = 128; /** The fill color. This can be any valid CSS color, but not a CSS custom property. */ - @property() fill: string = '#000'; + @property() fill = '#000'; /** The background color. This can be any valid CSS color or `transparent`, but not a CSS custom property. */ - @property() background: string = '#fff'; + @property() background = '#fff'; /** The edge radius of each module. Must be between 0 and 0.5. */ - @property({ type: Number }) radius: number = 0; + @property({ type: Number }) radius = 0; /** The level of error correction to use. */ @property({ attribute: 'error-correction' }) errorCorrection: 'L' | 'M' | 'Q' | 'H' = 'H'; diff --git a/src/components/radio-group/radio-group.ts b/src/components/radio-group/radio-group.ts index 2670755a2..9a2c68a47 100644 --- a/src/components/radio-group/radio-group.ts +++ b/src/components/radio-group/radio-group.ts @@ -18,10 +18,10 @@ export default class SlRadioGroup extends LitElement { static styles = unsafeCSS(styles); /** The radio group label. Required for proper accessibility. Alternatively, you can use the label slot. */ - @property() label: string = ''; + @property() label = ''; /** Hides the fieldset and legend that surrounds the radio group. The label will still be read by screen readers. */ - @property({ type: Boolean, attribute: 'no-fieldset' }) noFieldset: boolean = false; + @property({ type: Boolean, attribute: 'no-fieldset' }) noFieldset = false; render() { return html` diff --git a/src/components/radio/radio.ts b/src/components/radio/radio.ts index a393c1cdd..d14f893b2 100644 --- a/src/components/radio/radio.ts +++ b/src/components/radio/radio.ts @@ -41,16 +41,16 @@ export default class SlRadio extends LitElement { @property() value: string; /** Disables the radio. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** Draws the radio in a checked state. */ - @property({ type: Boolean, reflect: true }) checked: boolean = false; + @property({ type: Boolean, reflect: true }) checked = false; /** * This will be true when the control is in an invalid state. Validity in range inputs is determined by the message * provided by the `setCustomValidity` method. */ - @property({ type: Boolean, reflect: true }) invalid: boolean = false; + @property({ type: Boolean, reflect: true }) invalid = false; /** Simulates a click on the radio. */ click() { diff --git a/src/components/range/range.ts b/src/components/range/range.ts index 0ea39d408..53d58fba9 100644 --- a/src/components/range/range.ts +++ b/src/components/range/range.ts @@ -43,34 +43,34 @@ export default class SlRange extends LitElement { @state() private hasTooltip = false; /** The input's name attribute. */ - @property() name: string = ''; + @property() name = ''; /** The input's value attribute. */ - @property({ type: Number }) value: number = 0; + @property({ type: Number }) value = 0; /** The range's label. Alternatively, you can use the label slot. */ - @property() label: string = ''; + @property() label = ''; /** The range's help text. Alternatively, you can use the help-text slot. */ - @property({ attribute: 'help-text' }) helpText: string = ''; + @property({ attribute: 'help-text' }) helpText = ''; /** Disables the input. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** * This will be true when the control is in an invalid state. Validity in range inputs is determined by the message * provided by the `setCustomValidity` method. */ - @property({ type: Boolean, reflect: true }) invalid: boolean = false; + @property({ type: Boolean, reflect: true }) invalid = false; /** The input's min attribute. */ - @property({ type: Number }) min: number = 0; + @property({ type: Number }) min = 0; /** The input's max attribute. */ - @property({ type: Number }) max: number = 100; + @property({ type: Number }) max = 100; /** The input's step attribute. */ - @property({ type: Number }) step: number = 1; + @property({ type: Number }) step = 1; /** The preferred placedment of the tooltip. */ @property() tooltip: 'top' | 'bottom' | 'none' = 'top'; diff --git a/src/components/rating/rating.ts b/src/components/rating/rating.ts index f8a3acf14..8ddbefc83 100644 --- a/src/components/rating/rating.ts +++ b/src/components/rating/rating.ts @@ -34,19 +34,19 @@ export default class SlRating extends LitElement { @state() private isHovering = false; /** The current rating. */ - @property({ type: Number }) value: number = 0; + @property({ type: Number }) value = 0; /** The highest rating to show. */ - @property({ type: Number }) max: number = 5; + @property({ type: Number }) max = 5; /** The minimum increment value allowed by the control. */ - @property({ type: Number }) precision: number = 1; + @property({ type: Number }) precision = 1; /** Makes the rating readonly. */ - @property({ type: Boolean, reflect: true }) readonly: boolean = false; + @property({ type: Boolean, reflect: true }) readonly = false; /** Disables the rating. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** The name of the icon to display as the symbol. */ // @ts-ignore diff --git a/src/components/relative-time/relative-time.ts b/src/components/relative-time/relative-time.ts index c3e5247a8..86b15a5c2 100644 --- a/src/components/relative-time/relative-time.ts +++ b/src/components/relative-time/relative-time.ts @@ -30,7 +30,7 @@ export default class SlRelativeTime extends LitElement { @property() numeric: 'always' | 'auto' = 'auto'; /** Keep the displayed value up to date as time passes. */ - @property({ type: Boolean }) sync: boolean = false; + @property({ type: Boolean }) sync = false; disconnectedCallback() { super.disconnectedCallback(); diff --git a/src/components/responsive-media/responsive-media.ts b/src/components/responsive-media/responsive-media.ts index 956d25afa..28905966e 100644 --- a/src/components/responsive-media/responsive-media.ts +++ b/src/components/responsive-media/responsive-media.ts @@ -17,7 +17,7 @@ export default class SlResponsiveMedia extends LitElement { * The aspect ratio of the embedded media in the format of `width:height`, e.g. `16:9`, `4:3`, or `1:1`. Ratios not in * this format will be ignored. */ - @property({ attribute: 'aspect-ratio' }) aspectRatio: string = '16:9'; + @property({ attribute: 'aspect-ratio' }) aspectRatio = '16:9'; /** Determines how content will be resized to fit its container. */ @property() fit: 'cover' | 'contain' = 'cover'; diff --git a/src/components/select/select.ts b/src/components/select/select.ts index e2d68dc63..f10cc13fe 100644 --- a/src/components/select/select.ts +++ b/src/components/select/select.ts @@ -68,22 +68,22 @@ export default class SlSelect extends LitElement { @state() private displayTags: TemplateResult[] = []; /** Enables multiselect. With this enabled, value will be an array. */ - @property({ type: Boolean, reflect: true }) multiple: boolean = false; + @property({ type: Boolean, reflect: true }) multiple = false; /** * The maximum number of tags to show when `multiple` is true. After the maximum, "+n" will be shown to indicate the * number of additional items that are selected. Set to -1 to remove the limit. */ - @property({ attribute: 'max-tags-visible', type: Number }) maxTagsVisible: number = 3; + @property({ attribute: 'max-tags-visible', type: Number }) maxTagsVisible = 3; /** Disables the select control. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** The select's name. */ - @property() name: string = ''; + @property() name = ''; /** The select's placeholder text. */ - @property() placeholder: string = ''; + @property() placeholder = ''; /** The select's size. */ @property() size: 'small' | 'medium' | 'large' = 'medium'; @@ -92,13 +92,13 @@ export default class SlSelect extends LitElement { * Enable this option to prevent the panel from being clipped when the component is placed inside a container with * `overflow: auto|scroll`. */ - @property({ type: Boolean }) hoist: boolean = false; + @property({ type: Boolean }) hoist = false; /** The value of the control. This will be a string or an array depending on `multiple`. */ @property() value: string | Array = ''; /** Draws a pill-style select with rounded edges. */ - @property({ type: Boolean, reflect: true }) pill: boolean = false; + @property({ type: Boolean, reflect: true }) pill = false; /** The select's label. Alternatively, you can use the label slot. */ @property() label: string; @@ -107,13 +107,13 @@ export default class SlSelect extends LitElement { @property({ attribute: 'help-text' }) helpText: string; /** The select's required attribute. */ - @property({ type: Boolean, reflect: true }) required: boolean = false; + @property({ type: Boolean, reflect: true }) required = false; /** Adds a clear button when the select is populated. */ - @property({ type: Boolean }) clearable: boolean = false; + @property({ type: Boolean }) clearable = false; /** This will be true when the control is in an invalid state. Validity is determined by the `required` prop. */ - @property({ type: Boolean, reflect: true }) invalid: boolean = false; + @property({ type: Boolean, reflect: true }) invalid = false; connectedCallback() { super.connectedCallback(); diff --git a/src/components/switch/switch.ts b/src/components/switch/switch.ts index b89b21bdb..6490dbb1a 100644 --- a/src/components/switch/switch.ts +++ b/src/components/switch/switch.ts @@ -45,16 +45,16 @@ export default class SlSwitch extends LitElement { @property() value: string; /** Disables the switch. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** Makes the switch a required field. */ - @property({ type: Boolean, reflect: true }) required: boolean = false; + @property({ type: Boolean, reflect: true }) required = false; /** Draws the switch in a checked state. */ - @property({ type: Boolean, reflect: true }) checked: boolean = false; + @property({ type: Boolean, reflect: true }) checked = false; /** This will be true when the control is in an invalid state. Validity is determined by the `required` prop. */ - @property({ type: Boolean, reflect: true }) invalid: boolean = false; + @property({ type: Boolean, reflect: true }) invalid = false; firstUpdated() { this.invalid = !this.input.checkValidity(); diff --git a/src/components/tab-group/tab-group.ts b/src/components/tab-group/tab-group.ts index 319e69372..0c91aa9be 100644 --- a/src/components/tab-group/tab-group.ts +++ b/src/components/tab-group/tab-group.ts @@ -58,7 +58,7 @@ export default class SlTabGroup extends LitElement { @property() activation: 'auto' | 'manual' = 'auto'; /** Disables the scroll arrows that appear when tabs overflow. */ - @property({ attribute: 'no-scroll-controls', type: Boolean }) noScrollControls: boolean = false; + @property({ attribute: 'no-scroll-controls', type: Boolean }) noScrollControls = false; connectedCallback() { super.connectedCallback(); diff --git a/src/components/tab-panel/tab-panel.ts b/src/components/tab-panel/tab-panel.ts index 3610392a9..ecebc5ff1 100644 --- a/src/components/tab-panel/tab-panel.ts +++ b/src/components/tab-panel/tab-panel.ts @@ -19,10 +19,10 @@ export default class SlTabPanel extends LitElement { private componentId = `tab-panel-${++id}`; /** The tab panel's name. */ - @property() name: string = ''; + @property() name = ''; /** When true, the tab panel will be shown. */ - @property({ type: Boolean, reflect: true }) active: boolean = false; + @property({ type: Boolean, reflect: true }) active = false; connectedCallback() { super.connectedCallback(); diff --git a/src/components/tab/tab.ts b/src/components/tab/tab.ts index c69df6549..770223964 100644 --- a/src/components/tab/tab.ts +++ b/src/components/tab/tab.ts @@ -30,16 +30,16 @@ export default class SlTab extends LitElement { private componentId = `tab-${++id}`; /** The name of the tab panel the tab will control. The panel must be located in the same tab group. */ - @property() panel: string = ''; + @property() panel = ''; /** Draws the tab in an active state. */ - @property({ type: Boolean, reflect: true }) active: boolean = false; + @property({ type: Boolean, reflect: true }) active = false; /** Makes the tab closable and shows a close icon. */ - @property({ type: Boolean }) closable: boolean = false; + @property({ type: Boolean }) closable = false; /** Draws the tab in a disabled state. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** Sets focus to the tab. */ focus(options?: FocusOptions) { diff --git a/src/components/tag/tag.ts b/src/components/tag/tag.ts index 2e966c574..a9670ffc4 100644 --- a/src/components/tag/tag.ts +++ b/src/components/tag/tag.ts @@ -29,10 +29,10 @@ export default class SlTag extends LitElement { @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium'; /** Draws a pill-style tag with rounded edges. */ - @property({ type: Boolean, reflect: true }) pill: boolean = false; + @property({ type: Boolean, reflect: true }) pill = false; /** Makes the tag clearable. */ - @property({ type: Boolean }) clearable: boolean = false; + @property({ type: Boolean }) clearable = false; handleClearClick() { emit(this, 'sl-clear'); diff --git a/src/components/textarea/textarea.ts b/src/components/textarea/textarea.ts index 0ade9ba6c..1e972719a 100644 --- a/src/components/textarea/textarea.ts +++ b/src/components/textarea/textarea.ts @@ -50,28 +50,28 @@ export default class SlTextarea extends LitElement { @property() name: string; /** The textarea's value attribute. */ - @property() value: string = ''; + @property() value = ''; /** The textarea's label. Alternatively, you can use the label slot. */ @property() label: string; /** The textarea's help text. Alternatively, you can use the help-text slot. */ - @property({ attribute: 'help-text' }) helpText: string = ''; + @property({ attribute: 'help-text' }) helpText = ''; /** The textarea's placeholder text. */ @property() placeholder: string; /** The number of rows to display by default. */ - @property({ type: Number }) rows: number = 4; + @property({ type: Number }) rows = 4; /** Controls how the textarea can be resized. */ @property() resize: 'none' | 'vertical' | 'auto' = 'vertical'; /** Disables the textarea. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** Makes the textarea readonly. */ - @property({ type: Boolean, reflect: true }) readonly: boolean = false; + @property({ type: Boolean, reflect: true }) readonly = false; /** The minimum length of input that will be considered valid. */ @property({ type: Number }) minlength: number; @@ -83,13 +83,13 @@ export default class SlTextarea extends LitElement { @property() pattern: string; /** Makes the textarea a required field. */ - @property({ type: Boolean, reflect: true }) required: boolean = false; + @property({ type: Boolean, reflect: true }) required = false; /** * This will be true when the control is in an invalid state. Validity is determined by props such as `type`, * `required`, `minlength`, and `maxlength` using the browser's constraint validation API. */ - @property({ type: Boolean, reflect: true }) invalid: boolean = false; + @property({ type: Boolean, reflect: true }) invalid = false; /** The textarea's autocaptialize attribute. */ @property() autocapitalize: diff --git a/src/components/tooltip/tooltip.ts b/src/components/tooltip/tooltip.ts index 2b6b56c39..f18114d14 100644 --- a/src/components/tooltip/tooltip.ts +++ b/src/components/tooltip/tooltip.ts @@ -44,7 +44,7 @@ export default class SlTooltip extends LitElement { private hoverTimeout: any; /** The tooltip's content. Alternatively, you can use the content slot. */ - @property() content: string = ''; + @property() content = ''; /** * The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip @@ -65,23 +65,23 @@ export default class SlTooltip extends LitElement { | 'left-end' = 'top'; /** Disables the tooltip so it won't show when triggered. */ - @property({ type: Boolean, reflect: true }) disabled: boolean = false; + @property({ type: Boolean, reflect: true }) disabled = false; /** The distance in pixels from which to offset the tooltip away from its target. */ - @property({ type: Number }) distance: number = 10; + @property({ type: Number }) distance = 10; /** Indicates whether or not the tooltip is open. You can use this in lieu of the show/hide methods. */ - @property({ type: Boolean, reflect: true }) open: boolean = false; + @property({ type: Boolean, reflect: true }) open = false; /** The distance in pixels from which to offset the tooltip along its target. */ - @property({ type: Number }) skidding: number = 0; + @property({ type: Number }) skidding = 0; /** * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple * options can be passed by separating them with a space. When manual is used, the tooltip must be activated * programmatically. */ - @property() trigger: string = 'hover focus'; + @property() trigger = 'hover focus'; connectedCallback() { super.connectedCallback();