Skip to content

Commit

Permalink
Apply ember-cli-update
Browse files Browse the repository at this point in the history
  • Loading branch information
ctjhoa committed Sep 4, 2020
1 parent 13cf1e7 commit 1a3c2b6
Show file tree
Hide file tree
Showing 27 changed files with 8,604 additions and 5,004 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
15 changes: 9 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
'ember'
Expand All @@ -14,8 +20,7 @@ module.exports = {
env: {
browser: true
},
rules: {
},
rules: {},
overrides: [
// node files
{
Expand Down Expand Up @@ -43,9 +48,7 @@ module.exports = {
node: true
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
extends: ['plugin:node/recommended']
}
]
};
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/.env*
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.template-lintrc.js
/.travis.yml
Expand Down
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
extends: 'octane'
};
34 changes: 18 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "8"
- "10"

sudo: false
dist: trusty
dist: xenial

addons:
chrome: stable
Expand All @@ -27,31 +26,34 @@ branches:
- /^v\d+\.\d+\.\d+/

jobs:
fail_fast: true
fast_finish: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

include:
# runs linting and tests with current locked deps

- stage: "Tests"
name: "Tests"
script:
- npm run lint:hbs
- npm run lint:js
- npm test
- npm run lint
- npm run test:ember

- stage: "Additional Tests"
name: "Floating Dependencies"
install:
- npm install --no-package-lock
script:
- npm run test:ember

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- stage: "Additional Tests"
# env: EMBER_TRY_SCENARIO=ember-lts-2.18
env: EMBER_TRY_SCENARIO=ember-lts-3.1
- env: EMBER_TRY_SCENARIO=ember-lts-3.4
- env: EMBER_TRY_SCENARIO=ember-lts-3.8
- env: PERCY_ENABLE=0 EMBER_TRY_SCENARIO=ember-release
- env: PERCY_ENABLE=0 EMBER_TRY_SCENARIO=ember-beta
- env: PERCY_ENABLE=0 EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-lts-3.12
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
- env: EMBER_TRY_SCENARIO=ember-classic

- stage: deploy
if: (branch = master OR tag IS present) AND type = push
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019
Copyright (c) 2020

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ An accessible and easy tab component for EmberJS. Documentation can be found [he
Compatibility
------------------------------------------------------------------------------

* Ember.js v3.1 or above
* Ember.js v3.12 or above
* Ember CLI v2.13 or above
* Node.js v8 or above
* Node.js v10 or above


Installation
Expand Down
49 changes: 7 additions & 42 deletions addon/components/aria-tab-panel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Component from '@ember/component';
import { computed, getProperties, setProperties } from '@ember/object';
import { computed, setProperties } from '@ember/object';
import { or } from '@ember/object/computed';
import layout from '../templates/components/aria-tab-panel';

const DEFAULT_CLASS = 'ember-tabs__tab-panel';
Expand Down Expand Up @@ -59,59 +60,23 @@ export default Component.extend({
}).readOnly(),

nodeIndex: computed('element', 'panelNodes.[]', function() {
let {
element,
panelNodes
} = getProperties(this, [
'element',
'panelNodes'
]);
return panelNodes.indexOf(element);
return this.panelNodes.indexOf(this.element);
}),

tabId: computed('nodeIndex', 'tabNodes.[]', function() {
let {
nodeIndex,
tabNodes
} = getProperties(this, [
'nodeIndex',
'tabNodes'
]);
let tab = tabNodes[nodeIndex];
let tab = this.tabNodes[this.nodeIndex];
return tab ? tab.id : null;
}),

selected: computed('nodeIndex', 'selectedIndex', function() {
let {
nodeIndex,
selectedIndex
} = getProperties(this, [
'nodeIndex',
'selectedIndex'
]);
return nodeIndex === selectedIndex;
return this.nodeIndex === this.selectedIndex;
}),

_selectedClassName: computed('selected', 'selectedTabPanelClassName', 'selectedClassName', function() {
let {
selected,
selectedTabPanelClassName,
selectedClassName
} = getProperties(this, [
'selected',
'selectedTabPanelClassName',
'selectedClassName'
]);
return selected ? (selectedClassName || selectedTabPanelClassName || `${DEFAULT_CLASS}--selected`) : '';
return this.selected ? (this.selectedClassName || this.selectedTabPanelClassName || `${DEFAULT_CLASS}--selected`) : '';
}),

shouldYield: computed('selected', 'forceRender', function() {
let {
selected,
forceRender
} = getProperties(this, ['selected', 'forceRender']);
return selected || forceRender;
}),
shouldYield: or('selected', 'forceRender'),

init() {
this._super(...arguments);
Expand Down
92 changes: 15 additions & 77 deletions addon/components/aria-tab.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Component from '@ember/component';
import { computed, get, getProperties, setProperties } from '@ember/object';
import { computed, setProperties } from '@ember/object';
import { next } from '@ember/runloop';
import layout from '../templates/components/aria-tab';

Expand Down Expand Up @@ -88,79 +88,36 @@ export default Component.extend({
}).readOnly(),

nodeIndex: computed('element', 'tabNodes.[]', function() {
let {
element,
tabNodes
} = getProperties(this, [
'element',
'tabNodes'
]);
return tabNodes.indexOf(element);
return this.tabNodes.indexOf(this.element);
}),

panelId: computed('nodeIndex', 'panelNodes.[]', function() {
let {
nodeIndex,
panelNodes
} = getProperties(this, [
'nodeIndex',
'panelNodes'
]);
let panel = panelNodes[nodeIndex];
let panel = this.panelNodes[this.nodeIndex];
return panel? panel.id : null;
}),

selected: computed('nodeIndex', 'selectedIndex', function() {
let {
nodeIndex,
selectedIndex
} = getProperties(this, [
'nodeIndex',
'selectedIndex'
]);
return nodeIndex === selectedIndex;
return this.nodeIndex === this.selectedIndex;
}),

_selected: computed('selected', function() {
return get(this, 'selected') ? 'true' : 'false';
return this.selected ? 'true' : 'false';
}),

_selectedClassName: computed('selected', 'selectedTabClassName', 'selectedClassName', function() {
let {
selected,
selectedTabClassName,
selectedClassName
} = getProperties(this, [
'selected',
'selectedTabClassName',
'selectedClassName'
]);
return selected ? (selectedClassName || selectedTabClassName || `${DEFAULT_CLASS}--selected`) : '';
return this.selected ? (this.selectedClassName || this.selectedTabClassName || `${DEFAULT_CLASS}--selected`) : '';
}),

_disabled: computed('disabled', function() {
return get(this, 'disabled') ? 'true' : 'false';
return this.disabled ? 'true' : 'false';
}),

_disabledClassName: computed('disabled', 'disabledTabClassName', 'disabledClassName', function() {
let {
disabled,
disabledTabClassName,
disabledClassName
} = getProperties(this, [
'disabled',
'disabledTabClassName',
'disabledClassName'
]);
return disabled ? (disabledClassName || disabledTabClassName || `${DEFAULT_CLASS}--disabled`) : '';
return this.disabled ? (this.disabledClassName || this.disabledTabClassName || `${DEFAULT_CLASS}--disabled`) : '';
}),

_tabIndex: computed('tabIndex', 'selected', function() {
let {
tabIndex,
selected
} = getProperties(this, ['tabIndex', 'selected']);
return tabIndex || (selected ? '0' : null);
return this.tabIndex || (this.selected ? '0' : null);
}),

init() {
Expand All @@ -183,41 +140,22 @@ export default Component.extend({
},

click(e) {
let {
onClick,
nodeIndex
} = getProperties(this, [
'onClick',
'nodeIndex'
]);
if (onClick) {
onClick(nodeIndex, e);
if (this.onClick) {
this.onClick(this.nodeIndex, e);
}
},

keyDown(e) {
let {
onKeyDown,
nodeIndex
} = getProperties(this, [
'onKeyDown',
'nodeIndex'
]);
if (onKeyDown) {
onKeyDown(nodeIndex, e);
if (this.onKeyDown) {
this.onKeyDown(this.nodeIndex, e);
}
},

checkFocus() {
let {
element,
focus,
selected
} = getProperties(this, ['element', 'focus', 'selected']);
if (selected && focus) {
if (this.selected && this.focus) {
// We need to wait the selected rendering state
next(() => {
element.focus();
this.element.focus();
});
}
}
Expand Down
Loading

0 comments on commit 1a3c2b6

Please sign in to comment.