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

Paper-toolbar glimmerization #1244

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
9 changes: 8 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
'use strict';

module.exports = {
singleQuote: true,
overrides: [
{
files: '*.{js,ts}',
options: {
singleQuote: true,
},
},
],
};
2 changes: 1 addition & 1 deletion addon/components/paper-grid-list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods, ember/no-classic-components, ember/require-tagless-components, ember/no-component-lifecycle-hooks, ember/no-get */
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods, ember/no-classic-components, ember/no-component-lifecycle-hooks, ember/no-get */
/**
* @module ember-paper
*/
Expand Down
13 changes: 0 additions & 13 deletions addon/components/paper-toolbar-tools.js

This file was deleted.

1 change: 1 addition & 0 deletions addon/components/paper-toolbar-tools/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="md-toolbar-tools">{{yield}}</div>
21 changes: 0 additions & 21 deletions addon/components/paper-toolbar.js

This file was deleted.

17 changes: 17 additions & 0 deletions addon/components/paper-toolbar/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Component from '@glimmer/component';
import { addColors } from 'ember-paper/mixins-class';

export default class PaperToolbarComponent extends addColors(Component) {
get tall() {
return this.args.tall ?? false;
}

get classes() {
const { tall, colorClasses } = this;
const classes = ['md-default-theme'];

if (tall) classes.push('md-tall');

return [...classes, ...colorClasses].join(' ');
}
}
3 changes: 3 additions & 0 deletions addon/components/paper-toolbar/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<md-toolbar class={{this.classes}} ...attributes>
{{yield (hash tools=(component "paper-toolbar-tools"))}}
</md-toolbar>
14 changes: 14 additions & 0 deletions addon/mixins-class/add-colors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default function addColors(Base) {
return class extends Base {
get colorClasses() {
const { warn, accent, primary } = this.args;
const colorClasses = [];

if (warn) colorClasses.push('md-warn');
if (accent) colorClasses.push('md-accent');
if (primary) colorClasses.push('md-primary');

return colorClasses;
}
};
}
1 change: 1 addition & 0 deletions addon/mixins-class/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as addColors } from './add-colors';
3 changes: 0 additions & 3 deletions addon/templates/components/paper-toolbar.hbs

This file was deleted.

3 changes: 0 additions & 3 deletions app/components/paper-toolbar-tools.js

This file was deleted.

1 change: 1 addition & 0 deletions app/components/paper-toolbar-tools/template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-paper/components/paper-toolbar-tools/template';
3 changes: 0 additions & 3 deletions app/components/paper-toolbar.js

This file was deleted.

1 change: 1 addition & 0 deletions app/components/paper-toolbar/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-paper/components/paper-toolbar/component';
1 change: 1 addition & 0 deletions app/components/paper-toolbar/template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-paper/components/paper-toolbar/template';