@lamenna/lxp-angular 0.0.5 → 0.0.7
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/dist/fesm2022/lamenna-lxp-angular.mjs +97 -0
- package/dist/fesm2022/lamenna-lxp-angular.mjs.map +1 -0
- package/dist/{components/button/button.component.d.ts → types/lamenna-lxp-angular.d.ts} +9 -4
- package/package.json +22 -7
- package/dist/__tests__/button-options.test.d.ts +0 -10
- package/dist/__tests__/button-options.test.d.ts.map +0 -1
- package/dist/__tests__/button-options.test.js +0 -25
- package/dist/__tests__/button-options.test.js.map +0 -1
- package/dist/components/button/button.component.d.ts.map +0 -1
- package/dist/components/button/button.component.js +0 -85
- package/dist/components/button/button.component.js.map +0 -1
- package/dist/components/button/index.d.ts +0 -2
- package/dist/components/button/index.d.ts.map +0 -1
- package/dist/components/button/index.js +0 -2
- package/dist/components/button/index.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as i1 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { EventEmitter, HostBinding, Output, Input, Component } from '@angular/core';
|
|
5
|
+
import { buttonConfig } from '@lamenna/lxp-shared-components';
|
|
6
|
+
|
|
7
|
+
class ButtonComponent {
|
|
8
|
+
content;
|
|
9
|
+
variant = "primary";
|
|
10
|
+
size = "md";
|
|
11
|
+
disabled = false;
|
|
12
|
+
className;
|
|
13
|
+
id;
|
|
14
|
+
ariaLabel;
|
|
15
|
+
testID;
|
|
16
|
+
label;
|
|
17
|
+
onClick = new EventEmitter();
|
|
18
|
+
get hostStyles() {
|
|
19
|
+
const variantConfig = buttonConfig.variants[this.variant];
|
|
20
|
+
const sizeConfig = buttonConfig.sizes[this.size];
|
|
21
|
+
return {
|
|
22
|
+
...buttonConfig.common,
|
|
23
|
+
...variantConfig,
|
|
24
|
+
...sizeConfig,
|
|
25
|
+
opacity: this.disabled ? "0.6" : "1",
|
|
26
|
+
pointerEvents: this.disabled ? "none" : "auto",
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
get buttonClasses() {
|
|
30
|
+
return {
|
|
31
|
+
[this.className || ""]: !!this.className,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
35
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: ButtonComponent, isStandalone: true, selector: "lxp-button", inputs: { content: "content", variant: "variant", size: "size", disabled: "disabled", className: "className", id: "id", ariaLabel: "ariaLabel", testID: "testID", label: "label" }, outputs: { onClick: "onClick" }, host: { properties: { "style": "this.hostStyles" } }, ngImport: i0, template: `
|
|
36
|
+
<button
|
|
37
|
+
[attr.id]="id"
|
|
38
|
+
[attr.data-testid]="testID"
|
|
39
|
+
[attr.aria-label]="ariaLabel"
|
|
40
|
+
[disabled]="disabled"
|
|
41
|
+
(click)="onClick.emit($event)"
|
|
42
|
+
[ngClass]="buttonClasses"
|
|
43
|
+
>
|
|
44
|
+
{{ content }}
|
|
45
|
+
</button>
|
|
46
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
47
|
+
}
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
49
|
+
type: Component,
|
|
50
|
+
args: [{
|
|
51
|
+
selector: "lxp-button",
|
|
52
|
+
template: `
|
|
53
|
+
<button
|
|
54
|
+
[attr.id]="id"
|
|
55
|
+
[attr.data-testid]="testID"
|
|
56
|
+
[attr.aria-label]="ariaLabel"
|
|
57
|
+
[disabled]="disabled"
|
|
58
|
+
(click)="onClick.emit($event)"
|
|
59
|
+
[ngClass]="buttonClasses"
|
|
60
|
+
>
|
|
61
|
+
{{ content }}
|
|
62
|
+
</button>
|
|
63
|
+
`,
|
|
64
|
+
standalone: true,
|
|
65
|
+
imports: [CommonModule],
|
|
66
|
+
}]
|
|
67
|
+
}], propDecorators: { content: [{
|
|
68
|
+
type: Input
|
|
69
|
+
}], variant: [{
|
|
70
|
+
type: Input
|
|
71
|
+
}], size: [{
|
|
72
|
+
type: Input
|
|
73
|
+
}], disabled: [{
|
|
74
|
+
type: Input
|
|
75
|
+
}], className: [{
|
|
76
|
+
type: Input
|
|
77
|
+
}], id: [{
|
|
78
|
+
type: Input
|
|
79
|
+
}], ariaLabel: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}], testID: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], label: [{
|
|
84
|
+
type: Input
|
|
85
|
+
}], onClick: [{
|
|
86
|
+
type: Output
|
|
87
|
+
}], hostStyles: [{
|
|
88
|
+
type: HostBinding,
|
|
89
|
+
args: ["style"]
|
|
90
|
+
}] } });
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Generated bundle index. Do not edit.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
export { ButtonComponent };
|
|
97
|
+
//# sourceMappingURL=lamenna-lxp-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lamenna-lxp-angular.mjs","sources":["../../src/components/button/button.component.ts","../../src/lamenna-lxp-angular.ts"],"sourcesContent":["import { CommonModule } from \"@angular/common\";\nimport {\n Component,\n Input,\n Output,\n EventEmitter,\n HostBinding,\n} from \"@angular/core\";\nimport {\n AngularButtonProps,\n ButtonVariant,\n ButtonSize,\n buttonConfig,\n} from \"@lamenna/lxp-shared-components\";\n\n@Component({\n selector: \"lxp-button\",\n template: `\n <button\n [attr.id]=\"id\"\n [attr.data-testid]=\"testID\"\n [attr.aria-label]=\"ariaLabel\"\n [disabled]=\"disabled\"\n (click)=\"onClick.emit($event)\"\n [ngClass]=\"buttonClasses\"\n >\n {{ content }}\n </button>\n `,\n standalone: true,\n imports: [CommonModule],\n})\nexport class ButtonComponent implements AngularButtonProps {\n @Input() content?: string;\n @Input() variant: ButtonVariant = \"primary\";\n @Input() size: ButtonSize = \"md\";\n @Input() disabled: boolean = false;\n @Input() className?: string;\n @Input() id?: string;\n @Input() ariaLabel?: string;\n @Input() testID?: string;\n @Input() label?: string;\n\n @Output() onClick = new EventEmitter<MouseEvent>();\n\n @HostBinding(\"style\") get hostStyles() {\n const variantConfig = buttonConfig.variants[this.variant];\n const sizeConfig = buttonConfig.sizes[this.size];\n return {\n ...buttonConfig.common,\n ...variantConfig,\n ...sizeConfig,\n opacity: this.disabled ? \"0.6\" : \"1\",\n pointerEvents: this.disabled ? \"none\" : \"auto\",\n };\n }\n\n get buttonClasses() {\n return {\n [this.className || \"\"]: !!this.className,\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAgCa,eAAe,CAAA;AACjB,IAAA,OAAO;IACP,OAAO,GAAkB,SAAS;IAClC,IAAI,GAAe,IAAI;IACvB,QAAQ,GAAY,KAAK;AACzB,IAAA,SAAS;AACT,IAAA,EAAE;AACF,IAAA,SAAS;AACT,IAAA,MAAM;AACN,IAAA,KAAK;AAEJ,IAAA,OAAO,GAAG,IAAI,YAAY,EAAc;AAElD,IAAA,IAA0B,UAAU,GAAA;QAClC,MAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;QACzD,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAChD,OAAO;YACL,GAAG,YAAY,CAAC,MAAM;AACtB,YAAA,GAAG,aAAa;AAChB,YAAA,GAAG,UAAU;YACb,OAAO,EAAE,IAAI,CAAC,QAAQ,GAAG,KAAK,GAAG,GAAG;YACpC,aAAa,EAAE,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,MAAM;SAC/C;IACH;AAEA,IAAA,IAAI,aAAa,GAAA;QACf,OAAO;YACL,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS;SACzC;IACH;uGA7BW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,MAAA,EAAA,QAAA,EAAA,UAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,SAAA,EAAA,WAAA,EAAA,MAAA,EAAA,QAAA,EAAA,KAAA,EAAA,OAAA,EAAA,EAAA,OAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAfhB;;;;;;;;;;;AAWT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAES,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAEX,eAAe,EAAA,UAAA,EAAA,CAAA;kBAjB3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE;;;;;;;;;;;AAWT,EAAA,CAAA;AACD,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,YAAY,CAAC;AACxB,iBAAA;;sBAEE;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;sBAEA,WAAW;uBAAC,OAAO;;;AC7CtB;;AAEG;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter } from '@angular/core';
|
|
3
|
+
import { AngularButtonProps, ButtonVariant, ButtonSize } from '@lamenna/lxp-shared-components';
|
|
4
|
+
|
|
5
|
+
declare class ButtonComponent implements AngularButtonProps {
|
|
4
6
|
content?: string;
|
|
5
7
|
variant: ButtonVariant;
|
|
6
8
|
size: ButtonSize;
|
|
@@ -105,5 +107,8 @@ export declare class ButtonComponent implements AngularButtonProps {
|
|
|
105
107
|
get buttonClasses(): {
|
|
106
108
|
[x: string]: boolean;
|
|
107
109
|
};
|
|
110
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
|
|
111
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "lxp-button", never, { "content": { "alias": "content"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "className": { "alias": "className"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "testID": { "alias": "testID"; "required": false; }; "label": { "alias": "label"; "required": false; }; }, { "onClick": "onClick"; }, never, never, true, never>;
|
|
108
112
|
}
|
|
109
|
-
|
|
113
|
+
|
|
114
|
+
export { ButtonComponent };
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lamenna/lxp-angular",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Angular components for LXP",
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"types": "dist/
|
|
5
|
+
"main": "dist/fesm2022/lamenna-lxp-angular.mjs",
|
|
6
|
+
"types": "dist/types/lamenna-lxp-angular.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
@@ -15,15 +15,30 @@
|
|
|
15
15
|
"@angular/core": "^21.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"
|
|
19
|
-
"@lamenna/lxp-shared-components": "0.0.2"
|
|
18
|
+
"tslib": "^2.8.1",
|
|
19
|
+
"@lamenna/lxp-shared-components": "0.0.2",
|
|
20
|
+
"@lamenna/lxp-tokens": "0.0.2"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
23
|
+
"@angular/compiler-cli": "^21.0.6",
|
|
24
|
+
"ng-packagr": "^21.0.1",
|
|
22
25
|
"typescript": "^5.3.3"
|
|
23
26
|
},
|
|
27
|
+
"module": "dist/fesm2022/lamenna-lxp-angular.mjs",
|
|
28
|
+
"typings": "dist/types/lamenna-lxp-angular.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
"./package.json": {
|
|
31
|
+
"default": "./dist/package.json"
|
|
32
|
+
},
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/types/lamenna-lxp-angular.d.ts",
|
|
35
|
+
"default": "./dist/fesm2022/lamenna-lxp-angular.mjs"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": false,
|
|
24
39
|
"scripts": {
|
|
25
|
-
"build": "
|
|
26
|
-
"dev": "
|
|
40
|
+
"build": "ng-packagr -p ng-package.json",
|
|
41
|
+
"dev": "ng-packagr -p ng-package.json -w",
|
|
27
42
|
"test": "jest --passWithNoTests",
|
|
28
43
|
"test:watch": "jest --watch --passWithNoTests",
|
|
29
44
|
"test:coverage": "jest --coverage --passWithNoTests",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Button options tests - Angular package
|
|
3
|
-
*
|
|
4
|
-
* These tests validate that the Angular package can consume the
|
|
5
|
-
* shared button configuration. They purposefully avoid importing
|
|
6
|
-
* Angular runtime/testing utilities so they work in a plain Jest
|
|
7
|
-
* environment without extra Angular Jest presets.
|
|
8
|
-
*/
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=button-options.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button-options.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/button-options.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Button options tests - Angular package
|
|
3
|
-
*
|
|
4
|
-
* These tests validate that the Angular package can consume the
|
|
5
|
-
* shared button configuration. They purposefully avoid importing
|
|
6
|
-
* Angular runtime/testing utilities so they work in a plain Jest
|
|
7
|
-
* environment without extra Angular Jest presets.
|
|
8
|
-
*/
|
|
9
|
-
import { buttonConfig } from "@lamenna/lxp-shared-components";
|
|
10
|
-
describe("Button options (Angular)", () => {
|
|
11
|
-
it("should expose primary and secondary variants", () => {
|
|
12
|
-
expect(buttonConfig.variants.primary).toBeDefined();
|
|
13
|
-
expect(buttonConfig.variants.secondary).toBeDefined();
|
|
14
|
-
});
|
|
15
|
-
it("should expose standard sizes", () => {
|
|
16
|
-
expect(buttonConfig.sizes.sm).toBeDefined();
|
|
17
|
-
expect(buttonConfig.sizes.md).toBeDefined();
|
|
18
|
-
expect(buttonConfig.sizes.lg).toBeDefined();
|
|
19
|
-
});
|
|
20
|
-
it("should have common button styles configured", () => {
|
|
21
|
-
expect(buttonConfig.common.borderRadius).toBeDefined();
|
|
22
|
-
expect(buttonConfig.common.cursor).toBe("pointer");
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=button-options.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button-options.test.js","sourceRoot":"","sources":["../../src/__tests__/button-options.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QACpD,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5C,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5C,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC;QACvD,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAEb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,UAAU,EAEX,MAAM,gCAAgC,CAAC;AAExC,qBAgBa,eAAgB,YAAW,kBAAkB;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,aAAa,CAAa;IACnC,IAAI,EAAE,UAAU,CAAQ;IACxB,QAAQ,EAAE,OAAO,CAAS;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEd,OAAO,2BAAkC;IAEnD,IAA0B,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAUnC;IAED,IAAI,aAAa;;MAIhB;CACF"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Component, Input, Output, EventEmitter, HostBinding, } from "@angular/core";
|
|
8
|
-
import { buttonConfig, } from "@lamenna/lxp-shared-components";
|
|
9
|
-
let ButtonComponent = class ButtonComponent {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.variant = "primary";
|
|
12
|
-
this.size = "md";
|
|
13
|
-
this.disabled = false;
|
|
14
|
-
this.onClick = new EventEmitter();
|
|
15
|
-
}
|
|
16
|
-
get hostStyles() {
|
|
17
|
-
const variantConfig = buttonConfig.variants[this.variant];
|
|
18
|
-
const sizeConfig = buttonConfig.sizes[this.size];
|
|
19
|
-
return {
|
|
20
|
-
...buttonConfig.common,
|
|
21
|
-
...variantConfig,
|
|
22
|
-
...sizeConfig,
|
|
23
|
-
opacity: this.disabled ? "0.6" : "1",
|
|
24
|
-
pointerEvents: this.disabled ? "none" : "auto",
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
get buttonClasses() {
|
|
28
|
-
return {
|
|
29
|
-
[this.className || ""]: !!this.className,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
__decorate([
|
|
34
|
-
Input()
|
|
35
|
-
], ButtonComponent.prototype, "content", void 0);
|
|
36
|
-
__decorate([
|
|
37
|
-
Input()
|
|
38
|
-
], ButtonComponent.prototype, "variant", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
Input()
|
|
41
|
-
], ButtonComponent.prototype, "size", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
Input()
|
|
44
|
-
], ButtonComponent.prototype, "disabled", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
Input()
|
|
47
|
-
], ButtonComponent.prototype, "className", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
Input()
|
|
50
|
-
], ButtonComponent.prototype, "id", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
Input()
|
|
53
|
-
], ButtonComponent.prototype, "ariaLabel", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
Input()
|
|
56
|
-
], ButtonComponent.prototype, "testID", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
Input()
|
|
59
|
-
], ButtonComponent.prototype, "label", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
Output()
|
|
62
|
-
], ButtonComponent.prototype, "onClick", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
HostBinding("style")
|
|
65
|
-
], ButtonComponent.prototype, "hostStyles", null);
|
|
66
|
-
ButtonComponent = __decorate([
|
|
67
|
-
Component({
|
|
68
|
-
selector: "lxp-button",
|
|
69
|
-
template: `
|
|
70
|
-
<button
|
|
71
|
-
[attr.id]="id"
|
|
72
|
-
[attr.data-testid]="testID"
|
|
73
|
-
[attr.aria-label]="ariaLabel"
|
|
74
|
-
[disabled]="disabled"
|
|
75
|
-
(click)="onClick.emit($event)"
|
|
76
|
-
[ngClass]="buttonClasses"
|
|
77
|
-
>
|
|
78
|
-
{{ content }}
|
|
79
|
-
</button>
|
|
80
|
-
`,
|
|
81
|
-
standalone: true,
|
|
82
|
-
})
|
|
83
|
-
], ButtonComponent);
|
|
84
|
-
export { ButtonComponent };
|
|
85
|
-
//# sourceMappingURL=button.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.component.js","sourceRoot":"","sources":["../../../src/components/button/button.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,YAAY,GACb,MAAM,gCAAgC,CAAC;AAkBjC,IAAM,eAAe,GAArB,MAAM,eAAe;IAArB;QAEI,YAAO,GAAkB,SAAS,CAAC;QACnC,SAAI,GAAe,IAAI,CAAC;QACxB,aAAQ,GAAY,KAAK,CAAC;QAOzB,YAAO,GAAG,IAAI,YAAY,EAAc,CAAC;IAmBrD,CAAC;IAjBuB,IAAI,UAAU;QAClC,MAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1D,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,OAAO;YACL,GAAG,YAAY,CAAC,MAAM;YACtB,GAAG,aAAa;YAChB,GAAG,UAAU;YACb,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG;YACpC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;SAC/C,CAAC;IACJ,CAAC;IAED,IAAI,aAAa;QACf,OAAO;YACL,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS;SACzC,CAAC;IACJ,CAAC;CACF,CAAA;AA7BU;IAAR,KAAK,EAAE;gDAAkB;AACjB;IAAR,KAAK,EAAE;gDAAoC;AACnC;IAAR,KAAK,EAAE;6CAAyB;AACxB;IAAR,KAAK,EAAE;iDAA2B;AAC1B;IAAR,KAAK,EAAE;kDAAoB;AACnB;IAAR,KAAK,EAAE;2CAAa;AACZ;IAAR,KAAK,EAAE;kDAAoB;AACnB;IAAR,KAAK,EAAE;+CAAiB;AAChB;IAAR,KAAK,EAAE;8CAAgB;AAEd;IAAT,MAAM,EAAE;gDAA0C;AAE7B;IAArB,WAAW,CAAC,OAAO,CAAC;iDAUpB;AAvBU,eAAe;IAhB3B,SAAS,CAAC;QACT,QAAQ,EAAE,YAAY;QACtB,QAAQ,EAAE;;;;;;;;;;;GAWT;QACD,UAAU,EAAE,IAAI;KACjB,CAAC;GACW,eAAe,CA8B3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
DELETED
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|