ngblock 0.0.2 → 0.0.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/README.md +44 -46
- package/fesm2022/ngblock.mjs +9 -11
- package/fesm2022/ngblock.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngblock.d.ts +3 -3
package/README.md
CHANGED
|
@@ -1,46 +1,44 @@
|
|
|
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
|
-
npx nx test ngblock
|
|
46
|
-
```
|
|
1
|
+
# ngblock
|
|
2
|
+
|
|
3
|
+
## Components
|
|
4
|
+
|
|
5
|
+
| Group | Component | Type | Selector |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| Control / Button | Button text | `control` | `ngb-button-text-control` |
|
|
8
|
+
|
|
9
|
+
The component is in `src/lib/control/button/button-text/`. Component files use
|
|
10
|
+
the `<component-name>.<type>.<extension>` naming convention, for example
|
|
11
|
+
`button-text.control.ts` and `button-text.control.html`.
|
|
12
|
+
|
|
13
|
+
## Use
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install ngblock
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Import `ButtonTextComponent` into the standalone component that uses it:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { Component } from '@angular/core';
|
|
23
|
+
import { ButtonTextComponent } from 'ngblock';
|
|
24
|
+
|
|
25
|
+
@Component({
|
|
26
|
+
selector: 'app-example',
|
|
27
|
+
imports: [ButtonTextComponent],
|
|
28
|
+
template: `
|
|
29
|
+
<ngb-button-text-control (click)="save()">Save</ngb-button-text-control>
|
|
30
|
+
<ngb-button-text-control type="submit" [disabled]="isSaving">Submit</ngb-button-text-control>
|
|
31
|
+
`,
|
|
32
|
+
})
|
|
33
|
+
export class ExampleComponent {
|
|
34
|
+
isSaving = false;
|
|
35
|
+
|
|
36
|
+
save(): void {
|
|
37
|
+
// Perform the save action.
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
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.
|
package/fesm2022/ngblock.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
3
|
-
var
|
|
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
6
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
7
7
|
minVersion: "12.0.0",
|
|
8
8
|
version: "22.2.4",
|
|
9
9
|
ngImport: i0,
|
|
10
|
-
type:
|
|
10
|
+
type: ButtonTextComponent,
|
|
11
11
|
deps: [],
|
|
12
12
|
target: i0.ɵɵFactoryTarget.Component
|
|
13
13
|
});
|
|
14
14
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
15
15
|
minVersion: "17.1.0",
|
|
16
16
|
version: "22.2.4",
|
|
17
|
-
type:
|
|
17
|
+
type: ButtonTextComponent,
|
|
18
18
|
isStandalone: true,
|
|
19
|
-
selector: "ngb-button",
|
|
19
|
+
selector: "ngb-button-text-control",
|
|
20
20
|
inputs: {
|
|
21
21
|
type: {
|
|
22
22
|
classPropertyName: "type",
|
|
@@ -34,8 +34,7 @@ var ButtonComponent = class ButtonComponent {
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
ngImport: i0,
|
|
37
|
-
template: "<button
|
|
38
|
-
styles: [":host{display:inline-block}.ngblock-button{padding:.5rem .875rem;border:1px solid currentColor;border-radius:.25rem;background:transparent;color:inherit;cursor:pointer;font:inherit}.ngblock-button:focus-visible{outline:2px solid currentColor;outline-offset:2px}.ngblock-button:disabled{cursor:not-allowed;opacity:.6}\n"],
|
|
37
|
+
template: "<button [type]=\"type()\" [disabled]=\"disabled()\">\r\n <ng-content />\r\n</button>\r\n",
|
|
39
38
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
40
39
|
});
|
|
41
40
|
};
|
|
@@ -43,15 +42,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
43
42
|
minVersion: "12.0.0",
|
|
44
43
|
version: "22.2.4",
|
|
45
44
|
ngImport: i0,
|
|
46
|
-
type:
|
|
45
|
+
type: ButtonTextComponent,
|
|
47
46
|
decorators: [{
|
|
48
47
|
type: Component,
|
|
49
48
|
args: [{
|
|
50
|
-
selector: "ngb-button",
|
|
49
|
+
selector: "ngb-button-text-control",
|
|
51
50
|
imports: [],
|
|
52
51
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
53
|
-
template: "<button
|
|
54
|
-
styles: [":host{display:inline-block}.ngblock-button{padding:.5rem .875rem;border:1px solid currentColor;border-radius:.25rem;background:transparent;color:inherit;cursor:pointer;font:inherit}.ngblock-button:focus-visible{outline:2px solid currentColor;outline-offset:2px}.ngblock-button:disabled{cursor:not-allowed;opacity:.6}\n"]
|
|
52
|
+
template: "<button [type]=\"type()\" [disabled]=\"disabled()\">\r\n <ng-content />\r\n</button>\r\n"
|
|
55
53
|
}]
|
|
56
54
|
}],
|
|
57
55
|
propDecorators: {
|
|
@@ -73,6 +71,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
73
71
|
}]
|
|
74
72
|
}
|
|
75
73
|
});
|
|
76
|
-
export {
|
|
74
|
+
export { ButtonTextComponent };
|
|
77
75
|
|
|
78
76
|
//# sourceMappingURL=ngblock.mjs.map
|
package/fesm2022/ngblock.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngblock.mjs","names":[],"sources":["../../../../packages/ngblock/src/lib/control/button.ts","../../../../packages/ngblock/src/lib/control/button.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n selector: 'ngb-button',\n imports: [],\n templateUrl: './button.html',\n
|
|
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"}
|
package/package.json
CHANGED
package/types/ngblock.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class
|
|
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
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
6
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonTextComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonTextComponent, "ngb-button-text-control", never, {
|
|
7
7
|
"type": {
|
|
8
8
|
"alias": "type";
|
|
9
9
|
"required": false;
|