Skip to content
Merged
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
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ jobs:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.16
- ember-lts-3.20
- ember-lts-3.24
- ember-lts-3.28
- ember-lts-4.4
- ember-lts-4.8
- ember-release
- ember-beta
- ember-canary
Expand Down
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
extends: 'recommended',
rules: {
'no-autofocus-attribute': false,
'no-down-event-binding': false,
'no-pointer-down-event-binding': false,
'no-duplicate-landmark-elements': false,
'no-inline-styles': false,
'no-partial': false,
Expand Down
5 changes: 4 additions & 1 deletion addon/components/power-select-multiple/trigger.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{{! template-lint-disable "no-invalid-interactive" }}
{{!-- template-lint-disable no-invalid-interactive --}}
{{!-- template-lint-disable no-pointer-down-event-binding --}}
{{!-- template-lint-disable no-unsupported-role-attributes --}}
{{!-- template-lint-disable require-aria-activedescendant-tabindex --}}
<ul
id="ember-power-select-multiple-options-{{@select.uniqueId}}"
aria-activedescendant={{if (and @select.isOpen (not @searchEnabled)) @ariaActiveDescendant}}
Expand Down
17 changes: 8 additions & 9 deletions addon/components/power-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ import {
pathForOption,
MatcherFn
} from '../utils/group-utils';
import { restartableTask } from 'ember-concurrency-decorators';
// @ts-ignore
import { timeout } from 'ember-concurrency';
import { restartableTask, timeout } from 'ember-concurrency';
import { Dropdown, DropdownActions } from 'ember-basic-dropdown/components/basic-dropdown';

interface SelectActions extends DropdownActions {
Expand Down Expand Up @@ -48,8 +47,8 @@ interface PromiseProxy<T> extends Promise<T> {
interface CancellablePromise<T> extends Promise<T> {
cancel: () => void
}
interface Arrayable<T> {
toArray(): T[];
interface Sliceable<T> {
slice(): T[];
}
interface Performable {
perform: (...args: any[]) => void
Expand Down Expand Up @@ -90,8 +89,8 @@ export interface PowerSelectArgs {
registerAPI?: (select: Select) => void
}

const isArrayable = <T>(coll: any): coll is Arrayable<T> => {
return typeof coll.toArray === 'function';
const isSliceable = <T>(coll: any): coll is Sliceable<T> => {
return typeof coll.slice === 'function';
}

const isPromiseLike = <T>(thing: any): thing is Promise<T> => {
Expand Down Expand Up @@ -645,9 +644,9 @@ function isNumpadKeyEvent(e: KeyboardEvent): boolean {
return e.keyCode >= 96 && e.keyCode <= 105;
}

const toPlainArray = <T>(collection: T[] | Arrayable<T>): T[] => {
if (isArrayable<T>(collection)) {
return collection.toArray();
const toPlainArray = <T>(collection: T[] | Sliceable<T>): T[] => {
if (isSliceable<T>(collection)) {
return collection.slice();
} else {
return collection;
}
Expand Down
2 changes: 1 addition & 1 deletion addon/components/power-select/no-matches-message.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#if @noMatchesMessage}}
<ul class="ember-power-select-options" role="listbox">
<li class="ember-power-select-option ember-power-select-option--no-matches-message" role="option">
<li class="ember-power-select-option ember-power-select-option--no-matches-message" role="option" aria-selected={{false}}>
{{@noMatchesMessage}}
</li>
</ul>
Expand Down
3 changes: 1 addition & 2 deletions addon/components/power-select/options.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<ul role="listbox" {{did-insert this.addHandlers}} {{will-destroy this.removeHandlers}} ...attributes>
{{! template-lint-disable no-unnecessary-concat }}
{{#if @select.loading}}
{{#if @loadingMessage}}
<li class="ember-power-select-option ember-power-select-option--loading-message" role="option">{{@loadingMessage}}</li>
<li class="ember-power-select-option ember-power-select-option--loading-message" role="option" aria-selected={{false}}>{{@loadingMessage}}</li>
{{/if}}
{{/if}}
{{#let
Expand Down
2 changes: 1 addition & 1 deletion addon/components/power-select/power-select-group.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<li class="ember-power-select-group" aria-disabled={{if @group.disabled "true"}} role="option">
<li class="ember-power-select-group" aria-disabled={{if @group.disabled "true"}} role="option" aria-selected={{false}}>
<span class="ember-power-select-group-name">{{@group.groupName}}</span>
{{yield}}
</li>
2 changes: 1 addition & 1 deletion addon/components/power-select/search-message.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ul class="ember-power-select-options" role="listbox" ...attributes>
<li class="ember-power-select-option ember-power-select-option--search-message" role="option">
<li class="ember-power-select-option ember-power-select-option--search-message" role="option" aria-selected={{false}}>
{{@searchMessage}}
</li>
</ul>
32 changes: 10 additions & 22 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,28 @@ module.exports = async function () {
return {
scenarios: [
{
name: 'ember-lts-3.16',

npm: {
devDependencies: {
'ember-source': '~3.16.0',
},
},
},
{
name: 'ember-lts-3.20',

name: 'ember-lts-3.28',
npm: {
devDependencies: {
'ember-source': '~3.20.0',
'ember-resolver': '^8.0.0',
'ember-source': '~3.28.0',
},
},
},
{
name: 'ember-lts-3.24',

name: 'ember-lts-4.4',
npm: {
devDependencies: {
'ember-source': '~3.24.3',
'ember-resolver': '^8.0.0',
'ember-source': '~4.4.0',
},
},
},
{
name: 'ember-lts-3.28',
name: 'ember-lts-4.8',
npm: {
devDependencies: {
'ember-source': '~3.28.0',
'ember-source': '~4.8.0',
},
},
},
Expand Down Expand Up @@ -76,6 +67,7 @@ module.exports = async function () {
},
npm: {
devDependencies: {
'ember-resolver': '^8.0.0',
'ember-source': '~3.28.0',
},
ember: {
Expand All @@ -84,11 +76,7 @@ module.exports = async function () {
},
},
embroiderSafe(),
embroiderOptimized({
npm: {
devDependencies: { 'ember-data': '^4.6.0' },
},
}),
embroiderOptimized(),
],
};
};
5 changes: 4 additions & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function (defaults) {
let app = new EmberAddon(defaults, {
snippetPaths: ['tests/dummy/app/templates/snippets/'],
snippetPaths: [
'tests/dummy/app/components/snippets',
'tests/dummy/app/templates/snippets/',
],
'ember-prism': {
components: ['scss', 'javascript'], //needs to be an array, or undefined.
},
Expand Down
Loading