Skip to content
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

Updates to Angular 11 #146

Merged
merged 9 commits into from
Jun 8, 2021
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# angular2-hotkeys
Angular 9 and Ivy Compatible. Older versions might work but isn't officially tested.
Angular 11 and Ivy Compatible. Older versions might work but isn't officially tested.


## Installation

To install this library, run:
Expand Down
5 changes: 4 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "./",
"projects": {
Expand All @@ -10,7 +13,7 @@
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "tsconfig.lib.json",
"project": "ng-package.json"
Expand Down
14,281 changes: 0 additions & 14,281 deletions package-lock.json

This file was deleted.

147 changes: 73 additions & 74 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,76 +1,75 @@
{
"name": "angular2-hotkeys",
"version": "2.2.0",
"scripts": {
"build": "ng build angular2-hotkeys",
"build:release": "ng build angular2-hotkeys --prod",
"build:watch": "ng build angular2-hotkeys --watch",
"ng": "ng",
"lint": "ng lint",
"release": "npm run build:release && npm publish dist/",
"release:beta": "npm run build:release && npm publish dist/ --tag beta",
"start": "ng serve",
"test": "ng test"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "[email protected]:brtnshrdr/angular2-hotkeys.git"
},
"author": {
"name": "Nick Richardson",
"email": "[email protected]"
},
"keywords": [
"angular",
"angular2",
"hotkeys",
"keyboard",
"shortcut"
],
"bugs": {
"url": "[email protected]:brtnshrdr/angular2-hotkeys.git/issues"
},
"peerDependencies": {
"@angular/core": "^5.2.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
"rxjs": "^5.5.0 || ^6.0.0"
},
"dependencies": {
"mousetrap": "^1.6.0",
"@types/mousetrap": "^1.6.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.900.3",
"@angular-devkit/build-ng-packagr": "~0.900.3",
"@angular/animations": "~9.0.2",
"@angular/cli": "~9.0.3",
"@angular/common": "~9.0.2",
"@angular/compiler": "~9.0.2",
"@angular/compiler-cli": "~9.0.2",
"@angular/core": "~9.0.2",
"@angular/forms": "~9.0.2",
"@angular/language-service": "~9.0.2",
"@angular/platform-browser": "~9.0.2",
"@angular/platform-browser-dynamic": "~9.0.2",
"@angular/router": "~9.0.2",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"ng-packagr": "^9.0.0",
"protractor": "~5.4.3",
"rxjs": "~6.5.4",
"ts-node": "~8.3.0",
"tslib": "^1.10.0",
"tslint": "~5.18.0",
"typescript": "~3.7.5",
"zone.js": "~0.10.2"
}
"name": "angular2-hotkeys",
"version": "2.3.0",
"scripts": {
"build": "ng build angular2-hotkeys",
"build:release": "ng build angular2-hotkeys --prod",
"build:watch": "ng build angular2-hotkeys --watch",
"ng": "ng",
"lint": "ng lint",
"release": "npm run build:release && npm publish dist/",
"release:beta": "npm run build:release && npm publish dist/ --tag beta",
"start": "ng serve",
"test": "ng test"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "[email protected]:brtnshrdr/angular2-hotkeys.git"
},
"author": {
"name": "Nick Richardson",
"email": "[email protected]"
},
"keywords": [
"angular",
"angular2",
"hotkeys",
"keyboard",
"shortcut"
],
"bugs": {
"url": "[email protected]:brtnshrdr/angular2-hotkeys.git/issues"
},
"peerDependencies": {
"rxjs": "^5.5.0 || ^6.0.0"
},
"dependencies": {
"@types/mousetrap": "^1.6.0",
"mousetrap": "^1.6.0",
"tslib": "^2.0.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1102.13",
"@angular-devkit/core": "^11.2.13",
"@angular/animations": "~11.2.14",
"@angular/cli": "~11.2.13",
"@angular/common": "~11.2.14",
"@angular/compiler": "~11.2.14",
"@angular/compiler-cli": "~11.2.14",
"@angular/core": "~11.2.14",
"@angular/forms": "~11.2.14",
"@angular/language-service": "~11.2.14",
"@angular/platform-browser": "~11.2.14",
"@angular/platform-browser-dynamic": "~11.2.14",
"@angular/router": "~11.2.14",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.2",
"jasmine-core": "~3.7.1",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.6.0",
"ng-packagr": "^11.2.4",
"protractor": "~7.0.0",
"rxjs": "~6.5.4",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.0.7",
"zone.js": "~0.10.3"
}
}
3 changes: 2 additions & 1 deletion src/lib/hotkeys.directive.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
import { ExtendedKeyboardEvent, Hotkey } from './hotkey.model';
import { HotkeysService } from './hotkeys.service';
import 'mousetrap';
import { MousetrapInstance } from 'mousetrap';
import * as Mousetrap from "mousetrap";

@Directive({
selector: '[hotkeys]',
Expand Down
3 changes: 2 additions & 1 deletion src/lib/hotkeys.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Inject, Injectable } from '@angular/core';
import { Hotkey } from './hotkey.model';
import { Subject } from 'rxjs';
import { HotkeyOptions, IHotkeyOptions } from './hotkey.options';
import 'mousetrap';
import { MousetrapInstance } from 'mousetrap';
import * as Mousetrap from "mousetrap";

@Injectable({
providedIn: 'root'
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"module": "es2020",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
Expand Down
66 changes: 65 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
"codelyzer"
],
"rules": {
"align": {
"options": [
"parameters",
"statements"
]
},
"array-type": false,
"arrow-parens": false,
"arrow-return-shorthand": true,
"deprecation": {
"severity": "warning"
},
Expand All @@ -14,6 +21,7 @@
"rxjs/Rx"
],
"interface-name": false,
"curly": true,
"max-classes-per-file": false,
"max-line-length": [
true,
Expand All @@ -23,6 +31,7 @@
}
],
"member-access": false,
"eofline": true,
"member-ordering": [
true,
{
Expand All @@ -34,6 +43,12 @@
]
}
],
"import-spacing": true,
"indent": {
"options": [
"spaces"
]
},
"no-consecutive-blank-lines": false,
"no-console": [
true,
Expand Down Expand Up @@ -75,9 +90,41 @@
"no-output-rename": true,
"no-outputs-metadata-property": true,
"template-banana-in-box": true,
"semicolon": {
"options": [
"always"
]
},
"space-before-function-paren": {
"options": {
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never"
}
},
"template-no-negated-async": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true,
"typedef-whitespace": {
"options": [
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
]
},
"directive-selector": [
false,
"attribute",
Expand All @@ -89,6 +136,23 @@
"element",
"lib",
"kebab-case"
]
],
"variable-name": {
"options": [
"ban-keywords",
"check-format",
"allow-pascal-case"
]
},
"whitespace": {
"options": [
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast"
]
}
}
}