Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run the tagless component codemod #1254

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions addon/components/paper-autocomplete/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { assert } from '@ember/debug';
import { indexOfOption } from 'ember-power-select/utils/group-utils';
@tagName('')
@layout(template)
class PaperAutocomplete extends Component.extend(ValidationMixin) {
export default class PaperAutocomplete extends Component.extend(ValidationMixin) {

isTouched = false;

Expand Down Expand Up @@ -168,5 +168,3 @@ class PaperAutocomplete extends Component.extend(ValidationMixin) {
}

}

export default PaperAutocomplete;
4 changes: 1 addition & 3 deletions addon/components/paper-autocomplete/ebd-content/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { tagName, layout } from '@ember-decorators/component';

@tagName('')
@layout(template)
class PaperAutocompleteEbdContent extends Component {
export default class PaperAutocompleteEbdContent extends Component {

customStyles = {
'overflow-y': 'auto',
Expand Down Expand Up @@ -35,5 +35,3 @@ class PaperAutocompleteEbdContent extends Component {
}

}

export default PaperAutocompleteEbdContent;
4 changes: 1 addition & 3 deletions addon/components/paper-autocomplete/ebd-trigger/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import { and } from '@ember/object/computed';

@tagName('')
@layout(template)
class PaperSelectEbdTrigger extends Component {
export default class PaperSelectEbdTrigger extends Component {

@and('label', 'selected')
shouldShowLabel;

}

export default PaperSelectEbdTrigger;
4 changes: 1 addition & 3 deletions addon/components/paper-autocomplete/eps-trigger/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import unwrapProxy from 'ember-paper/utils/unwrap-proxy';

@tagName('')
@layout(template)
class PaperSelectEpsTrigger extends Component {
export default class PaperSelectEpsTrigger extends Component {

@computed('select.{searchText,selected}')
get text() {
Expand Down Expand Up @@ -76,5 +76,3 @@ class PaperSelectEpsTrigger extends Component {
}

}

export default PaperSelectEpsTrigger;
4 changes: 1 addition & 3 deletions addon/components/paper-autocomplete/highlight/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { tagName, layout } from '@ember-decorators/component';
*/
@tagName('')
@layout(template)
class PaperAutocompleteHighlight extends Component {
export default class PaperAutocompleteHighlight extends Component {
flags = '';

@computed('regex', 'label')
Expand Down Expand Up @@ -84,5 +84,3 @@ class PaperAutocompleteHighlight extends Component {
}

}

export default PaperAutocompleteHighlight;
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { tagName, layout } from '@ember-decorators/component';

@tagName('')
@layout(template)
class PaperAutocompleteNoMatchesMessage extends Component {
export default class PaperAutocompleteNoMatchesMessage extends Component {

}

export default PaperAutocompleteNoMatchesMessage;
6 changes: 4 additions & 2 deletions addon/components/paper-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { reads } from '@ember/object/computed';

import Component from '@ember/component';
import FocusableMixin from 'ember-paper/mixins/focusable-mixin';
import ColorMixin from 'ember-paper/mixins/color-mixin';
import ProxiableMixin from 'ember-paper/mixins/proxiable-mixin';
import { invokeAction } from 'ember-paper/utils/invoke-action';

Expand All @@ -17,7 +16,7 @@ import { invokeAction } from 'ember-paper/utils/invoke-action';
* @uses ColorMixin
* @uses ProxiableMixin
*/
export default Component.extend(FocusableMixin, ColorMixin, ProxiableMixin, {
export default Component.extend(FocusableMixin, ProxiableMixin, {
tagName: 'button',
classNames: ['md-default-theme', 'md-button'],
raised: false,
Expand All @@ -38,6 +37,9 @@ export default Component.extend(FocusableMixin, ColorMixin, ProxiableMixin, {
'iconButton:md-icon-button',
'fab:md-fab',
'mini:md-mini',
'warn:md-warn',
'accent:md-accent',
'primary:md-primary',
],

init() {
Expand Down
10 changes: 6 additions & 4 deletions addon/components/paper-card-header-text.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{yield (hash
title=(component "paper-card-header-title")
subhead=(component "paper-card-header-subhead")
)}}
<md-card-header-text ...attributes>
{{yield (hash
title=(component "paper-card-header-title")
subhead=(component "paper-card-header-subhead")
)}}
</md-card-header-text>
4 changes: 2 additions & 2 deletions addon/components/paper-card-header-text.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/* eslint-disable ember/no-classic-components */
/**
* @module ember-paper
*/
Expand All @@ -9,5 +9,5 @@ import Component from '@ember/component';
* @extends Ember.Component
*/
export default Component.extend({
tagName: 'md-card-header-text',
tagName: '',
});
10 changes: 6 additions & 4 deletions addon/components/paper-card-header.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{yield (hash
text=(component "paper-card-header-text")
avatar=(component "paper-card-avatar")
)}}
<md-card-header ...attributes>
{{yield (hash
text=(component "paper-card-header-text")
avatar=(component "paper-card-avatar")
)}}
</md-card-header>
4 changes: 2 additions & 2 deletions addon/components/paper-card-header.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/* eslint-disable ember/no-classic-components */
/**
* @module ember-paper
*/
Expand All @@ -9,5 +9,5 @@ import Component from '@ember/component';
* @extends Ember.Component
*/
export default Component.extend({
tagName: 'md-card-header',
tagName: '',
});
18 changes: 10 additions & 8 deletions addon/components/paper-card-title-media.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{! template-lint-disable no-implicit-this }}
{{#if (has-block)}}
<div class="md-media-{{size}}">
{{yield}}
</div>
{{else}}
<img class="md-media-{{size}}" src={{src}} alt={{alt}} title={{title}}>
{{/if}}
<md-card-title-media ...attributes>
{{! template-lint-disable no-implicit-this }}
{{#if (has-block)}}
<div class="md-media-{{size}}">
{{yield}}
</div>
{{else}}
<img class="md-media-{{size}}" src={{src}} alt={{alt}} title={{title}}>
{{/if}}
</md-card-title-media>
4 changes: 2 additions & 2 deletions addon/components/paper-card-title-media.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/* eslint-disable ember/no-classic-components */
/**
* @module ember-paper
*/
Expand All @@ -9,6 +9,6 @@ import Component from '@ember/component';
* @extends Ember.Component
*/
export default Component.extend({
tagName: 'md-card-title-media',
tagName: '',
size: 'md',
});
10 changes: 6 additions & 4 deletions addon/components/paper-card-title-text.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{yield (hash
headline=(component "paper-card-header-headline")
subhead=(component "paper-card-header-subhead")
)}}
<md-card-title-text ...attributes>
{{yield (hash
headline=(component "paper-card-header-headline")
subhead=(component "paper-card-header-subhead")
)}}
</md-card-title-text>
4 changes: 2 additions & 2 deletions addon/components/paper-card-title-text.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/* eslint-disable ember/no-classic-components */
/**
* @module ember-paper
*/
Expand All @@ -9,5 +9,5 @@ import Component from '@ember/component';
* @extends Ember.Component
*/
export default Component.extend({
tagName: 'md-card-title-text',
tagName: '',
});
10 changes: 6 additions & 4 deletions addon/components/paper-card-title.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{yield (hash
text=(component "paper-card-title-text")
media=(component "paper-card-title-media")
)}}
<md-card-title ...attributes>
{{yield (hash
text=(component "paper-card-title-text")
media=(component "paper-card-title-media")
)}}
</md-card-title>
4 changes: 2 additions & 2 deletions addon/components/paper-card-title.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/* eslint-disable ember/no-classic-components */
/**
* @module ember-paper
*/
Expand All @@ -9,5 +9,5 @@ import Component from '@ember/component';
* @extends Ember.Component
*/
export default Component.extend({
tagName: 'md-card-title',
tagName: '',
});
18 changes: 10 additions & 8 deletions addon/components/paper-card.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{yield (hash
title=(component "paper-card-title")
content=(component "paper-card-content")
actions=(component "paper-card-actions")
header=(component "paper-card-header")
image=(component "paper-card-image")
media=(component "paper-card-media")
)}}
<md-card ...attributes>
{{yield (hash
title=(component "paper-card-title")
content=(component "paper-card-content")
actions=(component "paper-card-actions")
header=(component "paper-card-header")
image=(component "paper-card-image")
media=(component "paper-card-media")
)}}
</md-card>
4 changes: 2 additions & 2 deletions addon/components/paper-card.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/* eslint-disable ember/no-classic-components */
/**
* @module ember-paper
*/
Expand All @@ -9,5 +9,5 @@ import Component from '@ember/component';
* @extends Ember.Component
*/
export default Component.extend({
tagName: 'md-card',
tagName: '',
});
11 changes: 8 additions & 3 deletions addon/components/paper-checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { not, and } from '@ember/object/computed';
import Component from '@ember/component';
import { assert } from '@ember/debug';
import FocusableMixin from 'ember-paper/mixins/focusable-mixin';
import ColorMixin from 'ember-paper/mixins/color-mixin';
import ProxiableMixin from 'ember-paper/mixins/proxiable-mixin';
import { invokeAction } from 'ember-paper/utils/invoke-action';
/**
Expand All @@ -19,10 +18,16 @@ import { invokeAction } from 'ember-paper/utils/invoke-action';
* @uses ColorMixin
* @uses ProxiableMixin
*/
export default Component.extend(FocusableMixin, ColorMixin, ProxiableMixin, {
export default Component.extend(FocusableMixin, ProxiableMixin, {
tagName: 'md-checkbox',
classNames: ['md-checkbox', 'md-default-theme'],
classNameBindings: ['isChecked:md-checked', 'indeterminate:md-indeterminate'],
classNameBindings: [
'isChecked:md-checked',
'indeterminate:md-indeterminate',
'warn:md-warn',
'accent:md-accent',
'primary:md-primary',
],

attributeBindings: [
'role:role',
Expand Down
4 changes: 1 addition & 3 deletions addon/components/paper-chips/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { tagName, layout } from '@ember-decorators/component';

@tagName('')
@layout(template)
class PaperChips extends Component {
export default class PaperChips extends Component {

activeChip = -1;
searchText = '';
Expand Down Expand Up @@ -159,5 +159,3 @@ class PaperChips extends Component {
@action
noop() {}
}

export default PaperChips;
4 changes: 1 addition & 3 deletions addon/components/paper-contact-chips/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import { tagName, layout } from '@ember-decorators/component';

@tagName('')
@layout(template)
class PaperContactChips extends Component {
export default class PaperContactChips extends Component {
requireMatch = true;
searchField = 'email';
emailField = 'email';
nameField = 'name';
imageField = 'image';
}

export default PaperContactChips;
4 changes: 1 addition & 3 deletions addon/components/paper-content/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ import template from './template';
*/
@tagName('')
@layout(template)
class PaperContent extends Component {}

export default PaperContent;
export default class PaperContent extends Component {}
2 changes: 1 addition & 1 deletion addon/components/paper-dialog.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{! 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"}} />
<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}}>
{{yield}}
Expand Down
4 changes: 1 addition & 3 deletions addon/components/paper-divider/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ import template from './template';
*/
@tagName('')
@layout(template)
class PaperDivider extends Component { }

export default PaperDivider;
export default class PaperDivider extends Component { }
8 changes: 5 additions & 3 deletions addon/components/paper-grid-tile-footer.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<figcaption>
{{yield}}
</figcaption>
<md-grid-tile-footer ...attributes>
<figcaption>
{{yield}}
</figcaption>
</md-grid-tile-footer>
4 changes: 2 additions & 2 deletions addon/components/paper-grid-tile-footer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/* eslint-disable ember/no-classic-components */
/**
* @module ember-paper
*/
Expand All @@ -9,5 +9,5 @@ import Component from '@ember/component';
* @extends Ember.Component
*/
export default Component.extend({
tagName: 'md-grid-tile-footer',
tagName: '',
});
Loading
Loading