Skip to content

Commit c6a619b

Browse files
committed
Merge branch 'feat/angular-21'
2 parents f933ef6 + 21750be commit c6a619b

17 files changed

Lines changed: 5105 additions & 3892 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### BREAKING CHANGES
6+
7+
- **Dependency**: Require Angular 21
8+
59
## [20.0.0] - 2025-06-13
610

711
### BREAKING CHANGES

apps/demo/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@
7575
"executor": "@nx/jest:jest",
7676
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
7777
"options": {
78-
"jestConfig": "apps/demo/jest.config.ts"
78+
"jestConfig": "apps/demo/jest.config.ts",
79+
"tsConfig": "apps/demo/tsconfig.spec.json"
7980
}
8081
}
8182
}

apps/demo/src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { provideZoneChangeDetection } from "@angular/core";
12
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
23
import { AppModule } from './app/app.module';
34

45
platformBrowserDynamic()
5-
.bootstrapModule(AppModule)
6+
.bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], })
67
.catch((err) => console.error(err));

apps/demo/src/test-setup.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ globalThis.ngJest = {
55
errorOnUnknownProperties: true,
66
},
77
};
8-
import 'jest-preset-angular/setup-jest';
8+
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
9+
10+
setupZoneTestEnv();

apps/demo/tsconfig.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"noImplicitOverride": true,
99
"noPropertyAccessFromIndexSignature": true,
1010
"noImplicitReturns": true,
11-
"noFallthroughCasesInSwitch": true
11+
"noFallthroughCasesInSwitch": true,
12+
"module": "preserve",
13+
"moduleResolution": "bundler",
14+
"lib": ["dom", "es2022"]
1215
},
1316
"files": [],
1417
"include": [],
@@ -28,6 +31,7 @@
2831
"enableI18nLegacyMessageIdFormat": false,
2932
"strictInjectionParameters": true,
3033
"strictInputAccessModifiers": true,
31-
"strictTemplates": true
34+
"strictTemplates": true,
35+
"strictDomEventTypes": false
3236
}
3337
}

apps/demo/tsconfig.spec.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
5-
"module": "commonjs",
5+
"module": "preserve",
66
"target": "es2016",
7-
"types": ["jest", "node"]
7+
"types": ["jest", "node"],
8+
"moduleResolution": "bundler",
9+
"isolatedModules": true
810
},
911
"files": ["src/test-setup.ts"],
1012
"include": [

libs/ngx-contextmenu/.storybook/main.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
import { fileURLToPath } from "node:url";
2+
import { dirname } from "node:path";
13
import type { StorybookConfig } from '@storybook/angular';
24
import remarkGfm from 'remark-gfm';
35

46
const config: StorybookConfig = {
57
framework: {
6-
name: '@storybook/angular',
8+
name: getAbsolutePath("@storybook/angular"),
79
options: {},
810
},
911

1012
stories: ['../**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
1113

1214
addons: [
1315
{
14-
name: '@storybook/addon-docs',
16+
name: getAbsolutePath("@storybook/addon-docs"),
1517
options: {
1618
mdxPluginOptions: {
1719
mdxCompileOptions: {
@@ -33,3 +35,7 @@ const config: StorybookConfig = {
3335
};
3436

3537
export default config;
38+
39+
function getAbsolutePath(value: string): any {
40+
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
41+
}

libs/ngx-contextmenu/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"url": "git+ssh://git@github.com:PerfectMemory/ngx-contextmenu.git"
2525
},
2626
"peerDependencies": {
27-
"@angular/cdk": "^20.0.3",
28-
"@angular/common": "^20.0.3",
29-
"@angular/core": "^20.0.3"
27+
"@angular/cdk": "^21.0.6",
28+
"@angular/common": "^21.0.6",
29+
"@angular/core": "^21.0.6"
3030
},
3131
"dependencies": {
3232
"tslib": "^2.3.0"

libs/ngx-contextmenu/project.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@
1010
"executor": "@nx/angular:package",
1111
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
1212
"options": {
13-
"project": "libs/ngx-contextmenu/ng-package.json"
13+
"project": "libs/ngx-contextmenu/ng-package.json",
14+
"tsConfig": "libs/ngx-contextmenu/tsconfig.lib.json"
1415
},
1516
"configurations": {
1617
"production": {
1718
"tsConfig": "libs/ngx-contextmenu/tsconfig.lib.prod.json"
1819
},
19-
"development": {
20-
"tsConfig": "libs/ngx-contextmenu/tsconfig.lib.json"
21-
}
20+
"development": {}
2221
},
2322
"defaultConfiguration": "production"
2423
},
2524
"test": {
2625
"executor": "@nx/jest:jest",
2726
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
2827
"options": {
29-
"jestConfig": "libs/ngx-contextmenu/jest.config.ts"
28+
"jestConfig": "libs/ngx-contextmenu/jest.config.ts",
29+
"tsConfig": "libs/ngx-contextmenu/tsconfig.spec.json"
3030
}
3131
},
3232
"lint": {

libs/ngx-contextmenu/src/stories/APIKeyboardNavigation.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { Meta } from '@storybook/addon-docs/blocks';
44

55
# Keyboard navigation
66

7-
| Key | Code | Action |
8-
| :---------- | :--------- | -------------------------------------------------- | --- | -------------------------------------------------------- |
9-
| ContextMenu | 93 | Open a contextmenu when its DOM element is focused |
10-
| ArrowDown | 40 | Move to next menu item (wrapping) |
11-
| ArrowUp | 38 | Move to previous menu item (wrapping) |
12-
| ArrowLeft | ArrowRight | 37 | 39 | Open / Close submenu depending on `dir` (`ltr` or `ltr`) |
13-
| Enter | Space | 13 | 32 | Open submenu or execute current menu item |
14-
| Esc | 27 | Close current menu |
7+
| Key | Code | Action |
8+
| :--------------------- | :------ | -------------------------------------------------------- |
9+
| ContextMenu | 93 | Open a contextmenu when its DOM element is focused |
10+
| ArrowDown | 40 | Move to next menu item (wrapping) |
11+
| ArrowUp | 38 | Move to previous menu item (wrapping) |
12+
| ArrowLeft / ArrowRight | 37 / 39 | Open / Close submenu depending on `dir` (`ltr` or `ltr`) |
13+
| Enter / Space | 13 / 32 | Open submenu or execute current menu item |
14+
| Esc | 27 | Close current menu |

0 commit comments

Comments
 (0)