Skip to content

Commit cf0f400

Browse files
committedAug 29, 2024
Small bugfix
1 parent 1893125 commit cf0f400

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@omnedia/ngx-gridpattern",
33
"description": "A simple component library to create a container with a pattern background.",
4-
"version": "1.1.1",
4+
"version": "1.1.2",
55
"peerDependencies": {
66
"@angular/common": "^18.2.0",
77
"@angular/core": "^18.2.0"

‎src/lib/ngx-gridpattern.component.ts

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1-
import { CommonModule } from '@angular/common';
2-
import { Component, ElementRef, Input, ViewChild } from '@angular/core';
1+
import { CommonModule } from "@angular/common";
2+
import { Component, ElementRef, Input, ViewChild } from "@angular/core";
33

44
@Component({
5-
selector: 'om-gridpattern',
5+
selector: "om-gridpattern",
66
standalone: true,
77
imports: [CommonModule],
88
templateUrl: "./ngx-gridpattern.component.html",
99
styleUrl: "./ngx-gridpattern.component.scss",
1010
})
1111
export class NgxGridpatternComponent {
12-
@ViewChild('OmGridPatternBackground')
12+
@ViewChild("OmGridPatternBackground")
1313
elementRef!: ElementRef<HTMLElement>;
1414

1515
@Input("styleClass")
1616
styleClass?: string;
1717

1818
@Input("smallGrid")
19+
set smallGridValue(smallGrid: boolean) {
20+
this.smallGrid = smallGrid;
21+
this.setGridStyle();
22+
}
23+
1924
smallGrid = false;
2025

2126
@Input("gridColor")
@@ -24,20 +29,20 @@ export class NgxGridpatternComponent {
2429
this.setGridStyle();
2530
}
2631

27-
gridColor: string = 'rgba(255, 255, 255, 0.2)';
32+
gridColor: string = "rgba(255, 255, 255, 0.2)";
2833

2934
@Input("gradientColor")
3035
set gradientColorValue(color: string) {
3136
this.gradientColor = color;
3237
this.setGridStyle();
3338
}
3439

35-
gradientColor: string = 'rgb(0, 0, 0)';
40+
gradientColor: string = "rgb(0, 0, 0)";
3641

3742
gridStyle: any = {};
3843

3944
setGridStyle(): void {
40-
let dataUri = '';
45+
let dataUri = "";
4146

4247
if (this.smallGrid) {
4348
dataUri = `data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='16' height='16' fill='none' stroke='${this.gridColor}' %3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e`;

0 commit comments

Comments
 (0)
Please sign in to comment.