Skip to content

Commit dae73df

Browse files
committed
Make components standalone
1 parent e8a86fb commit dae73df

File tree

25 files changed

+207
-213
lines changed

25 files changed

+207
-213
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 7.0.0 (June 6, 2024)
4+
- Angular updated (v19.2.10)
5+
6+
### Breaking Changes
7+
- The `AngularColorfulModule` was removed, use standalone components
8+
39
## 6.0.0 (June 6, 2024)
410
- Angular updated (v18.0.2)
511

angular.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,7 @@
88
"schematics": {
99
"@schematics/angular:component": {
1010
"style": "scss",
11-
"standalone": true,
1211
"changeDetection": "OnPush"
13-
},
14-
"@schematics/angular:directive": {
15-
"standalone": true
16-
},
17-
"@schematics/angular:pipe": {
18-
"standalone": true
1912
}
2013
},
2114
"root": "projects/app",

projects/angular-colorful/src/lib/angular-colorful.module.ts

Lines changed: 0 additions & 69 deletions
This file was deleted.

projects/angular-colorful/src/lib/components/common/alpha-color-picker/alpha-color-picker.component.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import {ChangeDetectionStrategy, Component, EventEmitter, Input, Output} from '@angular/core';
2+
import {CommonModule} from "@angular/common";
23
import {defaultHsvaColor} from '../../../utils/constants';
34
import {HsvaColor} from '../../../interfaces/hsva-color.interface';
5+
import {SaturationComponent} from "../saturation/saturation.component";
6+
import {HueComponent} from "../hue/hue.component";
7+
import {AlphaComponent} from "../alpha/alpha.component";
48

59

6-
@Component({
7-
selector: 'alpha-color-picker',
8-
templateUrl: './alpha-color-picker.component.html',
9-
styleUrls: ['./alpha-color-picker.component.scss'],
10-
changeDetection: ChangeDetectionStrategy.OnPush,
11-
standalone: false
10+
@Component({
11+
selector: 'alpha-color-picker',
12+
templateUrl: './alpha-color-picker.component.html',
13+
styleUrls: ['./alpha-color-picker.component.scss'],
14+
changeDetection: ChangeDetectionStrategy.OnPush,
15+
imports: [CommonModule, SaturationComponent, HueComponent, AlphaComponent],
1216
})
1317
export class AlphaColorPickerComponent {
1418
@Input() color: HsvaColor = defaultHsvaColor;

projects/angular-colorful/src/lib/components/common/alpha/alpha.component.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, DoCheck, EventEmitter, Input, Output} from '@angular/core';
2+
import {CommonModule} from "@angular/common";
23
import {hsvaToHslaString} from '../../../utils/convert';
34
import {defaultHsvaColor} from '../../../utils/constants';
45
import {HsvaColor} from '../../../interfaces/hsva-color.interface';
56
import {Interaction} from '../../../interfaces/interaction.interface';
7+
import {InteractiveComponent} from "../interactive/interactive.component";
68

79

8-
@Component({
9-
selector: 'alpha',
10-
templateUrl: './alpha.component.html',
11-
styleUrls: ['./alpha.component.scss'],
12-
changeDetection: ChangeDetectionStrategy.OnPush,
13-
standalone: false
10+
@Component({
11+
selector: 'alpha',
12+
templateUrl: './alpha.component.html',
13+
styleUrls: ['./alpha.component.scss'],
14+
changeDetection: ChangeDetectionStrategy.OnPush,
15+
imports: [CommonModule, InteractiveComponent],
1416
})
1517
export class AlphaComponent implements DoCheck {
1618
@Input() color: HsvaColor = defaultHsvaColor;

projects/angular-colorful/src/lib/components/common/color-picker/color-picker.component.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import {ChangeDetectionStrategy, Component, EventEmitter, Input, Output} from '@angular/core';
2+
import {CommonModule} from "@angular/common";
23
import {HsvaColor} from '../../../interfaces/hsva-color.interface';
34
import {defaultHsvaColor} from '../../../utils/constants';
5+
import {SaturationComponent} from "../saturation/saturation.component";
6+
import {HueComponent} from "../hue/hue.component";
47

58

6-
@Component({
7-
selector: 'color-picker',
8-
templateUrl: './color-picker.component.html',
9-
styleUrls: ['./color-picker.component.scss'],
10-
changeDetection: ChangeDetectionStrategy.OnPush,
11-
standalone: false
9+
@Component({
10+
selector: 'color-picker',
11+
templateUrl: './color-picker.component.html',
12+
styleUrls: ['./color-picker.component.scss'],
13+
changeDetection: ChangeDetectionStrategy.OnPush,
14+
imports: [CommonModule, SaturationComponent, HueComponent],
1215
})
1316
export class ColorPickerComponent {
1417

projects/angular-colorful/src/lib/components/common/hue/hue.component.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, DoCheck, EventEmitter, Input, Output} from '@angular/core';
2+
import {CommonModule} from "@angular/common";
23
import {hsvaToHslString} from '../../../utils/convert';
34
import {defaultHsvaColor} from '../../../utils/constants';
45
import {HsvaColor} from '../../../interfaces/hsva-color.interface';
56
import {Interaction} from '../../../interfaces/interaction.interface';
7+
import {InteractiveComponent} from "../interactive/interactive.component";
68

79

8-
@Component({
9-
selector: 'hue',
10-
templateUrl: './hue.component.html',
11-
styleUrls: ['./hue.component.scss'],
12-
changeDetection: ChangeDetectionStrategy.OnPush,
13-
standalone: false
10+
@Component({
11+
selector: 'hue',
12+
templateUrl: './hue.component.html',
13+
styleUrls: ['./hue.component.scss'],
14+
changeDetection: ChangeDetectionStrategy.OnPush,
15+
imports: [CommonModule, InteractiveComponent],
1416
})
1517
export class HueComponent implements DoCheck {
1618
@Input() color: HsvaColor = defaultHsvaColor;

projects/angular-colorful/src/lib/components/common/interactive/interactive.component.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
// Angular
22
import {Component, Input, HostListener, OnInit, Output, EventEmitter, ElementRef} from '@angular/core';
3+
import {CommonModule} from "@angular/common";
34

45
// Project
56
import {clamp} from '../../../utils/clamp';
67
import {Interaction} from '../../../interfaces/interaction.interface';
78

89

9-
@Component({
10-
selector: 'interactive',
11-
templateUrl: './interactive.component.html',
12-
styleUrls: ['./interactive.component.scss'],
13-
standalone: false
10+
@Component({
11+
selector: 'interactive',
12+
templateUrl: './interactive.component.html',
13+
styleUrls: ['./interactive.component.scss'],
14+
imports: [CommonModule],
1415
})
1516
export class InteractiveComponent implements OnInit {
1617

projects/angular-colorful/src/lib/components/common/saturation/saturation.component.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, DoCheck, EventEmitter, Input, Output} from '@angular/core';
2+
import {CommonModule} from "@angular/common";
23
import {hsvaToHslString} from '../../../utils/convert';
34
import {defaultHsvaColor} from '../../../utils/constants';
45
import {HsvaColor} from '../../../interfaces/hsva-color.interface';
56
import {Interaction} from '../../../interfaces/interaction.interface';
7+
import {InteractiveComponent} from "../interactive/interactive.component";
68

79

8-
@Component({
9-
selector: 'saturation',
10-
templateUrl: './saturation.component.html',
11-
styleUrls: ['./saturation.component.scss'],
12-
changeDetection: ChangeDetectionStrategy.OnPush,
13-
standalone: false
10+
@Component({
11+
selector: 'saturation',
12+
templateUrl: './saturation.component.html',
13+
styleUrls: ['./saturation.component.scss'],
14+
changeDetection: ChangeDetectionStrategy.OnPush,
15+
imports: [CommonModule, InteractiveComponent],
1416
})
1517
export class SaturationComponent implements DoCheck {
1618
@Input() color: HsvaColor = defaultHsvaColor;

projects/angular-colorful/src/lib/components/hex-color-picker/hex-color-picker.component.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output} from '@angular/core';
2+
import {CommonModule} from "@angular/common";
23
import {ColorModel} from '../../interfaces/color-model.interface';
34
import {HsvaColor} from '../../interfaces/hsva-color.interface';
45
import {hexToHsva, hsvaToHex} from '../../utils/convert';
56
import {defaultHexStringColor, defaultHsvaColor} from '../../utils/constants';
7+
import {ColorPickerComponent} from "../common/color-picker/color-picker.component";
68

79

8-
@Component({
9-
selector: 'hex-color-picker',
10-
templateUrl: './hex-color-picker.component.html',
11-
styleUrls: ['./hex-color-picker.component.scss'],
12-
changeDetection: ChangeDetectionStrategy.OnPush,
13-
standalone: false
10+
@Component({
11+
selector: 'hex-color-picker',
12+
templateUrl: './hex-color-picker.component.html',
13+
styleUrls: ['./hex-color-picker.component.scss'],
14+
changeDetection: ChangeDetectionStrategy.OnPush,
15+
imports: [CommonModule, ColorPickerComponent],
1416
})
1517
export class HexColorPickerComponent implements OnChanges, ColorModel<string> {
1618
@Input() color: string = defaultHexStringColor;

0 commit comments

Comments
 (0)