Skip to content

Commit

Permalink
Merge pull request #1285 from adopted-ember-addons/chore/remove-no-im…
Browse files Browse the repository at this point in the history
…plicit-this

chore: remove no-implicit-this lint errors
  • Loading branch information
mansona authored Oct 23, 2024
2 parents e0f875b + 1328c7c commit f010099
Show file tree
Hide file tree
Showing 58 changed files with 516 additions and 531 deletions.
4 changes: 2 additions & 2 deletions addon/components/paper-button.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{! template-lint-disable no-curly-component-invocation no-implicit-this }}
{{! template-lint-disable no-curly-component-invocation }}
{{#if (has-block)}}
{{yield}}
{{else}}
{{label}}
{{@label}}
{{/if}}

<PaperRipple
Expand Down
5 changes: 2 additions & 3 deletions addon/components/paper-card-media.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{! template-lint-disable no-implicit-this }}
{{#if (has-block)}}
<div class="md-media-{{size}}">
<div class="md-media-{{this.size}}">
{{yield}}
</div>
{{else}}
<img class="md-media-{{size}}" src={{src}} alt={{alt}} title={{title}}>
<img class="md-media-{{this.size}}" src={{@src}} alt={{@alt}} title={{@title}}>
{{/if}}
5 changes: 2 additions & 3 deletions addon/components/paper-card-title-media.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{! template-lint-disable no-implicit-this }}
{{#if (has-block)}}
<div class="md-media-{{size}}">
<div class="md-media-{{this.size}}">
{{yield}}
</div>
{{else}}
<img class="md-media-{{size}}" src={{src}} alt={{alt}} title={{title}}>
<img class="md-media-{{this.size}}" src={{@src}} alt={{@alt}} title={{@title}}>
{{/if}}
8 changes: 4 additions & 4 deletions addon/components/paper-checkbox.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{! template-lint-disable no-curly-component-invocation no-implicit-this }}
{{! template-lint-disable no-curly-component-invocation }}
<div class="md-container">
<div class="md-icon"></div>
<PaperRipple
Expand All @@ -7,14 +7,14 @@
</div>
{{#if (has-block)}}
<div class="md-label">
<span id={{labelId}}>
<span id={{this.labelId}}>
{{yield}}
</span>
</div>
{{else}}
<div class="md-label">
<span id={{labelId}}>
{{label}}
<span id={{this.labelId}}>
{{@label}}
</span>
</div>
{{/if}}
5 changes: 2 additions & 3 deletions addon/components/paper-contact-chips/template.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{! template-lint-disable no-implicit-this }}
<md-contact-chips class="md-default-theme {{@class}}" ...attributes>
<PaperChips
class="md-contact-chips"
Expand All @@ -25,9 +24,9 @@

{{#if (eq type "chip")}}
<div class="md-contact-avatar">
<img src={{get item imageField}} alt={{get item nameField}}>
<img src={{get item this.imageField}} alt={{get item this.nameField}}>
</div>
<span class="md-contact-name">{{get item nameField}}</span>
<span class="md-contact-name">{{get item this.nameField}}</span>
{{/if}}

</PaperChips>
Expand Down
10 changes: 5 additions & 5 deletions addon/components/paper-dialog.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{! template-lint-disable no-action no-implicit-this }}
{{#in-element destinationEl insertBefore=null}}
<PaperBackdrop @locked-open={{isLockedOpen}} @opaque={{opaque}} @fixed={{unless parent true}} @class="md-dialog-backdrop" @onClick={{action "outsideClicked"}} />
<PaperDialogContainer @class={{readonly dialogContainerClass}} @outsideClicked={{action "outsideClicked"}}>
<PaperDialogInner @class={{readonly class}} @origin={{origin}} @defaultedParent={{defaultedParent}} @defaultedOpenFrom={{defaultedOpenFrom}} @defaultedCloseTo={{defaultedCloseTo}} @fullscreen={{fullscreen}} @focusOnOpen={{focusOnOpen}}>
{{! template-lint-disable no-action }}
{{#in-element this.destinationEl insertBefore=null}}
<PaperBackdrop @locked-open={{@isLockedOpen}} @opaque={{this.opaque}} @fixed={{unless @parent true}} @class="md-dialog-backdrop" @onClick={{action "outsideClicked"}} />
<PaperDialogContainer @class={{readonly @dialogContainerClass}} @outsideClicked={{action "outsideClicked"}}>
<PaperDialogInner @class={{readonly @class}} @origin={{@origin}} @defaultedParent={{this.defaultedParent}} @defaultedOpenFrom={{this.defaultedOpenFrom}} @defaultedCloseTo={{this.defaultedCloseTo}} @fullscreen={{@fullscreen}} @focusOnOpen={{this.focusOnOpen}}>
{{yield}}
</PaperDialogInner>
</PaperDialogContainer>
Expand Down
18 changes: 9 additions & 9 deletions addon/components/paper-form.hbs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{{! template-lint-disable no-action no-implicit-this }}
{{! template-lint-disable no-action }}
{{yield (hash
isValid=isValid
isInvalid=isInvalid
isTouched=isTouched
isInvalidAndTouched=isInvalidAndTouched
input=(component inputComponent
isValid=this.isValid
isInvalid=this.isInvalid
isTouched=this.isTouched
isInvalidAndTouched=this.isInvalidAndTouched
input=(component this.inputComponent
parentComponent=this
onValidityChange=(action "localOnValidityChange")
)
submit-button=(component submitButtonComponent
submit-button=(component this.submitButtonComponent
type="submit"
)
select=(component selectComponent
select=(component this.selectComponent
parentComponent=this
onValidityChange=(action "localOnValidityChange")
)
autocomplete=(component autocompleteComponent
autocomplete=(component this.autocompleteComponent
parentComponent=this
onValidityChange=(action "localOnValidityChange")
)
Expand Down
3 changes: 1 addition & 2 deletions addon/components/paper-icon.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{{! template-lint-disable no-implicit-this }}
{{-paper-underscore iconClass}}
{{-paper-underscore this.iconClass}}
{{yield}}
170 changes: 85 additions & 85 deletions addon/components/paper-input.hbs
Original file line number Diff line number Diff line change
@@ -1,97 +1,97 @@
{{! template-lint-disable no-action no-curly-component-invocation no-down-event-binding no-implicit-this no-positive-tabindex }}
{{#if label}}
<label for={{inputElementId}} class={{if required "md-required"}}>{{label}}</label>
{{! template-lint-disable no-action no-curly-component-invocation no-down-event-binding no-positive-tabindex }}
{{#if @label}}
<label for={{this.inputElementId}} class={{if @required "md-required"}}>{{@label}}</label>
{{/if}}

{{#if icon}}
{{component iconComponent icon}}
{{#if @icon}}
{{component this.iconComponent @icon}}
{{/if}}

{{#if textarea}}
{{#if @textarea}}
<textarea
class="md-input {{if isInvalid "ng-invalid"}} {{if isTouched "ng-dirty"}}"
id={{inputElementId}}
placeholder={{if shouldAddPlaceholder placeholder}}
disabled={{disabled}}
autofocus={{autofocus}}
aria-describedby={{concat elementId "-char-count " elementId "-error-messages"}}
onfocus={{onFocus}}
class="md-input {{if this.isInvalid "ng-invalid"}} {{if this.isTouched "ng-dirty"}}"
id={{this.inputElementId}}
placeholder={{if this.shouldAddPlaceholder @placeholder}}
disabled={{this.disabled}}
autofocus={{this.autofocus}}
aria-describedby={{concat this.elementId "-char-count " this.elementId "-error-messages"}}
onfocus={{@onFocus}}
onblur={{action "handleBlur"}}
onkeydown={{onKeyDown}}
onkeyup={{onKeyUp}}
onclick={{onClick}}
onkeydown={{@onKeyDown}}
onkeyup={{@onKeyUp}}
onclick={{@onClick}}
oninput={{action "handleInput"}}

name={{passThru.name}}
rows={{passThru.rows}}
cols={{passThru.cols}}
maxlength={{passThru.maxlength}}
tabindex={{passThru.tabindex}}
title={{title}}
required={{passThru.required}}
selectionEnd={{passThru.selectionEnd}}
selectionStart={{passThru.selectionStart}}
selectionDirection={{passThru.selectionDirection}}
wrap={{passThru.wrap}}
readonly={{passThru.readonly}}
form={{passThru.form}}
spellcheck={{passThru.spellcheck}}></textarea>
name={{@passThru.name}}
rows={{@passThru.rows}}
cols={{@passThru.cols}}
maxlength={{@passThru.maxlength}}
tabindex={{@passThru.tabindex}}
title={{@title}}
required={{@passThru.required}}
selectionEnd={{@passThru.selectionEnd}}
selectionStart={{@passThru.selectionStart}}
selectionDirection={{@passThru.selectionDirection}}
wrap={{@passThru.wrap}}
readonly={{@passThru.readonly}}
form={{@passThru.form}}
spellcheck={{@passThru.spellcheck}}></textarea>
{{else}}
<input
class="md-input {{if isInvalid "ng-invalid"}} {{if isTouched "ng-dirty"}}"
id={{inputElementId}}
placeholder={{if shouldAddPlaceholder placeholder}}
type={{type}}
disabled={{disabled}}
autofocus={{autofocus}}
aria-describedby={{concat elementId "-char-count " elementId "-error-messages"}}
onfocus={{onFocus}}
class="md-input {{if this.isInvalid "ng-invalid"}} {{if this.isTouched "ng-dirty"}}"
id={{this.inputElementId}}
placeholder={{if this.shouldAddPlaceholder @placeholder}}
type={{this.type}}
disabled={{this.disabled}}
autofocus={{this.autofocus}}
aria-describedby={{concat this.elementId "-char-count " this.elementId "-error-messages"}}
onfocus={{@onFocus}}
onblur={{action "handleBlur"}}
onkeydown={{onKeyDown}}
onkeyup={{onKeyUp}}
onclick={{onClick}}
onkeydown={{@onKeyDown}}
onkeyup={{@onKeyUp}}
onclick={{@onClick}}
oninput={{action "handleInput"}}

accept={{passThru.accept}}
autocomplete={{passThru.autocomplete}}
autocorrect={{passThru.autocorrect}}
autocapitalize={{passThru.autocapitalize}}
autosave={{passThru.autosave}}
form={{passThru.form}}
formaction={{passThru.formaction}}
formenctype={{passThru.formenctype}}
formmethod={{passThru.formmethod}}
formnovalidate={{passThru.formnovalidate}}
formtarget={{passThru.formtarget}}
height={{passThru.height}}
inputmode={{passThru.inputmode}}
min={{passThru.min}}
maxlength={{passThru.maxlength}}
max={{passThru.max}}
multiple={{passThru.multiple}}
name={{passThru.name}}
pattern={{passThru.pattern}}
readonly={{passThru.readonly}}
required={{passThru.required}}
selectionDirection={{passThru.selectionDirection}}
size={{passThru.size}}
spellcheck={{passThru.spellcheck}}
step={{passThru.step}}
tabindex={{passThru.tabindex}}
title={{title}}
width={{passThru.width}}>
accept={{@passThru.accept}}
autocomplete={{@passThru.autocomplete}}
autocorrect={{@passThru.autocorrect}}
autocapitalize={{@passThru.autocapitalize}}
autosave={{@passThru.autosave}}
form={{@passThru.form}}
formaction={{@passThru.formaction}}
formenctype={{@passThru.formenctype}}
formmethod={{@passThru.formmethod}}
formnovalidate={{@passThru.formnovalidate}}
formtarget={{@passThru.formtarget}}
height={{@passThru.height}}
inputmode={{@passThru.inputmode}}
min={{@passThru.min}}
maxlength={{@passThru.maxlength}}
max={{@passThru.max}}
multiple={{@passThru.multiple}}
name={{@passThru.name}}
pattern={{@passThru.pattern}}
readonly={{@passThru.readonly}}
required={{@passThru.required}}
selectionDirection={{@passThru.selectionDirection}}
size={{@passThru.size}}
spellcheck={{@passThru.spellcheck}}
step={{@passThru.step}}
tabindex={{@passThru.tabindex}}
title={{@title}}
width={{@passThru.width}}>
{{/if}}

{{#unless hideAllMessages}}
<div class="md-errors-spacer" id={{concat elementId "-char-count"}}>
{{#if maxlength}}
<div class="md-char-counter">{{renderCharCount}}</div>
{{#unless this.hideAllMessages}}
<div class="md-errors-spacer" id={{concat this.elementId "-char-count"}}>
{{#if @maxlength}}
<div class="md-char-counter">{{this.currentLength}}/{{@maxlength}}</div>
{{/if}}
</div>
{{#if isInvalidAndTouched}}
<div class="md-input-messages-animation md-auto-hide" id={{concat elementId "-error-messages"}}>
{{#each validationErrorMessages as |error index|}}
<div id="error-{{inputElementId}}-{{index}}"
{{#if this.isInvalidAndTouched}}
<div class="md-input-messages-animation md-auto-hide" id={{concat this.elementId "-error-messages"}}>
{{#each this.validationErrorMessages as |error index|}}
<div id="error-{{this.inputElementId}}-{{index}}"
class="paper-input-error ng-enter ng-enter-active md-input-message-animation"
style="opacity: 1; margin-top: 0">
{{error.message}}
Expand All @@ -102,14 +102,14 @@
{{/unless}}

{{yield (hash
charCount=currentLength
isInvalid=isInvalid
isTouched=isTouched
isInvalidAndTouched=isInvalidAndTouched
hasValue=hasValue
validationErrorMessages=validationErrorMessages
charCount=this.currentLength
isInvalid=this.isInvalid
isTouched=this.isTouched
isInvalidAndTouched=this.isInvalidAndTouched
hasValue=this.hasValue
validationErrorMessages=this.validationErrorMessages
)}}

{{#if iconRight}}
{{component iconComponent iconRight}}
{{#if @iconRight}}
{{component this.iconComponent @iconRight}}
{{/if}}
5 changes: 2 additions & 3 deletions addon/components/paper-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ export default Component.extend(
},
}),

renderCharCount: computed('value', function () {
let currentLength = this.value ? this.value.length : 0;
return `${currentLength}/${this.maxlength}`;
currentLength: computed('value', function () {
return this.value ? this.value.length : 0;
}),

hasLeftIcon: bool('icon'),
Expand Down
6 changes: 3 additions & 3 deletions addon/components/paper-item.hbs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{! template-lint-disable no-action no-implicit-this }}
{{! template-lint-disable no-action }}
{{#with (hash
checkbox=(component "paper-checkbox" parentComponent=this bubbles=false shouldRegister=true)
button=(component "paper-button" parentComponent=this bubbles=false shouldRegister=true skipProxy=true)
switch=(component "paper-switch" parentComponent=this bubbles=false shouldRegister=true)
radio=(component "paper-radio-proxiable" parentComponent=this bubbles=false shouldRegister=true)
) as |controls|}}

{{#if hasPrimaryAction}}
{{#if this.hasPrimaryAction}}
<div class="md-button md-no-style">
<PaperButton @class="md-no-style" @onClick={{onClick}} @href={{href}} @target={{target}} @onMouseEnter={{action this.handleMouseEnter}} @onMouseLeave={{action this.handleMouseLeave}} />
<PaperButton @class="md-no-style" @onClick={{@onClick}} @href={{@href}} @target={{@target}} @onMouseEnter={{action this.handleMouseEnter}} @onMouseLeave={{action this.handleMouseLeave}} />
<div class="md-list-item-inner">
{{yield controls}}
</div>
Expand Down
4 changes: 2 additions & 2 deletions addon/components/paper-optgroup.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{! template-lint-disable no-curly-component-invocation no-implicit-this }}
<label>{{label}}</label>
{{! template-lint-disable no-curly-component-invocation }}
<label>{{@label}}</label>
{{yield}}
5 changes: 2 additions & 3 deletions addon/components/paper-progress-circular.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{! template-lint-disable no-implicit-this }}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {{diameter}} {{diameter}}" style={{svgStyle}}>
<path fill="none" style={{pathStyle}} stroke-dasharray={{strokeDasharray}} d={{d}}></path>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {{this.diameter}} {{this.diameter}}" style={{this.svgStyle}}>
<path fill="none" style={{this.pathStyle}} stroke-dasharray={{this.strokeDasharray}} d={{this.d}}></path>
</svg>
7 changes: 3 additions & 4 deletions addon/components/paper-progress-linear.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{! template-lint-disable no-implicit-this }}
<div class="md-container {{queryModeClass}}">
<div class="md-container {{this.queryModeClass}}">
<div class="md-dashed"></div>
<div class="md-bar md-bar1" style={{bar1Style}}></div>
<div class="md-bar md-bar2" style={{bar2Style}}></div>
<div class="md-bar md-bar1" style={{this.bar1Style}}></div>
<div class="md-bar md-bar2" style={{this.bar2Style}}></div>
</div>
4 changes: 2 additions & 2 deletions addon/components/paper-radio-base.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{! template-lint-disable no-curly-component-invocation no-implicit-this }}
{{! template-lint-disable no-curly-component-invocation }}
<div class="md-container">
<div class="md-off"></div>
<div class="md-on"></div>
Expand All @@ -15,7 +15,7 @@
{{else}}
<div class="md-label">
<span>
{{label}}
{{@label}}
</span>
</div>
{{/if}}
Loading

0 comments on commit f010099

Please sign in to comment.