Skip to content

Commit

Permalink
Merge pull request #1252 from miguelcobain/colocated
Browse files Browse the repository at this point in the history
run ember-component-template-colocation-migrator
  • Loading branch information
mansona authored Oct 1, 2024
2 parents 3ad64b7 + 0c27d34 commit 111be6b
Show file tree
Hide file tree
Showing 82 changed files with 655 additions and 537 deletions.
File renamed without changes.
10 changes: 5 additions & 5 deletions addon/components/paper-backdrop.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
/* eslint-disable ember/no-classic-components, prettier/prettier */
/* eslint-disable ember/no-classic-components */
/**
* @module ember-paper
*/
import Component from '@ember/component';
import layout from '../templates/components/paper-backdrop';
/**
* @class PaperBackdrop
* @extends Ember.Component
* @uses TransitionMixin
*/
export default Component.extend({
layout,
tagName: '',

// addDestroyedElementClone(original, clone) {
Expand All @@ -21,6 +19,8 @@ export default Component.extend({

sendClickAction(onClick, e) {
e.preventDefault();
if (onClick) { onClick(e); }
}
if (onClick) {
onClick(e);
}
},
});
File renamed without changes.
26 changes: 11 additions & 15 deletions addon/components/paper-button.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/* eslint-disable ember/no-classic-components, ember/no-mixins, ember/require-tagless-components, prettier/prettier */
/* eslint-disable ember/no-classic-components, ember/no-mixins, ember/require-tagless-components */
/**
* @module ember-paper
*/
import { reads } from '@ember/object/computed';

import Component from '@ember/component';
import layout from '../templates/components/paper-button';
import FocusableMixin from 'ember-paper/mixins/focusable-mixin';
import ColorMixin from 'ember-paper/mixins/color-mixin';
import ProxiableMixin from 'ember-paper/mixins/proxiable-mixin';
Expand All @@ -19,37 +18,34 @@ import { invokeAction } from 'ember-paper/utils/invoke-action';
* @uses ProxiableMixin
*/
export default Component.extend(FocusableMixin, ColorMixin, ProxiableMixin, {
layout,
tagName: 'button',
classNames: ['md-default-theme', 'md-button'],
raised: false,
iconButton: false,
fab: reads('mini'), // circular button

// circular button
fab: reads('mini'),

mini: false,
type: 'button',
href: null,
target: null,
attributeBindings: [
'type',
'href',
'target',
'title',
'download',
'rel'
],

attributeBindings: ['type', 'href', 'target', 'title', 'download', 'rel'],

classNameBindings: [
'raised:md-raised',
'iconButton:md-icon-button',
'fab:md-fab',
'mini:md-mini'
'mini:md-mini',
],

init() {
this._super(...arguments);
if (this.href) {
this.setProperties({
tagName: 'a',
type: null
type: null,
});
}
},
Expand All @@ -58,5 +54,5 @@ export default Component.extend(FocusableMixin, ColorMixin, ProxiableMixin, {
invokeAction(this, 'onClick', e);
// Prevent bubbling, if specified. If undefined, the event will bubble.
return this.bubbles;
}
},
});
File renamed without changes.
7 changes: 2 additions & 5 deletions addon/components/paper-card-actions.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
/* eslint-disable ember/no-classic-components, ember/no-component-lifecycle-hooks, ember/require-tagless-components, prettier/prettier */
/* eslint-disable ember/no-classic-components, ember/no-component-lifecycle-hooks, ember/require-tagless-components */
/**
* @module ember-paper
*/
import Component from '@ember/component';

import layout from '../templates/components/paper-card-actions';

/**
* @class PaperCardActions
* @extends Ember.Component
*/
export default Component.extend({
layout,
tagName: 'md-card-actions',
classNameBindings: ['defaultClasses'],

Expand All @@ -25,5 +22,5 @@ export default Component.extend({
if (!providedClasses || providedClasses.indexOf('layout-') === -1) {
this.set('defaultClasses', 'layout-row layout-align-end-center');
}
}
},
});
File renamed without changes.
7 changes: 2 additions & 5 deletions addon/components/paper-card-header-text.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/**
* @module ember-paper
*/
import Component from '@ember/component';

import layout from '../templates/components/paper-card-header-text';

/**
* @class PaperCardheaderText
* @extends Ember.Component
*/
export default Component.extend({
layout,
tagName: 'md-card-header-text'
tagName: 'md-card-header-text',
});
File renamed without changes.
7 changes: 2 additions & 5 deletions addon/components/paper-card-header.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/**
* @module ember-paper
*/
import Component from '@ember/component';

import layout from '../templates/components/paper-card-header';

/**
* @class PaperCardHeader
* @extends Ember.Component
*/
export default Component.extend({
layout,
tagName: 'md-card-header'
tagName: 'md-card-header',
});
File renamed without changes.
7 changes: 2 additions & 5 deletions addon/components/paper-card-media.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
/* eslint-disable ember/no-classic-components, prettier/prettier */
/* eslint-disable ember/no-classic-components */
/**
* @module ember-paper
*/
import Component from '@ember/component';

import layout from '../templates/components/paper-card-media';

/**
* @class PaperCardMedia
* @extends Ember.Component
*/
export default Component.extend({
layout,
tagName: '',
size: 'md'
size: 'md',
});
File renamed without changes.
7 changes: 2 additions & 5 deletions addon/components/paper-card-title-media.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/**
* @module ember-paper
*/
import Component from '@ember/component';

import layout from '../templates/components/paper-card-title-media';

/**
* @class PaperCardTitleMedia
* @extends Ember.Component
*/
export default Component.extend({
layout,
tagName: 'md-card-title-media',
size: 'md'
size: 'md',
});
File renamed without changes.
7 changes: 2 additions & 5 deletions addon/components/paper-card-title-text.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/**
* @module ember-paper
*/
import Component from '@ember/component';

import layout from '../templates/components/paper-card-title-text';

/**
* @class PaperCardTitleText
* @extends Ember.Component
*/
export default Component.extend({
layout,
tagName: 'md-card-title-text'
tagName: 'md-card-title-text',
});
File renamed without changes.
7 changes: 2 additions & 5 deletions addon/components/paper-card-title.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/**
* @module ember-paper
*/
import Component from '@ember/component';

import layout from '../templates/components/paper-card-title';

/**
* @class PaperCardTitle
* @extends Ember.Component
*/
export default Component.extend({
layout,
tagName: 'md-card-title'
tagName: 'md-card-title',
});
File renamed without changes.
7 changes: 2 additions & 5 deletions addon/components/paper-card.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/**
* @module ember-paper
*/
import Component from '@ember/component';

import layout from '../templates/components/paper-card';

/**
* @class PaperCard
* @extends Ember.Component
*/
export default Component.extend({
layout,
tagName: 'md-card'
tagName: 'md-card',
});
File renamed without changes.
27 changes: 16 additions & 11 deletions addon/components/paper-checkbox.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable ember/no-classic-components, ember/no-get, ember/no-mixins, ember/require-tagless-components, prettier/prettier */
/* eslint-disable ember/no-classic-components, ember/no-get, ember/no-mixins, ember/require-tagless-components */
/**
* @module ember-paper
*/
Expand All @@ -8,7 +8,6 @@ import { computed } from '@ember/object';
import { not, and } from '@ember/object/computed';
import Component from '@ember/component';
import { assert } from '@ember/debug';
import layout from '../templates/components/paper-checkbox';
import FocusableMixin from 'ember-paper/mixins/focusable-mixin';
import ColorMixin from 'ember-paper/mixins/color-mixin';
import ProxiableMixin from 'ember-paper/mixins/proxiable-mixin';
Expand All @@ -21,41 +20,44 @@ import { invokeAction } from 'ember-paper/utils/invoke-action';
* @uses ProxiableMixin
*/
export default Component.extend(FocusableMixin, ColorMixin, ProxiableMixin, {
layout,
tagName: 'md-checkbox',
classNames: ['md-checkbox', 'md-default-theme'],
classNameBindings: ['isChecked:md-checked', 'indeterminate:md-indeterminate'],

attributeBindings: [
'role:role',
'ariaLabel:aria-label',
'ariaChecked:aria-checked',
'labelId:aria-labelledby'
'labelId:aria-labelledby',
],

/* FocusableMixin Overrides */
focusOnlyOnKey: true,

constants: service(),

value: false,
role: 'checkbox',

notIndeterminate: not('indeterminate'),
isChecked: and('notIndeterminate', 'value'),
ariaChecked: computed('isChecked', 'indeterminate', function() {

ariaChecked: computed('isChecked', 'indeterminate', function () {
if (this.indeterminate) {
return 'mixed';
}

return this.isChecked ? 'true' : 'false';
}),
labelId: computed('elementId', function() {

labelId: computed('elementId', function () {
return `${this.elementId}-label`;
}),

init() {
this._super(...arguments);
assert('{{paper-checkbox}} requires an `onChange` action or null for no action.', this.onChange !== undefined);
assert(
'{{paper-checkbox}} requires an `onChange` action or null for no action.',
this.onChange !== undefined
);
},

click() {
Expand All @@ -67,13 +69,16 @@ export default Component.extend(FocusableMixin, ColorMixin, ProxiableMixin, {
},

keyPress(ev) {
if (ev.which === this.get('constants.KEYCODE.SPACE') || ev.which === this.get('constants.KEYCODE.ENTER')) {
if (
ev.which === this.get('constants.KEYCODE.SPACE') ||
ev.which === this.get('constants.KEYCODE.ENTER')
) {
ev.preventDefault();
this.click();
}
},

processProxy() {
invokeAction(this, 'onChange', !this.value);
}
},
});
File renamed without changes.
Loading

0 comments on commit 111be6b

Please sign in to comment.