forked from GavinJoyce/ember-headlessui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request GavinJoyce#89 from NullVoxPopuli/add-typescript
Add typescript
- Loading branch information
Showing
13 changed files
with
377 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{{! template-lint-disable no-down-event-binding }} | ||
<button | ||
type='button' | ||
aria-haspopup={{true}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{{! template-lint-disable no-down-event-binding }} | ||
{{#if @isOpen}} | ||
<div | ||
id={{@itemsGuid}} | ||
|
15 changes: 10 additions & 5 deletions
15
addon/services/dialog-stack-provider.js → addon/services/dialog-stack-provider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
import { action } from '@ember/object'; | ||
import Service from '@ember/service'; | ||
|
||
export default class DialogStackProviderService extends Service { | ||
stack = []; | ||
interface WithGuid { | ||
guid: string; | ||
} | ||
|
||
export default class DialogStackProvider extends Service { | ||
stack: string[] = []; | ||
|
||
@action | ||
hasOpenChild(dialog) { | ||
hasOpenChild(dialog: WithGuid) { | ||
return this.stack[this.stack.length - 1] !== dialog.guid; | ||
} | ||
|
||
@action | ||
remove(dialog) { | ||
remove(dialog: WithGuid) { | ||
let ix = this.stack.findIndex((guid) => guid === dialog.guid); | ||
|
||
this.stack.splice(ix, 1); | ||
} | ||
|
||
@action | ||
push(dialog) { | ||
push(dialog: WithGuid) { | ||
this.stack.push(dialog.guid); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default config; | ||
|
||
/** | ||
* Type declarations for | ||
* import config from 'my-app/config/environment' | ||
*/ | ||
declare const config: { | ||
environment: string; | ||
modulePrefix: string; | ||
podModulePrefix: string; | ||
locationType: string; | ||
rootURL: string; | ||
APP: Record<string, unknown>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2020", | ||
"allowJs": true, | ||
"moduleResolution": "node", | ||
"allowSyntheticDefaultImports": true, | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"alwaysStrict": true, | ||
"strictNullChecks": true, | ||
"strictPropertyInitialization": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"noEmitOnError": false, | ||
"noEmit": true, | ||
"inlineSourceMap": true, | ||
"inlineSources": true, | ||
"baseUrl": ".", | ||
"module": "es6", | ||
"experimentalDecorators": true, | ||
"paths": { | ||
"dummy/tests/*": ["tests/*"], | ||
"dummy/*": ["tests/dummy/app/*", "app/*"], | ||
"ember-headlessui": ["addon"], | ||
"ember-headlessui/*": ["addon/*"], | ||
"ember-headlessui/test-support": ["addon-test-support"], | ||
"ember-headlessui/test-support/*": ["addon-test-support/*"], | ||
"*": ["types/*"] | ||
} | ||
}, | ||
"include": [ | ||
"app/**/*", | ||
"addon/**/*", | ||
"tests/**/*", | ||
"types/**/*", | ||
"test-support/**/*", | ||
"addon-test-support/**/*" | ||
] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Types for compiled templates | ||
declare module 'ember-headlessui/templates/*' { | ||
import type { TemplateFactory } from 'htmlbars-inline-precompile'; | ||
const tmpl: TemplateFactory; | ||
export default tmpl; | ||
} |
Oops, something went wrong.