@compsych-ui-components/angular 3.2.4
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.
- package/.gitkeep +0 -0
- package/ng-package.json +7 -0
- package/package.json +14 -0
- package/project.json +18 -0
- package/src/index.ts +10 -0
- package/src/lib/button.component.ts +34 -0
- package/tsconfig.json +9 -0
- package/tsconfig.lib.json +11 -0
package/.gitkeep
ADDED
|
File without changes
|
package/ng-package.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@compsych-ui-components/angular",
|
|
3
|
+
"version": "3.2.4",
|
|
4
|
+
"description": "Angular UI components for compsych",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public",
|
|
7
|
+
"registry": "https://registry.npmjs.org/"
|
|
8
|
+
},
|
|
9
|
+
"peerDependencies": {
|
|
10
|
+
"@angular/common": ">=17.0.0",
|
|
11
|
+
"@angular/core": ">=17.0.0",
|
|
12
|
+
"@compsych-ui-components/shared": "*"
|
|
13
|
+
}
|
|
14
|
+
}
|
package/project.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "angular",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "packages/angular/src",
|
|
5
|
+
"projectType": "library",
|
|
6
|
+
"targets": {
|
|
7
|
+
"build": {
|
|
8
|
+
"executor": "@nx/angular:ng-packagr-lite",
|
|
9
|
+
"outputs": ["{workspaceRoot}/dist/packages/angular"],
|
|
10
|
+
"options": {
|
|
11
|
+
"project": "packages/angular/ng-package.json",
|
|
12
|
+
"tsConfig": "packages/angular/tsconfig.lib.json"
|
|
13
|
+
},
|
|
14
|
+
"dependsOn": ["^build"]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"implicitDependencies": ["shared"]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { ButtonComponent } from './lib/button.component';
|
|
3
|
+
|
|
4
|
+
export { ButtonComponent } from './lib/button.component';
|
|
5
|
+
|
|
6
|
+
@NgModule({
|
|
7
|
+
imports: [ButtonComponent],
|
|
8
|
+
exports: [ButtonComponent],
|
|
9
|
+
})
|
|
10
|
+
export class CompsychAngularModule {}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { showAlert } from '@compsych-ui-components/shared';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'compsych-button',
|
|
6
|
+
standalone: true,
|
|
7
|
+
template: `
|
|
8
|
+
<button class="compsych-button" (click)="handleClick()">
|
|
9
|
+
{{ label }}
|
|
10
|
+
</button>
|
|
11
|
+
`,
|
|
12
|
+
styles: [`
|
|
13
|
+
.compsych-button {
|
|
14
|
+
padding: 8px 16px;
|
|
15
|
+
background-color: #1976d2;
|
|
16
|
+
color: white;
|
|
17
|
+
border: none;
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
font-size: 14px;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
}
|
|
22
|
+
.compsych-button:hover {
|
|
23
|
+
background-color: #1565c0;
|
|
24
|
+
}
|
|
25
|
+
`],
|
|
26
|
+
})
|
|
27
|
+
export class ButtonComponent {
|
|
28
|
+
@Input() label = 'Click me';
|
|
29
|
+
@Input() alertMessage = 'Hello from @compsych-ui-components/angular!';
|
|
30
|
+
|
|
31
|
+
handleClick(): void {
|
|
32
|
+
showAlert(this.alertMessage);
|
|
33
|
+
}
|
|
34
|
+
}
|
package/tsconfig.json
ADDED