Skip to content

Commit

Permalink
build: upgrade to angular 14
Browse files Browse the repository at this point in the history
BREAKING CHANGE: angular 14 or higher is now required to use this package
  • Loading branch information
mattlewis92 committed Aug 2, 2022
1 parent 292d99f commit 180ab35
Show file tree
Hide file tree
Showing 10 changed files with 4,814 additions and 5,732 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ https://mattlewis92.github.io/angular-resizable-element/

## About

An angular 13.0+ directive that allows an element to be dragged and resized
An angular 14.0+ directive that allows an element to be dragged and resized

## Installation

Expand Down
3 changes: 1 addition & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,5 @@
}
}
}
},
"defaultProject": "demo"
}
}
10,461 changes: 4,776 additions & 5,685 deletions package-lock.json

Large diffs are not rendered by default.

51 changes: 25 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-resizable-element",
"version": "5.0.0",
"description": "An angular 13.0+ directive that allows an element to be dragged and resized",
"description": "An angular 14.0+ directive that allows an element to be dragged and resized",
"scripts": {
"start": "concurrently --raw \"ng serve --open\" \"npm run test:watch\"",
"build:demo": "ng build --configuration production",
Expand Down Expand Up @@ -38,48 +38,47 @@
},
"homepage": "https://github.com/mattlewis92/angular-resizable-element#readme",
"devDependencies": {
"@angular-devkit/build-angular": "~13.3.9",
"@angular-eslint/builder": "13.5.0",
"@angular-eslint/eslint-plugin": "13.5.0",
"@angular-eslint/eslint-plugin-template": "13.5.0",
"@angular-eslint/schematics": "13.5.0",
"@angular-eslint/template-parser": "13.5.0",
"@angular/animations": "~13.3.11",
"@angular/cli": "~13.3.9",
"@angular/common": "~13.3.11",
"@angular/compiler": "~13.3.11",
"@angular/compiler-cli": "~13.3.11",
"@angular/core": "~13.3.11",
"@angular/forms": "~13.3.11",
"@angular/platform-browser": "~13.3.11",
"@angular/platform-browser-dynamic": "~13.3.11",
"@angular/router": "~13.3.11",
"@angular-devkit/build-angular": "^14.1.0",
"@angular-eslint/builder": "14.0.2",
"@angular-eslint/eslint-plugin": "14.0.2",
"@angular-eslint/eslint-plugin-template": "14.0.2",
"@angular-eslint/schematics": "14.0.2",
"@angular-eslint/template-parser": "14.0.2",
"@angular/animations": "^14.1.0",
"@angular/cli": "^14.1.0",
"@angular/common": "^14.1.0",
"@angular/compiler": "^14.1.0",
"@angular/compiler-cli": "^14.1.0",
"@angular/core": "^14.1.0",
"@angular/forms": "^14.1.0",
"@angular/platform-browser": "^14.1.0",
"@angular/platform-browser-dynamic": "^14.1.0",
"@angular/router": "^14.1.0",
"@compodoc/compodoc": "^1.1.19",
"@types/chai": "^4.3.1",
"@types/mocha": "^7.0.2",
"@types/mocha": "^9.1.1",
"@types/node": "^16.11.47",
"@types/sinon": "^10.0.13",
"@types/sinon-chai": "^3.2.8",
"@typescript-eslint/eslint-plugin": "5.3.0",
"@typescript-eslint/parser": "5.3.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"angular-cli-ghpages": "^1.0.3",
"chai": "^4.3.6",
"codecov": "^3.8.3",
"commitizen": "^4.2.5",
"concurrently": "^6.5.1",
"copyfiles": "^2.4.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.2.0",
"eslint": "^8.18.0",
"husky": "^7.0.4",
"karma": "^6.3.20",
"karma-chrome-launcher": "^3.1.1",
"karma-coverage": "~2.0.3",
"karma-coverage": "^2.2.0",
"karma-mocha": "^2.0.1",
"mocha": "^7.2.0",
"ng-packagr": "^13.3.1",
"mocha": "^10.0.0",
"ng-packagr": "^14.1.0",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"process": "^0.11.10",
"rxjs": "^7.5.6",
"sinon": "^14.0.0",
"sinon-chai": "^3.7.0",
Expand All @@ -91,7 +90,7 @@
"zone.js": "^0.11.7"
},
"peerDependencies": {
"@angular/core": ">=13.0.0"
"@angular/core": ">=14.0.0"
},
"config": {
"commitizen": {
Expand Down
1 change: 0 additions & 1 deletion projects/angular-resizable-element/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import 'zone.js';
import 'zone.js/testing';
import 'zone.js/plugins/mocha-patch';
import './test/polyfills';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
Expand Down
3 changes: 0 additions & 3 deletions projects/angular-resizable-element/src/test/polyfills.ts

This file was deleted.

17 changes: 7 additions & 10 deletions projects/angular-resizable-element/src/test/resizable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, DebugElement, ElementRef, ViewChild } from '@angular/core';
import { Component, ElementRef, ViewChild } from '@angular/core';
import {
MOUSE_MOVE_THROTTLE_MS,
ResizableDirective,
Expand All @@ -9,8 +9,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { expect } from 'chai';
import * as sinon from 'sinon';

const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

describe('resizable directive', () => {
@Component({
styles: [
Expand Down Expand Up @@ -77,18 +75,21 @@ describe('resizable directive', () => {
mwlResizeHandle
[resizeEdges]="{ top: true }"
></div>
<div
*ngIf="resizeEdges.left"
class="resize-handle-left"
mwlResizeHandle
[resizeEdges]="{ left: true }"
></div>
<div
*ngIf="resizeEdges.right"
class="resize-handle-right"
mwlResizeHandle
[resizeEdges]="{ right: true }"
></div>
<div
*ngIf="resizeEdges.bottom"
class="resize-handle-bottom"
Expand Down Expand Up @@ -830,7 +831,7 @@ describe('resizable directive', () => {
);
});

it('should only allow resizing of the element along the left side', async () => {
it('should only allow resizing of the element along the left side', () => {
const fixture: ComponentFixture<TestComponent> = createComponent();
const handle = fixture.nativeElement.querySelector('.resize-handle-left');
fixture.componentInstance.resizeEdges = { left: true };
Expand All @@ -839,7 +840,6 @@ describe('resizable directive', () => {
clientX: 100,
clientY: 200,
});
await delay(MOUSE_MOVE_THROTTLE_MS);
triggerDomEvent('mousedown', handle, {
clientX: 100,
clientY: 200,
Expand Down Expand Up @@ -1113,7 +1113,7 @@ describe('resizable directive', () => {
expect(onComplete).to.have.been.calledOnce;
});

it('should set the resize active class', async () => {
it('should set the resize active class', () => {
const fixture: ComponentFixture<TestComponent> = createComponent();
fixture.detectChanges();
const elm: HTMLElement =
Expand All @@ -1124,7 +1124,6 @@ describe('resizable directive', () => {
clientY: 210,
});
expect(elm.classList.contains('resize-active')).to.be.false;
await delay(MOUSE_MOVE_THROTTLE_MS);
triggerDomEvent('mousedown', handle, {
clientX: 100,
clientY: 210,
Expand All @@ -1133,7 +1132,6 @@ describe('resizable directive', () => {
clientX: 101,
clientY: 210,
});
await delay(MOUSE_MOVE_THROTTLE_MS);
expect(elm.classList.contains('resize-active')).to.be.true;
triggerDomEvent('mouseup', handle, {
clientX: 101,
Expand Down Expand Up @@ -1427,7 +1425,7 @@ describe('resizable directive', () => {
});
});

it('should set the resize cursor on the body when resizing', async () => {
it('should set the resize cursor on the body when resizing', () => {
const fixture: ComponentFixture<TestComponent> = createComponent();
const elm: HTMLElement =
fixture.componentInstance.resizable.elm.nativeElement;
Expand All @@ -1440,7 +1438,6 @@ describe('resizable directive', () => {
clientX: 101,
clientY: 200,
});
await delay(MOUSE_MOVE_THROTTLE_MS);
expect(document.body.style.cursor).to.equal('col-resize');
triggerDomEvent('mouseup', handle, {
clientX: 101,
Expand Down
2 changes: 1 addition & 1 deletion projects/angular-resizable-element/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"target": "es2020",
"declaration": true,
"declarationMap": true,
"inlineSources": true,
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
min-height: 100vh;
}
</style>
<title>angular 13.0+ resizable element</title>
<title>angular 14.0+ resizable element</title>
</head>
<body>
<a
Expand All @@ -31,7 +31,7 @@
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">angular 13.0+ resizable element</a>
<a class="navbar-brand" href="#">angular 14.0+ resizable element</a>
</div>
<ul class="nav navbar-nav hidden-xs">
<li><a href="#demo">Demo</a></li>
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"target": "es2020",
"module": "es2020",
"lib": [
"es2018",
Expand Down

0 comments on commit 180ab35

Please sign in to comment.