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 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 (click)="save()">Save</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 save action.
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 native `type` and `disabled` inputs and intentionally uses the
44
- browser's default styling.
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.
@@ -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 [type]=\"type()\" [disabled]=\"disabled()\">\r\n <ng-content />\r\n</button>\r\n",
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 [type]=\"type()\" [disabled]=\"disabled()\">\r\n <ng-content />\r\n</button>\r\n"
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
  });
@@ -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 { ChangeDetectionStrategy, Component, input } 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}\r\n","<button [type]=\"type()\" [disabled]=\"disabled()\">\r\n <ng-content />\r\n</button>\r\n"],"mappings":";;AAQA,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;CAFrB,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,UAAA;EAAA,UCRhC;EAGA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;ADKa,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"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngblock",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "An Angular library for ngblock.",
5
5
  "license": "MIT",
6
6
  "peerDependencies": {
@@ -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
- }, {}, never, ["*"], true, never>;
19
+ }, {
20
+ "buttonClick": "buttonClick";
21
+ }, never, ["*"], true, never>;
18
22
  }