ngblock 0.0.4 → 0.0.5
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 +13 -5
- package/fesm2022/ngblock.mjs +12 -3
- package/fesm2022/ngblock.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngblock.d.ts +5 -1
package/README.md
CHANGED
|
@@ -26,19 +26,27 @@ import { ButtonTextComponent } from 'ngblock';
|
|
|
26
26
|
selector: 'app-example',
|
|
27
27
|
imports: [ButtonTextComponent],
|
|
28
28
|
template: `
|
|
29
|
-
<ngb-button-text-control (
|
|
29
|
+
<ngb-button-text-control (buttonClick)="save($event)">Save</ngb-button-text-control>
|
|
30
30
|
<ngb-button-text-control type="submit" [disabled]="isSaving">Submit</ngb-button-text-control>
|
|
31
31
|
`,
|
|
32
32
|
})
|
|
33
33
|
export class ExampleComponent {
|
|
34
34
|
isSaving = false;
|
|
35
35
|
|
|
36
|
-
save(): void {
|
|
37
|
-
// Perform the
|
|
36
|
+
save(event: MouseEvent): void {
|
|
37
|
+
// Perform an operation using the click event.
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
`ButtonTextComponent` wraps a native button and projects its text content. It
|
|
43
|
-
supports
|
|
44
|
-
|
|
43
|
+
supports these inputs and output:
|
|
44
|
+
|
|
45
|
+
| Name | Kind | Type | Default |
|
|
46
|
+
| --- | --- | --- | --- |
|
|
47
|
+
| `type` | Input | `'button' \| 'submit' \| 'reset'` | `'button'` |
|
|
48
|
+
| `disabled` | Input | `boolean` | `false` |
|
|
49
|
+
| `buttonClick` | Output | `MouseEvent` | — |
|
|
50
|
+
|
|
51
|
+
`buttonClick` emits the native click event. The component intentionally uses
|
|
52
|
+
the browser's default button styling.
|
package/fesm2022/ngblock.mjs
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, input, output } from "@angular/core";
|
|
3
3
|
var ButtonTextComponent = class ButtonTextComponent {
|
|
4
4
|
type = input("button", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
5
5
|
disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
6
|
+
buttonClick = output();
|
|
7
|
+
onClick(event) {
|
|
8
|
+
this.buttonClick.emit(event);
|
|
9
|
+
}
|
|
6
10
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
7
11
|
minVersion: "12.0.0",
|
|
8
12
|
version: "22.2.4",
|
|
@@ -33,8 +37,9 @@ var ButtonTextComponent = class ButtonTextComponent {
|
|
|
33
37
|
transformFunction: null
|
|
34
38
|
}
|
|
35
39
|
},
|
|
40
|
+
outputs: { buttonClick: "buttonClick" },
|
|
36
41
|
ngImport: i0,
|
|
37
|
-
template: "<button
|
|
42
|
+
template: "<button\r\n [type]=\"type()\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"onClick($event)\"\r\n>\r\n <ng-content />\r\n</button>\r\n",
|
|
38
43
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
39
44
|
});
|
|
40
45
|
};
|
|
@@ -49,7 +54,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
49
54
|
selector: "ngb-button-text-control",
|
|
50
55
|
imports: [],
|
|
51
56
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
52
|
-
template: "<button
|
|
57
|
+
template: "<button\r\n [type]=\"type()\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"onClick($event)\"\r\n>\r\n <ng-content />\r\n</button>\r\n"
|
|
53
58
|
}]
|
|
54
59
|
}],
|
|
55
60
|
propDecorators: {
|
|
@@ -68,6 +73,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
68
73
|
alias: "disabled",
|
|
69
74
|
required: false
|
|
70
75
|
}]
|
|
76
|
+
}],
|
|
77
|
+
buttonClick: [{
|
|
78
|
+
type: i0.Output,
|
|
79
|
+
args: ["buttonClick"]
|
|
71
80
|
}]
|
|
72
81
|
}
|
|
73
82
|
});
|
package/fesm2022/ngblock.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngblock.mjs","names":[],"sources":["../../../../packages/ngblock/src/lib/control/button/button-text/button-text.control.ts","../../../../packages/ngblock/src/lib/control/button/button-text/button-text.control.html"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ngblock.mjs","names":[],"sources":["../../../../packages/ngblock/src/lib/control/button/button-text/button-text.control.ts","../../../../packages/ngblock/src/lib/control/button/button-text/button-text.control.html"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n input,\r\n output,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'ngb-button-text-control',\r\n imports: [],\r\n templateUrl: './button-text.control.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class ButtonTextComponent {\r\n readonly type = input<HTMLButtonElement['type']>('button');\r\n readonly disabled = input(false);\r\n readonly buttonClick = output<MouseEvent>();\r\n\r\n onClick(event: MouseEvent): void {\r\n this.buttonClick.emit(event);\r\n }\r\n}\r\n","<button\r\n [type]=\"type()\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"onClick($event)\"\r\n>\r\n <ng-content />\r\n</button>\r\n"],"mappings":";;AAaA,IAAa,sBAAb,MAAa,oBAAmB;CACrB,OAAO,MAAiC,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACjD,WAAW,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,cAAc,OAAM;CAE7B,QAAQ,OAAiB;EACvB,KAAK,YAAY,KAAK,KAAK;CAC7B;CAPW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAmB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAnB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAmB,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA,EAAA,aAAA,cAAA;EAAA,UAAA;EAAA,UCbhC;EAOA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;ADMa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAN/B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAyB,SAC1B,CAAA;GAAE,iBAEM,wBAAwB;GAAM,UAAA;EAAA,CAAA"}
|
package/package.json
CHANGED
package/types/ngblock.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
export declare class ButtonTextComponent {
|
|
3
3
|
readonly type: import("@angular/core").InputSignal<"submit" | "reset" | "button">;
|
|
4
4
|
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
5
|
+
readonly buttonClick: import("@angular/core").OutputEmitterRef<MouseEvent>;
|
|
6
|
+
onClick(event: MouseEvent): void;
|
|
5
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonTextComponent, never>;
|
|
6
8
|
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonTextComponent, "ngb-button-text-control", never, {
|
|
7
9
|
"type": {
|
|
@@ -14,5 +16,7 @@ export declare class ButtonTextComponent {
|
|
|
14
16
|
"required": false;
|
|
15
17
|
"isSignal": true;
|
|
16
18
|
};
|
|
17
|
-
}, {
|
|
19
|
+
}, {
|
|
20
|
+
"buttonClick": "buttonClick";
|
|
21
|
+
}, never, ["*"], true, never>;
|
|
18
22
|
}
|