-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b403649
commit 9683b70
Showing
21 changed files
with
775 additions
and
1,569 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 |
---|---|---|
|
@@ -12,14 +12,10 @@ | |
}, | ||
"license": "MIT", | ||
"author": "Aleksandr Kanunnikov <[email protected]>", | ||
"exports": { | ||
".": "./dist/index.js", | ||
"./*": "./dist/*", | ||
"./addon-main.js": "./addon-main.js" | ||
}, | ||
"files": [ | ||
"addon-main.js", | ||
"dist" | ||
"dist", | ||
"types" | ||
], | ||
"scripts": { | ||
"build": "rollup --config", | ||
|
@@ -39,13 +35,17 @@ | |
"@babel/plugin-proposal-decorators": "^7.17.8", | ||
"@embroider/addon-dev": "^1.5.0", | ||
"@rollup/plugin-babel": "^5.3.1", | ||
"@tsconfig/ember": "^3.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.62.0", | ||
"@typescript-eslint/parser": "^5.62.0", | ||
"eslint": "^8.13.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-ember": "^10.6.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"prettier": "^2.6.2", | ||
"rollup": "^2.70.2" | ||
"rollup": "^2.70.2", | ||
"typescript": "^5.1.6" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org" | ||
|
@@ -60,5 +60,20 @@ | |
"app-js": { | ||
"./modifiers/click-outside.js": "./dist/_app_/modifiers/click-outside.js" | ||
} | ||
}, | ||
"exports": { | ||
".": "./dist/index.js", | ||
"./*": { | ||
"types": "./types/*.d.ts", | ||
"default": "./dist/*.js" | ||
}, | ||
"./addon-main.js": "./addon-main.js" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"types/*" | ||
] | ||
} | ||
} | ||
} |
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 @@ | ||
export { default as clickOutside } from './modifiers/click-outside'; |
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,10 @@ | ||
{ | ||
"extends": "@tsconfig/ember/tsconfig.json", | ||
"include": [ | ||
"src/**/*", | ||
"types/**/*" | ||
], | ||
"glint": { | ||
"environment": "ember-loose" | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
ember-click-outside-modifier/types/modifiers/click-outside.d.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Modifier from 'ember-modifier'; | ||
|
||
export interface ClickOutsideSignature { | ||
Element?: HTMLElement; | ||
Args: { | ||
Positional: [handlerValue: (event: Event) => unknown, useCapture?: boolean]; | ||
Named: | ||
| never | ||
| { | ||
events?: string[]; | ||
} | ||
| { | ||
event?: string; | ||
}; | ||
}; | ||
} | ||
|
||
export default class ClickOutsideModifier extends Modifier<ClickOutsideSignature> {} |
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,5 @@ | ||
import type ClickOutsideModifier from './modifiers/click-outside'; | ||
|
||
export default interface EmberClickOutsideRegistry { | ||
'click-outside': typeof ClickOutsideModifier; | ||
} |
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
File renamed without changes.
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,5 @@ | ||
<button type="button" {{click-outside this.noop}}>Click me!</button> | ||
<button type="button" {{click-outside this.noop true}}>Click me!</button> | ||
<button type="button" {{click-outside this.noop false}}>Click me!</button> | ||
<button type="button" {{click-outside this.noop event="touchstart"}}>Click me!</button> | ||
<button type="button" {{click-outside this.noop events=(array "touchstart" "touchend")}}>Click me!</button> |
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,7 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
export default class extends Component { | ||
noop() { | ||
// do nothing | ||
} | ||
} |
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 @@ | ||
/** | ||
* Type declarations for | ||
* import config from 'test-app/config/environment' | ||
*/ | ||
declare const config: { | ||
environment: string; | ||
modulePrefix: string; | ||
podModulePrefix: string; | ||
locationType: 'history' | 'hash' | 'none' | 'auto'; | ||
rootURL: string; | ||
APP: Record<string, unknown>; | ||
}; | ||
|
||
export default config; |
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,5 +1,3 @@ | ||
{{page-title "TestApp"}} | ||
|
||
<h2 id="title">Welcome to Ember</h2> | ||
|
||
{{outlet}} |
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
File renamed without changes.
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,17 @@ | ||
{ | ||
"extends": "@tsconfig/ember/tsconfig.json", | ||
"compilerOptions": { | ||
// The combination of `baseUrl` with `paths` allows Ember's classic package | ||
// layout, which is not resolvable with the Node resolution algorithm, to | ||
// work with TypeScript. | ||
"baseUrl": ".", | ||
"paths": { | ||
"test-app/tests/*": ["tests/*"], | ||
"test-app/*": ["app/*"], | ||
"*": ["types/*"] | ||
} | ||
}, | ||
"glint": { | ||
"environment": "ember-loose" | ||
} | ||
} |
Oops, something went wrong.