ngx-ratio-image 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/esm2022/lib/ratio-image/ratio-image.component.mjs +77 -0
  2. package/esm2022/lib/ratio-image.module.mjs +18 -0
  3. package/esm2022/ngx-ratio-image.mjs +5 -0
  4. package/esm2022/public-api.mjs +6 -0
  5. package/fesm2022/ngx-ratio-image.mjs +103 -0
  6. package/fesm2022/ngx-ratio-image.mjs.map +1 -0
  7. package/index.d.ts +5 -0
  8. package/lib/ratio-image/ratio-image.component.d.ts +31 -0
  9. package/lib/ratio-image.module.d.ts +8 -0
  10. package/package.json +37 -88
  11. package/{projects/ngx-ratio-image/src/public-api.ts → public-api.d.ts} +0 -4
  12. package/.editorconfig +0 -16
  13. package/.eslintrc.json +0 -38
  14. package/.github/workflows/node.js.yml +0 -38
  15. package/.github/workflows/npm-publish.yml +0 -42
  16. package/.nvmrc +0 -1
  17. package/.prettierignore +0 -3
  18. package/.run/lint.run.xml +0 -12
  19. package/.run/test.run.xml +0 -12
  20. package/.vscode/extensions.json +0 -4
  21. package/.vscode/launch.json +0 -20
  22. package/.vscode/tasks.json +0 -42
  23. package/angular.json +0 -144
  24. package/ng-package.json +0 -8
  25. package/prettier.config.js +0 -16
  26. package/projects/ngx-ratio-image/.eslintrc.json +0 -31
  27. package/projects/ngx-ratio-image/LICENSE +0 -21
  28. package/projects/ngx-ratio-image/README.md +0 -27
  29. package/projects/ngx-ratio-image/ng-package.json +0 -7
  30. package/projects/ngx-ratio-image/package.json +0 -25
  31. package/projects/ngx-ratio-image/src/lib/ratio-image/ratio-image.component.html +0 -42
  32. package/projects/ngx-ratio-image/src/lib/ratio-image/ratio-image.component.spec.ts +0 -21
  33. package/projects/ngx-ratio-image/src/lib/ratio-image/ratio-image.component.ts +0 -75
  34. package/projects/ngx-ratio-image/src/lib/ratio-image.module.ts +0 -10
  35. package/projects/ngx-ratio-image/tsconfig.lib.json +0 -12
  36. package/projects/ngx-ratio-image/tsconfig.lib.prod.json +0 -10
  37. package/projects/ngx-ratio-image/tsconfig.spec.json +0 -9
  38. package/projects/ratio-image-app/.eslintrc.json +0 -31
  39. package/projects/ratio-image-app/src/app/app-routing.module.ts +0 -26
  40. package/projects/ratio-image-app/src/app/app.component.html +0 -14
  41. package/projects/ratio-image-app/src/app/app.component.scss +0 -25
  42. package/projects/ratio-image-app/src/app/app.component.spec.ts +0 -38
  43. package/projects/ratio-image-app/src/app/app.component.ts +0 -19
  44. package/projects/ratio-image-app/src/app/app.module.ts +0 -33
  45. package/projects/ratio-image-app/src/app/header.component.html +0 -10
  46. package/projects/ratio-image-app/src/app/header.component.scss +0 -25
  47. package/projects/ratio-image-app/src/app/header.component.spec.ts +0 -35
  48. package/projects/ratio-image-app/src/app/header.component.ts +0 -13
  49. package/projects/ratio-image-app/src/app/home/home-routing.module.ts +0 -17
  50. package/projects/ratio-image-app/src/app/home/home.component.html +0 -24
  51. package/projects/ratio-image-app/src/app/home/home.component.scss +0 -0
  52. package/projects/ratio-image-app/src/app/home/home.component.spec.ts +0 -24
  53. package/projects/ratio-image-app/src/app/home/home.component.ts +0 -12
  54. package/projects/ratio-image-app/src/app/home/home.module.ts +0 -12
  55. package/projects/ratio-image-app/src/app/interactive/interactive-routing.module.ts +0 -17
  56. package/projects/ratio-image-app/src/app/interactive/interactive.component.html +0 -40
  57. package/projects/ratio-image-app/src/app/interactive/interactive.component.scss +0 -0
  58. package/projects/ratio-image-app/src/app/interactive/interactive.component.spec.ts +0 -43
  59. package/projects/ratio-image-app/src/app/interactive/interactive.component.ts +0 -32
  60. package/projects/ratio-image-app/src/app/interactive/interactive.module.ts +0 -31
  61. package/projects/ratio-image-app/src/assets/.gitkeep +0 -0
  62. package/projects/ratio-image-app/src/assets/1to1.jpg +0 -0
  63. package/projects/ratio-image-app/src/assets/3to4.jpg +0 -0
  64. package/projects/ratio-image-app/src/assets/4to3.jpg +0 -0
  65. package/projects/ratio-image-app/src/favicon.ico +0 -0
  66. package/projects/ratio-image-app/src/index.html +0 -16
  67. package/projects/ratio-image-app/src/main.ts +0 -7
  68. package/projects/ratio-image-app/src/styles.scss +0 -15
  69. package/projects/ratio-image-app/tsconfig.app.json +0 -10
  70. package/projects/ratio-image-app/tsconfig.spec.json +0 -9
  71. package/tsconfig.json +0 -33
@@ -0,0 +1,77 @@
1
+ import { Component, Input } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@angular/common";
4
+ export class RatioImageComponent {
5
+ constructor() {
6
+ this.src = '';
7
+ this.width = 0;
8
+ this.height = 0;
9
+ this.debug = false;
10
+ this.imageWidth = 0;
11
+ this.imageHeight = 0;
12
+ this.naturalWidth = 0;
13
+ this.naturalHeight = 0;
14
+ this.imageLeft = 0;
15
+ this.imageTop = 0;
16
+ this.ratioImage = 1;
17
+ this.ratioBox = 1;
18
+ this.scale = 1;
19
+ if (this.debug)
20
+ console.log('constructor', this.src);
21
+ }
22
+ ngAfterViewInit() {
23
+ if (this.debug)
24
+ console.log('ngAfterViewInit', this.src, this.width, this.height);
25
+ }
26
+ onImageLoad(img) {
27
+ if (this.debug)
28
+ console.log('onImageLoad ', img);
29
+ if (img) {
30
+ this.naturalWidth = img.naturalWidth;
31
+ this.naturalHeight = img.naturalHeight;
32
+ if (this.width > 0 && this.height > 0) {
33
+ this.calculate();
34
+ }
35
+ }
36
+ }
37
+ ngOnChanges() {
38
+ this.calculate();
39
+ }
40
+ calculate() {
41
+ this.ratioImage = this.naturalWidth / this.naturalHeight;
42
+ this.ratioBox = this.width / this.height;
43
+ if (this.ratioBox > this.ratioImage) {
44
+ this.scale = this.height / this.naturalHeight;
45
+ this.imageLeft = (this.width - this.naturalWidth * this.scale) / 2;
46
+ }
47
+ else if (this.ratioBox < this.ratioImage) {
48
+ this.scale = this.width / this.naturalWidth;
49
+ this.imageTop = (this.height - this.naturalHeight * this.scale) / 2;
50
+ }
51
+ else {
52
+ this.scale = this.width / this.naturalWidth;
53
+ this.imageLeft = 0;
54
+ this.imageTop = 0;
55
+ }
56
+ if (this.debug)
57
+ console.log('calculate', this.src, this.naturalWidth + ' x ' + this.naturalHeight);
58
+ }
59
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: RatioImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
60
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: RatioImageComponent, selector: "ngx-ratio-image", inputs: { src: "src", width: "width", height: "height", debug: "debug" }, usesOnChanges: true, ngImport: i0, template: "<div\n\t[style.position]=\"'relative'\"\n\t[style.z-index]=\"2\"\n\t[style.border]=\"debug ? '1px solid red' : ''\"\n\t[style.width]=\"width + 'px'\"\n\t[style.height]=\"height + 'px'\"\n>\n\t<img\n\t\tclass=\"img-background\"\n\t\t#img\n\t\t[src]=\"src\"\n\t\t[style.position]=\"'absolute'\"\n\t\t[style.z-index]=\"1\"\n\t\t[style.filter]=\"'blur(5px)'\"\n\t\t[style.opacity]=\"0.5\"\n\t\t[width]=\"width\"\n\t\t[height]=\"height\"\n\t\t[style.overflow]=\"'hidden'\"\n\t\t(load)=\"onImageLoad(img)\"\n\t\talt=\"\"\n\t/>\n\t<img\n\t\tclass=\"img-main\"\n\t\t[src]=\"src\"\n\t\t[width]=\"naturalWidth * scale\"\n\t\t[height]=\"naturalHeight * scale\"\n\t\t[style.position]=\"'absolute'\"\n\t\t[style.z-index]=\"2\"\n\t\t[style.left]=\"imageLeft + 'px'\"\n\t\t[style.top]=\"imageTop + 'px'\"\n\t\talt=\"\"\n\t/>\n</div>\n<div *ngIf=\"debug\" style=\"margin-top: 10px\">\n\t<div>Container: {{ width }} x {{ height }}</div>\n\t<div>Natural: {{ naturalWidth }} x {{ naturalHeight }}</div>\n\t<div>Pos: {{ imageLeft }} , {{ imageTop }}</div>\n\t<div>Scale: {{ scale | number: '0.0-2' }}</div>\n\t<div>\n\t\tRatio Box , Image: {{ this.ratioBox | number: '0.0-2' }} : 1 , {{ this.ratioImage | number: '0.0-2' }} : 1\n\t</div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }] }); }
61
+ }
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: RatioImageComponent, decorators: [{
63
+ type: Component,
64
+ args: [{ selector: 'ngx-ratio-image', template: "<div\n\t[style.position]=\"'relative'\"\n\t[style.z-index]=\"2\"\n\t[style.border]=\"debug ? '1px solid red' : ''\"\n\t[style.width]=\"width + 'px'\"\n\t[style.height]=\"height + 'px'\"\n>\n\t<img\n\t\tclass=\"img-background\"\n\t\t#img\n\t\t[src]=\"src\"\n\t\t[style.position]=\"'absolute'\"\n\t\t[style.z-index]=\"1\"\n\t\t[style.filter]=\"'blur(5px)'\"\n\t\t[style.opacity]=\"0.5\"\n\t\t[width]=\"width\"\n\t\t[height]=\"height\"\n\t\t[style.overflow]=\"'hidden'\"\n\t\t(load)=\"onImageLoad(img)\"\n\t\talt=\"\"\n\t/>\n\t<img\n\t\tclass=\"img-main\"\n\t\t[src]=\"src\"\n\t\t[width]=\"naturalWidth * scale\"\n\t\t[height]=\"naturalHeight * scale\"\n\t\t[style.position]=\"'absolute'\"\n\t\t[style.z-index]=\"2\"\n\t\t[style.left]=\"imageLeft + 'px'\"\n\t\t[style.top]=\"imageTop + 'px'\"\n\t\talt=\"\"\n\t/>\n</div>\n<div *ngIf=\"debug\" style=\"margin-top: 10px\">\n\t<div>Container: {{ width }} x {{ height }}</div>\n\t<div>Natural: {{ naturalWidth }} x {{ naturalHeight }}</div>\n\t<div>Pos: {{ imageLeft }} , {{ imageTop }}</div>\n\t<div>Scale: {{ scale | number: '0.0-2' }}</div>\n\t<div>\n\t\tRatio Box , Image: {{ this.ratioBox | number: '0.0-2' }} : 1 , {{ this.ratioImage | number: '0.0-2' }} : 1\n\t</div>\n</div>\n" }]
65
+ }], ctorParameters: function () { return []; }, propDecorators: { src: [{
66
+ type: Input,
67
+ args: [{ required: true }]
68
+ }], width: [{
69
+ type: Input,
70
+ args: [{ required: true }]
71
+ }], height: [{
72
+ type: Input,
73
+ args: [{ required: true }]
74
+ }], debug: [{
75
+ type: Input
76
+ }] } });
77
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmF0aW8taW1hZ2UuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXJhdGlvLWltYWdlL3NyYy9saWIvcmF0aW8taW1hZ2UvcmF0aW8taW1hZ2UuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXJhdGlvLWltYWdlL3NyYy9saWIvcmF0aW8taW1hZ2UvcmF0aW8taW1hZ2UuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFpQixTQUFTLEVBQUUsS0FBSyxFQUFhLE1BQU0sZUFBZSxDQUFDOzs7QUFjM0UsTUFBTSxPQUFPLG1CQUFtQjtJQW1CL0I7UUFsQmtDLFFBQUcsR0FBRyxFQUFFLENBQUM7UUFDVCxVQUFLLEdBQUcsQ0FBQyxDQUFDO1FBQ1YsV0FBTSxHQUFHLENBQUMsQ0FBQztRQUM3QixVQUFLLEdBQUcsS0FBSyxDQUFDO1FBRXZCLGVBQVUsR0FBRyxDQUFDLENBQUM7UUFDZixnQkFBVyxHQUFHLENBQUMsQ0FBQztRQUVoQixpQkFBWSxHQUFHLENBQUMsQ0FBQztRQUNqQixrQkFBYSxHQUFHLENBQUMsQ0FBQztRQUVsQixjQUFTLEdBQUcsQ0FBQyxDQUFDO1FBQ2QsYUF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N0eWxlLnRvcF09XCJpbWFnZVRvcCArICdweCdcIlxuXHRcdGFsdD1cIlwiXG5cdC8+XG48L2Rpdj5cbjxkaXYgKm5nSWY9XCJkZWJ1Z1wiIHN0eWxlPVwibWFyZ2luLXRvcDogMTBweFwiPlxuXHQ8ZGl2PkNvbnRhaW5lcjoge3sgd2lkdGggfX0geCB7eyBoZWlnaHQgfX08L2Rpdj5cblx0PGRpdj5OYXR1cmFsOiB7eyBuYXR1cmFsV2lkdGggfX0geCB7eyBuYXR1cmFsSGVpZ2h0IH19PC9kaXY+XG5cdDxkaXY+UG9zOiB7eyBpbWFnZUxlZnQgfX0gLCB7eyBpbWFnZVRvcCB9fTwvZGl2PlxuXHQ8ZGl2PlNjYWxlOiB7eyBzY2FsZSB8IG51bWJlcjogJzAuMC0yJyB9fTwvZGl2PlxuXHQ8ZGl2PlxuXHRcdFJhdGlvIEJveCAsIEltYWdlOiB7eyB0aGlzLnJhdGlvQm94IHwgbnVtYmVyOiAnMC4wLTInIH19IDogMSAsIHt7IHRoaXMucmF0aW9JbWFnZSB8IG51bWJlcjogJzAuMC0yJyB9fSA6IDFcblx0PC9kaXY+XG48L2Rpdj5cbiJdfQ==
@@ -0,0 +1,18 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { RatioImageComponent } from './ratio-image/ratio-image.component';
3
+ import { DecimalPipe, NgIf } from '@angular/common';
4
+ import * as i0 from "@angular/core";
5
+ export class RatioImageModule {
6
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: RatioImageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
7
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.2", ngImport: i0, type: RatioImageModule, declarations: [RatioImageComponent], imports: [NgIf, DecimalPipe], exports: [RatioImageComponent] }); }
8
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: RatioImageModule }); }
9
+ }
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: RatioImageModule, decorators: [{
11
+ type: NgModule,
12
+ args: [{
13
+ declarations: [RatioImageComponent],
14
+ imports: [NgIf, DecimalPipe],
15
+ exports: [RatioImageComponent]
16
+ }]
17
+ }] });
18
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmF0aW8taW1hZ2UubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXJhdGlvLWltYWdlL3NyYy9saWIvcmF0aW8taW1hZ2UubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFDMUUsT0FBTyxFQUFFLFdBQVcsRUFBRSxJQUFJLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQzs7QUFPcEQsTUFBTSxPQUFPLGdCQUFnQjs4R0FBaEIsZ0JBQWdCOytHQUFoQixnQkFBZ0IsaUJBSmIsbUJBQW1CLGFBQ3hCLElBQUksRUFBRSxXQUFXLGFBQ2pCLG1CQUFtQjsrR0FFakIsZ0JBQWdCOzsyRkFBaEIsZ0JBQWdCO2tCQUw1QixRQUFRO21CQUFDO29CQUNULFlBQVksRUFBRSxDQUFDLG1CQUFtQixDQUFDO29CQUNuQyxPQUFPLEVBQUUsQ0FBQyxJQUFJLEVBQUUsV0FBVyxDQUFDO29CQUM1QixPQUFPLEVBQUUsQ0FBQyxtQkFBbUIsQ0FBQztpQkFDOUIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgUmF0aW9JbWFnZUNvbXBvbmVudCB9IGZyb20gJy4vcmF0aW8taW1hZ2UvcmF0aW8taW1hZ2UuY29tcG9uZW50JztcbmltcG9ydCB7IERlY2ltYWxQaXBlLCBOZ0lmIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcblxuQE5nTW9kdWxlKHtcblx0ZGVjbGFyYXRpb25zOiBbUmF0aW9JbWFnZUNvbXBvbmVudF0sXG5cdGltcG9ydHM6IFtOZ0lmLCBEZWNpbWFsUGlwZV0sXG5cdGV4cG9ydHM6IFtSYXRpb0ltYWdlQ29tcG9uZW50XVxufSlcbmV4cG9ydCBjbGFzcyBSYXRpb0ltYWdlTW9kdWxlIHt9XG4iXX0=
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public-api';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXJhdGlvLWltYWdlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvbmd4LXJhdGlvLWltYWdlL3NyYy9uZ3gtcmF0aW8taW1hZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Public API Surface of ngx-ratio-image
3
+ */
4
+ export * from './lib/ratio-image/ratio-image.component';
5
+ export * from './lib/ratio-image.module';
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25neC1yYXRpby1pbWFnZS9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMseUNBQXlDLENBQUM7QUFDeEQsY0FBYywwQkFBMEIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2Ygbmd4LXJhdGlvLWltYWdlXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9saWIvcmF0aW8taW1hZ2UvcmF0aW8taW1hZ2UuY29tcG9uZW50JztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3JhdGlvLWltYWdlLm1vZHVsZSc7XG4iXX0=
@@ -0,0 +1,103 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, Input, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { NgIf, DecimalPipe } from '@angular/common';
5
+
6
+ class RatioImageComponent {
7
+ constructor() {
8
+ this.src = '';
9
+ this.width = 0;
10
+ this.height = 0;
11
+ this.debug = false;
12
+ this.imageWidth = 0;
13
+ this.imageHeight = 0;
14
+ this.naturalWidth = 0;
15
+ this.naturalHeight = 0;
16
+ this.imageLeft = 0;
17
+ this.imageTop = 0;
18
+ this.ratioImage = 1;
19
+ this.ratioBox = 1;
20
+ this.scale = 1;
21
+ if (this.debug)
22
+ console.log('constructor', this.src);
23
+ }
24
+ ngAfterViewInit() {
25
+ if (this.debug)
26
+ console.log('ngAfterViewInit', this.src, this.width, this.height);
27
+ }
28
+ onImageLoad(img) {
29
+ if (this.debug)
30
+ console.log('onImageLoad ', img);
31
+ if (img) {
32
+ this.naturalWidth = img.naturalWidth;
33
+ this.naturalHeight = img.naturalHeight;
34
+ if (this.width > 0 && this.height > 0) {
35
+ this.calculate();
36
+ }
37
+ }
38
+ }
39
+ ngOnChanges() {
40
+ this.calculate();
41
+ }
42
+ calculate() {
43
+ this.ratioImage = this.naturalWidth / this.naturalHeight;
44
+ this.ratioBox = this.width / this.height;
45
+ if (this.ratioBox > this.ratioImage) {
46
+ this.scale = this.height / this.naturalHeight;
47
+ this.imageLeft = (this.width - this.naturalWidth * this.scale) / 2;
48
+ }
49
+ else if (this.ratioBox < this.ratioImage) {
50
+ this.scale = this.width / this.naturalWidth;
51
+ this.imageTop = (this.height - this.naturalHeight * this.scale) / 2;
52
+ }
53
+ else {
54
+ this.scale = this.width / this.naturalWidth;
55
+ this.imageLeft = 0;
56
+ this.imageTop = 0;
57
+ }
58
+ if (this.debug)
59
+ console.log('calculate', this.src, this.naturalWidth + ' x ' + this.naturalHeight);
60
+ }
61
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: RatioImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
62
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: RatioImageComponent, selector: "ngx-ratio-image", inputs: { src: "src", width: "width", height: "height", debug: "debug" }, usesOnChanges: true, ngImport: i0, template: "<div\n\t[style.position]=\"'relative'\"\n\t[style.z-index]=\"2\"\n\t[style.border]=\"debug ? '1px solid red' : ''\"\n\t[style.width]=\"width + 'px'\"\n\t[style.height]=\"height + 'px'\"\n>\n\t<img\n\t\tclass=\"img-background\"\n\t\t#img\n\t\t[src]=\"src\"\n\t\t[style.position]=\"'absolute'\"\n\t\t[style.z-index]=\"1\"\n\t\t[style.filter]=\"'blur(5px)'\"\n\t\t[style.opacity]=\"0.5\"\n\t\t[width]=\"width\"\n\t\t[height]=\"height\"\n\t\t[style.overflow]=\"'hidden'\"\n\t\t(load)=\"onImageLoad(img)\"\n\t\talt=\"\"\n\t/>\n\t<img\n\t\tclass=\"img-main\"\n\t\t[src]=\"src\"\n\t\t[width]=\"naturalWidth * scale\"\n\t\t[height]=\"naturalHeight * scale\"\n\t\t[style.position]=\"'absolute'\"\n\t\t[style.z-index]=\"2\"\n\t\t[style.left]=\"imageLeft + 'px'\"\n\t\t[style.top]=\"imageTop + 'px'\"\n\t\talt=\"\"\n\t/>\n</div>\n<div *ngIf=\"debug\" style=\"margin-top: 10px\">\n\t<div>Container: {{ width }} x {{ height }}</div>\n\t<div>Natural: {{ naturalWidth }} x {{ naturalHeight }}</div>\n\t<div>Pos: {{ imageLeft }} , {{ imageTop }}</div>\n\t<div>Scale: {{ scale | number: '0.0-2' }}</div>\n\t<div>\n\t\tRatio Box , Image: {{ this.ratioBox | number: '0.0-2' }} : 1 , {{ this.ratioImage | number: '0.0-2' }} : 1\n\t</div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }] }); }
63
+ }
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: RatioImageComponent, decorators: [{
65
+ type: Component,
66
+ args: [{ selector: 'ngx-ratio-image', template: "<div\n\t[style.position]=\"'relative'\"\n\t[style.z-index]=\"2\"\n\t[style.border]=\"debug ? '1px solid red' : ''\"\n\t[style.width]=\"width + 'px'\"\n\t[style.height]=\"height + 'px'\"\n>\n\t<img\n\t\tclass=\"img-background\"\n\t\t#img\n\t\t[src]=\"src\"\n\t\t[style.position]=\"'absolute'\"\n\t\t[style.z-index]=\"1\"\n\t\t[style.filter]=\"'blur(5px)'\"\n\t\t[style.opacity]=\"0.5\"\n\t\t[width]=\"width\"\n\t\t[height]=\"height\"\n\t\t[style.overflow]=\"'hidden'\"\n\t\t(load)=\"onImageLoad(img)\"\n\t\talt=\"\"\n\t/>\n\t<img\n\t\tclass=\"img-main\"\n\t\t[src]=\"src\"\n\t\t[width]=\"naturalWidth * scale\"\n\t\t[height]=\"naturalHeight * scale\"\n\t\t[style.position]=\"'absolute'\"\n\t\t[style.z-index]=\"2\"\n\t\t[style.left]=\"imageLeft + 'px'\"\n\t\t[style.top]=\"imageTop + 'px'\"\n\t\talt=\"\"\n\t/>\n</div>\n<div *ngIf=\"debug\" style=\"margin-top: 10px\">\n\t<div>Container: {{ width }} x {{ height }}</div>\n\t<div>Natural: {{ naturalWidth }} x {{ naturalHeight }}</div>\n\t<div>Pos: {{ imageLeft }} , {{ imageTop }}</div>\n\t<div>Scale: {{ scale | number: '0.0-2' }}</div>\n\t<div>\n\t\tRatio Box , Image: {{ this.ratioBox | number: '0.0-2' }} : 1 , {{ this.ratioImage | number: '0.0-2' }} : 1\n\t</div>\n</div>\n" }]
67
+ }], ctorParameters: function () { return []; }, propDecorators: { src: [{
68
+ type: Input,
69
+ args: [{ required: true }]
70
+ }], width: [{
71
+ type: Input,
72
+ args: [{ required: true }]
73
+ }], height: [{
74
+ type: Input,
75
+ args: [{ required: true }]
76
+ }], debug: [{
77
+ type: Input
78
+ }] } });
79
+
80
+ class RatioImageModule {
81
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: RatioImageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
82
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.2", ngImport: i0, type: RatioImageModule, declarations: [RatioImageComponent], imports: [NgIf, DecimalPipe], exports: [RatioImageComponent] }); }
83
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: RatioImageModule }); }
84
+ }
85
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: RatioImageModule, decorators: [{
86
+ type: NgModule,
87
+ args: [{
88
+ declarations: [RatioImageComponent],
89
+ imports: [NgIf, DecimalPipe],
90
+ exports: [RatioImageComponent]
91
+ }]
92
+ }] });
93
+
94
+ /*
95
+ * Public API Surface of ngx-ratio-image
96
+ */
97
+
98
+ /**
99
+ * Generated bundle index. Do not edit.
100
+ */
101
+
102
+ export { RatioImageComponent, RatioImageModule };
103
+ //# sourceMappingURL=ngx-ratio-image.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-ratio-image.mjs","sources":["../../../projects/ngx-ratio-image/src/lib/ratio-image/ratio-image.component.ts","../../../projects/ngx-ratio-image/src/lib/ratio-image/ratio-image.component.html","../../../projects/ngx-ratio-image/src/lib/ratio-image.module.ts","../../../projects/ngx-ratio-image/src/public-api.ts","../../../projects/ngx-ratio-image/src/ngx-ratio-image.ts"],"sourcesContent":["import { AfterViewInit, Component, Input, OnChanges } from '@angular/core';\n\ninterface Image {\n\tclientWidth: number;\n\tclientHeight: number;\n\tnaturalWidth: number;\n\tnaturalHeight: number;\n}\n\n@Component({\n\tselector: 'ngx-ratio-image',\n\ttemplateUrl: 'ratio-image.component.html',\n\tstyles: []\n})\nexport class RatioImageComponent implements AfterViewInit, OnChanges {\n\t@Input({ required: true }) public src = '';\n\t@Input({ required: true }) public width = 0;\n\t@Input({ required: true }) public height = 0;\n\t@Input() public debug = false;\n\n\tpublic imageWidth = 0;\n\tpublic imageHeight = 0;\n\n\tpublic naturalWidth = 0;\n\tpublic naturalHeight = 0;\n\n\tpublic imageLeft = 0;\n\tpublic imageTop = 0;\n\tpublic ratioImage = 1;\n\tpublic ratioBox = 1;\n\n\tpublic scale = 1;\n\n\tconstructor() {\n\t\tif (this.debug) console.log('constructor', this.src);\n\t}\n\n\tngAfterViewInit() {\n\t\tif (this.debug) console.log('ngAfterViewInit', this.src, this.width, this.height);\n\t}\n\n\tonImageLoad(img: Image) {\n\t\tif (this.debug) console.log('onImageLoad ', img);\n\t\tif (img) {\n\t\t\tthis.naturalWidth = img.naturalWidth;\n\t\t\tthis.naturalHeight = img.naturalHeight;\n\t\t\tif (this.width > 0 && this.height > 0) {\n\t\t\t\tthis.calculate();\n\t\t\t}\n\t\t}\n\t}\n\n\tngOnChanges(): void {\n\t\tthis.calculate();\n\t}\n\n\tprivate calculate() {\n\t\tthis.ratioImage = this.naturalWidth / this.naturalHeight;\n\t\tthis.ratioBox = this.width / this.height;\n\n\t\tif (this.ratioBox > this.ratioImage) {\n\t\t\tthis.scale = this.height / this.naturalHeight;\n\t\t\tthis.imageLeft = (this.width - this.naturalWidth * this.scale) / 2;\n\t\t} else if (this.ratioBox < this.ratioImage) {\n\t\t\tthis.scale = this.width / this.naturalWidth;\n\t\t\tthis.imageTop = (this.height - this.naturalHeight * this.scale) / 2;\n\t\t} else {\n\t\t\tthis.scale = this.width / this.naturalWidth;\n\t\t\tthis.imageLeft = 0;\n\t\t\tthis.imageTop = 0;\n\t\t}\n\n\t\tif (this.debug) console.log('calculate', this.src, this.naturalWidth + ' x ' + this.naturalHeight);\n\t}\n}\n","<div\n\t[style.position]=\"'relative'\"\n\t[style.z-index]=\"2\"\n\t[style.border]=\"debug ? '1px solid red' : ''\"\n\t[style.width]=\"width + 'px'\"\n\t[style.height]=\"height + 'px'\"\n>\n\t<img\n\t\tclass=\"img-background\"\n\t\t#img\n\t\t[src]=\"src\"\n\t\t[style.position]=\"'absolute'\"\n\t\t[style.z-index]=\"1\"\n\t\t[style.filter]=\"'blur(5px)'\"\n\t\t[style.opacity]=\"0.5\"\n\t\t[width]=\"width\"\n\t\t[height]=\"height\"\n\t\t[style.overflow]=\"'hidden'\"\n\t\t(load)=\"onImageLoad(img)\"\n\t\talt=\"\"\n\t/>\n\t<img\n\t\tclass=\"img-main\"\n\t\t[src]=\"src\"\n\t\t[width]=\"naturalWidth * scale\"\n\t\t[height]=\"naturalHeight * scale\"\n\t\t[style.position]=\"'absolute'\"\n\t\t[style.z-index]=\"2\"\n\t\t[style.left]=\"imageLeft + 'px'\"\n\t\t[style.top]=\"imageTop + 'px'\"\n\t\talt=\"\"\n\t/>\n</div>\n<div *ngIf=\"debug\" style=\"margin-top: 10px\">\n\t<div>Container: {{ width }} x {{ height }}</div>\n\t<div>Natural: {{ naturalWidth }} x {{ naturalHeight }}</div>\n\t<div>Pos: {{ imageLeft }} , {{ imageTop }}</div>\n\t<div>Scale: {{ scale | number: '0.0-2' }}</div>\n\t<div>\n\t\tRatio Box , Image: {{ this.ratioBox | number: '0.0-2' }} : 1 , {{ this.ratioImage | number: '0.0-2' }} : 1\n\t</div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { RatioImageComponent } from './ratio-image/ratio-image.component';\nimport { DecimalPipe, NgIf } from '@angular/common';\n\n@NgModule({\n\tdeclarations: [RatioImageComponent],\n\timports: [NgIf, DecimalPipe],\n\texports: [RatioImageComponent]\n})\nexport class RatioImageModule {}\n","/*\n * Public API Surface of ngx-ratio-image\n */\n\nexport * from './lib/ratio-image/ratio-image.component';\nexport * from './lib/ratio-image.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAca,mBAAmB,CAAA;AAmB/B,IAAA,WAAA,GAAA;QAlBkC,IAAG,CAAA,GAAA,GAAG,EAAE,CAAC;QACT,IAAK,CAAA,KAAA,GAAG,CAAC,CAAC;QACV,IAAM,CAAA,MAAA,GAAG,CAAC,CAAC;QAC7B,IAAK,CAAA,KAAA,GAAG,KAAK,CAAC;QAEvB,IAAU,CAAA,UAAA,GAAG,CAAC,CAAC;QACf,IAAW,CAAA,WAAA,GAAG,CAAC,CAAC;QAEhB,IAAY,CAAA,YAAA,GAAG,CAAC,CAAC;QACjB,IAAa,CAAA,aAAA,GAAG,CAAC,CAAC;QAElB,IAAS,CAAA,SAAA,GAAG,CAAC,CAAC;QACd,IAAQ,CAAA,QAAA,GAAG,CAAC,CAAC;QACb,IAAU,CAAA,UAAA,GAAG,CAAC,CAAC;QACf,IAAQ,CAAA,QAAA,GAAG,CAAC,CAAC;QAEb,IAAK,CAAA,KAAA,GAAG,CAAC,CAAC;QAGhB,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;KACrD;IAED,eAAe,G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0EAKO,GAAG,EAAA,CAAA;sBAApC,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;gBACS,KAAK,EAAA,CAAA;sBAAtC,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;gBACS,MAAM,EAAA,CAAA;sBAAvC,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;gBACT,KAAK,EAAA,CAAA;sBAApB,KAAK;;;METM,gBAAgB,CAAA;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,iBAJb,mBAAmB,CAAA,EAAA,OAAA,EAAA,CACxB,IAAI,EAAE,WAAW,aACjB,mBAAmB,CAAA,EAAA,CAAA,CAAA,EAAA;+GAEjB,gBAAgB,EAAA,CAAA,CAAA,EAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC;oBAC5B,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC9B,iBAAA,CAAA;;;ACRD;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="ngx-ratio-image" />
5
+ export * from './public-api';
@@ -0,0 +1,31 @@
1
+ import { AfterViewInit, OnChanges } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ interface Image {
4
+ clientWidth: number;
5
+ clientHeight: number;
6
+ naturalWidth: number;
7
+ naturalHeight: number;
8
+ }
9
+ export declare class RatioImageComponent implements AfterViewInit, OnChanges {
10
+ src: string;
11
+ width: number;
12
+ height: number;
13
+ debug: boolean;
14
+ imageWidth: number;
15
+ imageHeight: number;
16
+ naturalWidth: number;
17
+ naturalHeight: number;
18
+ imageLeft: number;
19
+ imageTop: number;
20
+ ratioImage: number;
21
+ ratioBox: number;
22
+ scale: number;
23
+ constructor();
24
+ ngAfterViewInit(): void;
25
+ onImageLoad(img: Image): void;
26
+ ngOnChanges(): void;
27
+ private calculate;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<RatioImageComponent, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<RatioImageComponent, "ngx-ratio-image", never, { "src": { "alias": "src"; "required": true; }; "width": { "alias": "width"; "required": true; }; "height": { "alias": "height"; "required": true; }; "debug": { "alias": "debug"; "required": false; }; }, {}, never, never, false, never>;
30
+ }
31
+ export {};
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./ratio-image/ratio-image.component";
3
+ import * as i2 from "@angular/common";
4
+ export declare class RatioImageModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<RatioImageModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RatioImageModule, [typeof i1.RatioImageComponent], [typeof i2.NgIf, typeof i2.DecimalPipe], [typeof i1.RatioImageComponent]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<RatioImageModule>;
8
+ }
package/package.json CHANGED
@@ -1,89 +1,38 @@
1
1
  {
2
- "name": "ngx-ratio-image",
3
- "version": "0.0.9",
4
- "author": {
5
- "name": "Gerd Siebert"
6
- },
7
- "contributors": [],
8
- "repository": {
9
- "type": "git",
10
- "url": "https://github.com/gerd-siebert/ngx-ratio-image"
11
- },
12
- "keywords": [
13
- "Image",
14
- "Scaling",
15
- "Ratio",
16
- "Angular 16"
17
- ],
18
- "license": "MIT",
19
- "main": "dist/ngx-ratio-image/esm2022/ratio-image.mjs",
20
- "scripts": {
21
- "ng": "ng",
22
- "prettier": "prettier --write \"**/*.{js,json,css,scss,less,md,ts,html,component.html}\"",
23
- "start": "ng serve",
24
- "prebuild": "rimraf .angular dist && cp ./README.md ./LICENSE projects/ngx-ratio-image",
25
- "build": "echo 'Prepare-Builds' && npm run build:lib && npm run build:lib",
26
- "build:lib": "ng build --project ratioImage --configuration production ",
27
- "build:app": "ng build --project ratioImageApp --configuration production ",
28
- "watch": "ng build --watch --configuration development",
29
- "test": "ng test",
30
- "test:ci": "ng test --code-coverage --no-watch --browsers=ChromeHeadless --source-map=false",
31
- "lint": "ng lint",
32
- "packagr": "ng-packagr -p ng-package.json",
33
- "publish": "rm -rf node_modules && npm install && npm run build && cd dist/ngx-ratio-image && npm publish && cd ../../"
34
- },
35
- "private": false,
36
- "dependencies": {
37
- "@angular/animations": "^16.1.2",
38
- "@angular/cdk": "^16.1.1",
39
- "@angular/common": "^16.1.2",
40
- "@angular/compiler": "^16.1.2",
41
- "@angular/core": "^16.1.2",
42
- "@angular/forms": "^16.1.2",
43
- "@angular/material": "^16.1.1",
44
- "@angular/platform-browser": "^16.1.2",
45
- "@angular/platform-browser-dynamic": "^16.1.2",
46
- "@angular/router": "^16.1.2",
47
- "rxjs": "~7.8.0",
48
- "tslib": "^2.3.0",
49
- "zone.js": "~0.13.0"
50
- },
51
- "devDependencies": {
52
- "@angular-devkit/build-angular": "^16.1.0",
53
- "@angular-eslint/builder": "16.0.3",
54
- "@angular-eslint/eslint-plugin": "16.0.3",
55
- "@angular-eslint/eslint-plugin-template": "16.0.3",
56
- "@angular-eslint/schematics": "16.0.3",
57
- "@angular-eslint/template-parser": "16.0.3",
58
- "@angular/cli": "~16.1.0",
59
- "@angular/compiler-cli": "^16.1.2",
60
- "@schuchard/prettier": "5.1.0",
61
- "@types/jasmine": "~4.3.0",
62
- "@typescript-eslint/eslint-plugin": "5.59.7",
63
- "@typescript-eslint/parser": "5.59.7",
64
- "eslint": "^8.40.0",
65
- "husky": "latest",
66
- "jasmine-core": "~4.6.0",
67
- "karma": "~6.4.0",
68
- "karma-chrome-launcher": "~3.2.0",
69
- "karma-coverage": "~2.2.0",
70
- "karma-jasmine": "~5.1.0",
71
- "karma-jasmine-html-reporter": "~2.1.0",
72
- "lint-staged": "latest",
73
- "ng-packagr": "^16.1.0",
74
- "prettier": "^2.8.8",
75
- "rimraf": "^5.0.1",
76
- "tslint-config-prettier": "latest",
77
- "typescript": "~5.1.3"
78
- },
79
- "husky": {
80
- "hooks": {
81
- "pre-commit": "lint-staged"
82
- }
83
- },
84
- "lint-staged": {
85
- "*.{js,json,css,scss,less,md,ts,html,component.html}": [
86
- "prettier --write"
87
- ]
88
- }
89
- }
2
+ "name": "ngx-ratio-image",
3
+ "version": "0.0.10",
4
+ "author": {
5
+ "name": "Gerd Siebert"
6
+ },
7
+ "description": "Asn Angular lib to show an image with variable ratio in container with a fixed ratio.",
8
+ "license": "MIT",
9
+ "peerDependencies": {
10
+ "@angular/common": "^16.0.0 || ^17.0.0",
11
+ "@angular/core": "^16.0.0 || ^17.0.0"
12
+ },
13
+ "dependencies": {
14
+ "tslib": "^2.3.0"
15
+ },
16
+ "sideEffects": false,
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/gerd-siebert/ngx-ratio-image.git"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/gerd-siebert/ngx-ratio-image/issues"
23
+ },
24
+ "homepage": "https://github.com/gerd-siebert/ngx-ratio-image#readme",
25
+ "module": "fesm2022/ngx-ratio-image.mjs",
26
+ "typings": "index.d.ts",
27
+ "exports": {
28
+ "./package.json": {
29
+ "default": "./package.json"
30
+ },
31
+ ".": {
32
+ "types": "./index.d.ts",
33
+ "esm2022": "./esm2022/ngx-ratio-image.mjs",
34
+ "esm": "./esm2022/ngx-ratio-image.mjs",
35
+ "default": "./fesm2022/ngx-ratio-image.mjs"
36
+ }
37
+ }
38
+ }
@@ -1,6 +1,2 @@
1
- /*
2
- * Public API Surface of ngx-ratio-image
3
- */
4
-
5
1
  export * from './lib/ratio-image/ratio-image.component';
6
2
  export * from './lib/ratio-image.module';
package/.editorconfig DELETED
@@ -1,16 +0,0 @@
1
- # Editor configuration, see https://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- charset = utf-8
6
- indent_style = tab
7
- indent_size = 4
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
10
-
11
- [*.ts]
12
- quote_type = single
13
-
14
- [*.md]
15
- max_line_length = off
16
- trim_trailing_whitespace = false
package/.eslintrc.json DELETED
@@ -1,38 +0,0 @@
1
- {
2
- "root": true,
3
- "ignorePatterns": ["projects/**/*"],
4
- "overrides": [
5
- {
6
- "files": ["*.ts"],
7
- "extends": [
8
- "eslint:recommended",
9
- "plugin:@typescript-eslint/recommended",
10
- "plugin:@angular-eslint/recommended",
11
- "plugin:@angular-eslint/template/process-inline-templates"
12
- ],
13
- "rules": {
14
- "@angular-eslint/directive-selector": [
15
- "error",
16
- {
17
- "type": "attribute",
18
- "prefix": "",
19
- "style": "camelCase"
20
- }
21
- ],
22
- "@angular-eslint/component-selector": [
23
- "error",
24
- {
25
- "type": "element",
26
- "prefix": "",
27
- "style": "kebab-case"
28
- }
29
- ]
30
- }
31
- },
32
- {
33
- "files": ["*.html"],
34
- "extends": ["plugin:@angular-eslint/template/recommended", "plugin:@angular-eslint/template/accessibility"],
35
- "rules": {}
36
- }
37
- ]
38
- }
@@ -1,38 +0,0 @@
1
- # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2
- # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3
-
4
- name: Node.js CI
5
-
6
- on:
7
- workflow_dispatch:
8
- push:
9
- branches: ['main']
10
- pull_request:
11
- branches: ['main']
12
-
13
- env:
14
- CI: true
15
- DISPLAY: ':10.0'
16
- CHROME_BIN: '/usr/bin/chromium'
17
-
18
- jobs:
19
- build:
20
- runs-on: ubuntu-latest
21
- timeout-minutes: 5
22
- strategy:
23
- matrix:
24
- node-version: [16.x, 18.x]
25
- # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
26
-
27
- steps:
28
- - uses: actions/checkout@v3
29
- - name: Use Node.js ${{ matrix.node-version }}
30
- uses: actions/setup-node@v3
31
- with:
32
- node-version: ${{ matrix.node-version }}
33
- cache: 'npm'
34
- - name: Setup Chrome
35
- uses: browser-actions/setup-chrome@v1.2.0
36
- - run: npm ci
37
- - run: npm run build --if-present
38
- - run: npm run test:ci
@@ -1,42 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
- name: Node.js Package
5
-
6
- on:
7
- release:
8
- types: [created]
9
-
10
- env:
11
- CI: true
12
- DISPLAY: ':10.0'
13
- CHROME_BIN: '/usr/bin/chromium'
14
-
15
- jobs:
16
- build:
17
- runs-on: ubuntu-latest
18
- timeout-minutes: 10
19
- steps:
20
- - uses: actions/checkout@v3
21
- - uses: actions/setup-node@v3
22
- with:
23
- node-version: 16
24
- - run: npm ci
25
- - run: npm run build
26
- - name: Setup Chrome
27
- uses: browser-actions/setup-chrome@v1.2.0
28
- - run: npm run test:ci
29
-
30
- publish-npm:
31
- needs: build
32
- runs-on: ubuntu-latest
33
- steps:
34
- - uses: actions/checkout@v3
35
- - uses: actions/setup-node@v3
36
- with:
37
- node-version: 16
38
- registry-url: https://registry.npmjs.org/
39
- - run: npm ci
40
- - run: npm publish
41
- env:
42
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 18
package/.prettierignore DELETED
@@ -1,3 +0,0 @@
1
- .angular
2
- package.json
3
- dist
package/.run/lint.run.xml DELETED
@@ -1,12 +0,0 @@
1
- <component name="ProjectRunConfigurationManager">
2
- <configuration default="false" name="lint" type="js.build_tools.npm" singleton="false" nameIsGenerated="true">
3
- <package-json value="$PROJECT_DIR$/package.json" />
4
- <command value="run" />
5
- <scripts>
6
- <script value="lint" />
7
- </scripts>
8
- <node-interpreter value="project" />
9
- <envs />
10
- <method v="2" />
11
- </configuration>
12
- </component>
package/.run/test.run.xml DELETED
@@ -1,12 +0,0 @@
1
- <component name="ProjectRunConfigurationManager">
2
- <configuration default="false" name="test" type="js.build_tools.npm" singleton="false" nameIsGenerated="true">
3
- <package-json value="$PROJECT_DIR$/package.json" />
4
- <command value="run" />
5
- <scripts>
6
- <script value="test" />
7
- </scripts>
8
- <node-interpreter value="project" />
9
- <envs />
10
- <method v="2" />
11
- </configuration>
12
- </component>
@@ -1,4 +0,0 @@
1
- {
2
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3
- "recommendations": ["angular.ng-template"]
4
- }