-
-
Notifications
You must be signed in to change notification settings - Fork 86
Upgrade sparkles components to glimmer #288
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
Changes from all commits
4fb9566
5751dba
765f7d7
d94d5d5
255aabd
e01cf4e
ee7d20e
138526d
6dec76c
0eb219f
e874c33
c86ce5b
5e8a1cc
d473f51
11528ca
9cdb7da
87a848a
c5389d8
0cd8b45
eb354a2
0df6110
9bc8ff1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
|
||
root = true | ||
|
||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
/.env* | ||
/.eslintignore | ||
/.eslintrc.js | ||
/.git/ | ||
/.gitignore | ||
/.template-lintrc.js | ||
/.travis.yml | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
extends: 'recommended' | ||
extends: 'octane' | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
import Component from 'sparkles-component'; | ||
import Component from '@glimmer/component'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class EsButton extends Component { | ||
export default class EsButtonComponent extends Component { | ||
// default value | ||
_onClicked = () => {}; | ||
_type = "button"; | ||
|
||
constructor({ onClicked }) { | ||
constructor() { | ||
super(...arguments); | ||
|
||
if(!onClicked) { | ||
|
||
if(!this.args.onClicked) { | ||
// eslint-disable-next-line no-console | ||
console.warn(new Error('Button created with no onClicked')); | ||
this.onClicked = function() {}; | ||
} else { | ||
this.onClicked = onClicked; | ||
this._onClicked = this.args.onClicked; | ||
} | ||
|
||
if(!this.args.type) { | ||
// eslint-disable-next-line no-console | ||
console.warn(new Error('Button created with no @type defined - defaulting to `type="button"`')); | ||
} else { | ||
this._type = this.args.type; | ||
} | ||
} | ||
|
||
@action | ||
buttonClicked() { | ||
this.onClicked(); | ||
this._onClicked(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import Component from 'sparkles-component'; | ||
|
||
export default class EsCardContent extends Component { | ||
import Component from '@glimmer/component'; | ||
|
||
export default class EsCardContentComponent extends Component { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import Component from 'sparkles-component'; | ||
|
||
export default class EsCard extends Component { | ||
import Component from '@glimmer/component'; | ||
|
||
export default class EsCardComponent extends Component { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
export default class EsFooterContributionsComponent extends Component { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
export default class EsFooterInfoComponent extends Component { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
export default class EsFooterStatementComponent extends Component { | ||
constructor() { | ||
super(...arguments) | ||
|
||
this.currentYear = new Date().getUTCFullYear(); | ||
} | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import Component from '@ember/component'; | ||
import layout from './template'; | ||
import layout from 'ember-styleguide/templates/components/es-header-navbar-link'; | ||
import { computed } from '@ember/object'; | ||
import { equal } from '@ember/object/computed'; | ||
import { inject as service } from '@ember/service'; | ||
import { schedule, next } from '@ember/runloop'; | ||
import { action } from '@ember/object'; | ||
|
||
export default Component.extend({ | ||
layout, | ||
|
@@ -47,26 +48,25 @@ export default Component.extend({ | |
}); | ||
}, | ||
|
||
actions: { | ||
toggleDropdown(event) { | ||
this.get('navbar').closePopupMenu(this); | ||
this.toggleProperty('isDropdownOpen'); | ||
@action | ||
toggleDropdown(event) { | ||
this.get('navbar').closePopupMenu(this); | ||
this.toggleProperty('isDropdownOpen'); | ||
|
||
if (this.isDropdownOpen) { | ||
// if it's open, let's make sure it can do some things | ||
schedule('afterRender', this, function() { | ||
this.setupLinkBlurs(); | ||
if (this.isDropdownOpen) { | ||
// if it's open, let's make sure it can do some things | ||
schedule('afterRender', this, function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this needs to go ASAP after the merge There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am planning on creating an issue after this is merged to convert this component into a glimmer component and I will make sure there is a todo item to remove the runloop stuff too 👍 |
||
this.setupLinkBlurs(); | ||
|
||
// move focus to the first item in the dropdown only when opened with keyboard | ||
// ref https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail | ||
if (event.detail === 0) { | ||
this.processFirstElementFocus(); | ||
} | ||
// move focus to the first item in the dropdown only when opened with keyboard | ||
// ref https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail | ||
if (event.detail === 0) { | ||
this.processFirstElementFocus(); | ||
} | ||
|
||
this.processKeyPress(); | ||
}); | ||
} | ||
}, | ||
this.processKeyPress(); | ||
}); | ||
} | ||
}, | ||
|
||
closeDropdown() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import EsCard from './es-card'; | ||
import Component from '@glimmer/component'; | ||
|
||
export default class EsLinkCard extends EsCard { | ||
export default class EsLinkCardComponent extends Component { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we keep the relative import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not to because none of the other components have it, we really should upgrade this to Glimmer after this is merged but it's not a blocker for release
I also moved this because of the bug we discussed with ember-angle-bracket-invocation-polyfill, we can't use nested angle bracket components any more so I needed to move the component 👍