Support angular >=18 (#107)
* fix peerDependencies to handle angular >=18 * build(package.json): upgrade angular 18 * refactor(lib): removed renderer2 not used * docs(readme): add table installation dependencies
This commit is contained in:
parent
64576c9250
commit
da502ed7f5
7 changed files with 3403 additions and 3963 deletions
|
|
@ -21,6 +21,7 @@
|
|||
"angular 15",
|
||||
"angular 16",
|
||||
"angular 17",
|
||||
"angular 18",
|
||||
"fit text",
|
||||
"responsive text",
|
||||
"responsive font size",
|
||||
|
|
@ -29,8 +30,8 @@
|
|||
"author": "Lorenzo Iovino",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^17.0.0",
|
||||
"@angular/core": "^17.0.0"
|
||||
"@angular/common": ">=18.0.0",
|
||||
"@angular/core": ">=18.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
import { Ng2FittextDirective } from '../../ng2-fittext.directive';
|
||||
import { Ng2FittextDirective } from './ng2-fittext.directive';
|
||||
import { Renderer2, ElementRef } from '@angular/core';
|
||||
|
||||
describe('Class: Ng2FittextDirective', () => {
|
||||
let ng2FittextDirective: Ng2FittextDirective;
|
||||
let elMock: ElementRef;
|
||||
let rendererMock: Renderer2;
|
||||
|
||||
beforeEach(() => {
|
||||
elMock = {} as ElementRef;
|
||||
rendererMock = {} as Renderer2;
|
||||
ng2FittextDirective = new Ng2FittextDirective(elMock, rendererMock);
|
||||
ng2FittextDirective = new Ng2FittextDirective(elMock);
|
||||
});
|
||||
|
||||
describe('Method: setFontSize', () => {
|
||||
|
|
@ -9,7 +9,6 @@ import {
|
|||
EventEmitter,
|
||||
OnChanges,
|
||||
OnInit,
|
||||
Renderer2,
|
||||
} from '@angular/core';
|
||||
|
||||
@Directive({
|
||||
|
|
@ -35,7 +34,7 @@ export class Ng2FittextDirective
|
|||
private speed = 1.05;
|
||||
private done = false;
|
||||
|
||||
constructor(public el: ElementRef<HTMLElement>, public renderer: Renderer2) {}
|
||||
constructor(public el: ElementRef<HTMLElement>) {}
|
||||
|
||||
setFontSize(fontSize: number): void {
|
||||
if (this.isVisible() && !this.isDone()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue