ngblock 0.0.2 → 0.0.3
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/README.md +61 -46
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,46 +1,61 @@
|
|
|
1
|
-
# ngblock
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
# ngblock
|
|
2
|
+
|
|
3
|
+
`ngblock` is an Angular UI library. The current release includes a standalone
|
|
4
|
+
button control.
|
|
5
|
+
|
|
6
|
+
## Requirements
|
|
7
|
+
|
|
8
|
+
- Angular `^22.2.0`
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install ngblock
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Button control
|
|
17
|
+
|
|
18
|
+
Import `ButtonComponent` into the standalone component that uses it:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { Component } from '@angular/core';
|
|
22
|
+
import { ButtonComponent } from 'ngblock';
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-example',
|
|
26
|
+
imports: [ButtonComponent],
|
|
27
|
+
template: `
|
|
28
|
+
<ngb-button (click)="save()">Save</ngb-button>
|
|
29
|
+
<ngb-button type="submit" [disabled]="isSaving">Submit</ngb-button>
|
|
30
|
+
`,
|
|
31
|
+
})
|
|
32
|
+
export class ExampleComponent {
|
|
33
|
+
isSaving = false;
|
|
34
|
+
|
|
35
|
+
save(): void {
|
|
36
|
+
// Perform the save action.
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`ButtonComponent` renders a native `<button>` and projects its content as the
|
|
42
|
+
button label. Its selector is `ngb-button`.
|
|
43
|
+
|
|
44
|
+
| Input | Type | Default | Description |
|
|
45
|
+
| --- | --- | --- | --- |
|
|
46
|
+
| `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | Native button type. |
|
|
47
|
+
| `disabled` | `boolean` | `false` | Disables the native button. |
|
|
48
|
+
|
|
49
|
+
The control inherits its font and text color from its context, with basic
|
|
50
|
+
padding, border, focus-visible, and disabled styles. Use the native `click`
|
|
51
|
+
event to handle activation.
|
|
52
|
+
|
|
53
|
+
## Develop
|
|
54
|
+
|
|
55
|
+
From the Nx workspace root:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx nx build ngblock
|
|
59
|
+
npx nx test ngblock
|
|
60
|
+
npx nx lint ngblock
|
|
61
|
+
```
|