Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: chrum/ngx-autosize
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.6.3
Choose a base ref
...
head repository: chrum/ngx-autosize
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 22,469 additions and 11,346 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .nvmrc
  3. +21 −1 README.md
  4. +98 −126 angular.json
  5. +0 −28 e2e/protractor.conf.js
  6. +0 −14 e2e/src/app.e2e-spec.ts
  7. +0 −11 e2e/src/app.po.ts
  8. +0 −13 e2e/tsconfig.e2e.json
  9. +21,082 −10,215 package-lock.json
  10. +31 −43 package.json
  11. +0 −187 projects/autosize/src/lib/autosize.directive.ts
  12. +0 −10 projects/autosize/src/lib/autosize.module.ts
  13. +0 −35 projects/autosize/tsconfig.lib.json
  14. +0 −17 projects/autosize/tslint.json
  15. +20 −7 {src → projects/ngx-autosize-demo}/karma.conf.js
  16. +207 −0 projects/ngx-autosize-demo/src/app/app.component.html
  17. +85 −0 projects/ngx-autosize-demo/src/app/app.component.scss
  18. +31 −0 projects/ngx-autosize-demo/src/app/app.component.spec.ts
  19. +90 −0 projects/ngx-autosize-demo/src/app/app.component.ts
  20. +25 −0 projects/ngx-autosize-demo/src/app/app.module.ts
  21. BIN projects/ngx-autosize-demo/src/assets/bg/bg-header.jpg
  22. BIN projects/ngx-autosize-demo/src/assets/favicon.ico
  23. +31 −0 projects/ngx-autosize-demo/src/assets/favicon.svg
  24. BIN projects/ngx-autosize-demo/src/assets/logo/logo-invert.ico
  25. BIN projects/ngx-autosize-demo/src/assets/logo/logo-invert.png
  26. BIN projects/ngx-autosize-demo/src/assets/logo/logo.png
  27. +31 −0 projects/ngx-autosize-demo/src/assets/logo/logo.svg
  28. 0 { → projects/ngx-autosize-demo}/src/environments/environment.prod.ts
  29. +2 −2 { → projects/ngx-autosize-demo}/src/environments/environment.ts
  30. BIN projects/ngx-autosize-demo/src/favicon.ico
  31. +165 −0 projects/ngx-autosize-demo/src/index.html
  32. 0 { → projects/ngx-autosize-demo}/src/main.ts
  33. +53 −0 projects/ngx-autosize-demo/src/polyfills.ts
  34. 0 { → projects/ngx-autosize-demo}/src/styles.scss
  35. +2 −8 { → projects/ngx-autosize-demo}/src/test.ts
  36. +15 −0 projects/ngx-autosize-demo/tsconfig.app.json
  37. +18 −0 projects/ngx-autosize-demo/tsconfig.spec.json
  38. +98 −0 projects/ngx-autosize/README.md
  39. +19 −6 projects/{autosize → ngx-autosize}/karma.conf.js
  40. +2 −2 projects/{autosize → ngx-autosize}/ng-package.json
  41. +7 −3 projects/{autosize → ngx-autosize}/package.json
  42. +243 −0 projects/ngx-autosize/src/lib/autosize.directive.ts
  43. +14 −0 projects/ngx-autosize/src/lib/autosize.module.ts
  44. +8 −0 projects/ngx-autosize/src/lib/window-ref.service.ts
  45. +2 −1 projects/{autosize/src/public_api.ts → ngx-autosize/src/public-api.ts}
  46. +3 −10 projects/{autosize → ngx-autosize}/src/test.ts
  47. +15 −0 projects/ngx-autosize/tsconfig.lib.json
  48. +10 −0 projects/ngx-autosize/tsconfig.lib.prod.json
  49. +2 −2 projects/{autosize → ngx-autosize}/tsconfig.spec.json
  50. +0 −105 src/app/app.component.html
  51. +0 −16 src/app/app.component.scss
  52. +0 −31 src/app/app.component.spec.ts
  53. +0 −41 src/app/app.component.ts
  54. +0 −23 src/app/app.module.ts
  55. 0 src/assets/.gitkeep
  56. +0 −11 src/browserslist
  57. BIN src/favicon.ico
  58. +0 −88 src/index.html
  59. +0 −80 src/polyfills.ts
  60. +0 −11 src/tsconfig.app.json
  61. +0 −18 src/tsconfig.spec.json
  62. +0 −17 src/tslint.json
  63. +37 −33 tsconfig.json
  64. +0 −131 tslint.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
/tmp
/out-tsc
/.ng_pkg_build
.angular

# dependencies
/node_modules
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.17.0
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -12,11 +12,16 @@ It adjusts the textarea height automatically to any text input, or changes to th
Check the demo [here](https://chrum.it/pages/ngx-autosize)

## Installation:

**angular 12+**
```bash
npm install ngx-autosize
```

**for angular <12**
```bash
npm install ngx-autosize@1
```

## Use Example:

Add the declaration to your @NgModule:
@@ -47,6 +52,11 @@ Use directly inside your HTML templates
And this is Ionic2 example
</ion-textarea>
```
## Dynamically enable directive
```
<textarea [autosize]="true"></textarea> // Enabled (defalut)
<textarea [autosize]="false"></textarea> // Disabled
```
## Settings
Name | Default | Type | Description
--- | --- | --- | ---
@@ -61,7 +71,17 @@ Example
Hello, this is an example of Autosize in Angular2.
</textarea>
```
## Events / Outputs
Name | Description
--- | ---
resized | Called whenever textarea has changes its size. New height as a param.

Example
```
<textarea autosize (resized)="onResized($event)">
You need to implement 'onResized' yourself
</textarea>
```

## Origins
This small lib is based on great
224 changes: 98 additions & 126 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,174 +1,146 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ngx-autosize-app": {
"root": "",
"sourceRoot": "src",
"ngx-autosize": {
"projectType": "library",
"root": "projects/ngx-autosize",
"sourceRoot": "projects/ngx-autosize/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/ngx-autosize/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/ngx-autosize/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/ngx-autosize/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/ngx-autosize/src/test.ts",
"tsConfig": "projects/ngx-autosize/tsconfig.spec.json",
"karmaConfig": "projects/ngx-autosize/karma.conf.js"
}
}
}
},
"ngx-autosize-demo": {
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"styleext": "scss"
"style": "scss"
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "projects/ngx-autosize-demo",
"sourceRoot": "projects/ngx-autosize-demo/src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/ngx-autosize-app",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"outputPath": {
"base": "dist/ngx-autosize-demo"
},
"index": "projects/ngx-autosize-demo/src/index.html",
"polyfills": [
"projects/ngx-autosize-demo/src/polyfills.ts"
],
"tsConfig": "projects/ngx-autosize-demo/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
"projects/ngx-autosize-demo/src/favicon.ico",
"projects/ngx-autosize-demo/src/assets"
],
"styles": [
"src/styles.scss"
"projects/ngx-autosize-demo/src/styles.scss"
],
"scripts": []
"scripts": [],
"browser": "projects/ngx-autosize-demo/src/main.ts"
},
"configurations": {
"production": {
"fileReplacements": [
"budgets": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
"fileReplacements": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
"replace": "projects/ngx-autosize-demo/src/environments/environment.ts",
"with": "projects/ngx-autosize-demo/src/environments/environment.prod.ts"
}
]
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ngx-autosize-app:build"
},
"configurations": {
"production": {
"browserTarget": "ngx-autosize-app:build:production"
"buildTarget": "ngx-autosize-demo:build:production"
},
"development": {
"buildTarget": "ngx-autosize-demo:build:development"
}
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ngx-autosize-app:build"
"buildTarget": "ngx-autosize-demo:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.scss"
],
"scripts": [],
"main": "projects/ngx-autosize-demo/src/test.ts",
"polyfills": "projects/ngx-autosize-demo/src/polyfills.ts",
"tsConfig": "projects/ngx-autosize-demo/tsconfig.spec.json",
"karmaConfig": "projects/ngx-autosize-demo/karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
"projects/ngx-autosize-demo/src/favicon.ico",
"projects/ngx-autosize-demo/src/assets"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"ngx-autosize-app-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "ngx-autosize-app:serve"
},
"configurations": {
"production": {
"devServerTarget": "ngx-autosize-app:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"ngx-autosize": {
"root": "projects/autosize",
"sourceRoot": "projects/autosize/src",
"projectType": "library",
"prefix": "ngx",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/autosize/tsconfig.lib.json",
"project": "projects/autosize/ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/autosize/src/test.ts",
"tsConfig": "projects/autosize/tsconfig.spec.json",
"karmaConfig": "projects/autosize/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/autosize/tsconfig.lib.json",
"projects/autosize/tsconfig.spec.json"
"styles": [
"projects/ngx-autosize-demo/src/styles.scss"
],
"exclude": [
"**/node_modules/**"
]
"scripts": []
}
}
}
}
},
"defaultProject": "ngx-autosize-app"
}
}
}
28 changes: 0 additions & 28 deletions e2e/protractor.conf.js

This file was deleted.

14 changes: 0 additions & 14 deletions e2e/src/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions e2e/src/app.po.ts

This file was deleted.

Loading