@lamenna/lxp-angular 0.0.4 → 0.0.6
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 +8 -5
- 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 -207
- 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,UAA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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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lamenna/lxp-angular",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Angular components for LXP",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,15 +15,18 @@
|
|
|
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
|
},
|
|
24
27
|
"scripts": {
|
|
25
|
-
"build": "
|
|
26
|
-
"dev": "
|
|
28
|
+
"build": "ng-packagr -p ng-package.json",
|
|
29
|
+
"dev": "ng-packagr -p ng-package.json -w",
|
|
27
30
|
"test": "jest --passWithNoTests",
|
|
28
31
|
"test:watch": "jest --watch --passWithNoTests",
|
|
29
32
|
"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,C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CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEd,OAAO,2BAAkC;IAEnD,IAA0B,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAUnC;IAED,IAAI,aAAa;;MAIhB;CACF"}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
-
var useValue = arguments.length > 2;
|
|
3
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
-
}
|
|
6
|
-
return useValue ? value : void 0;
|
|
7
|
-
};
|
|
8
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
-
var _, done = false;
|
|
14
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
-
var context = {};
|
|
16
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
-
if (kind === "accessor") {
|
|
21
|
-
if (result === void 0) continue;
|
|
22
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
-
}
|
|
27
|
-
else if (_ = accept(result)) {
|
|
28
|
-
if (kind === "field") initializers.unshift(_);
|
|
29
|
-
else descriptor[key] = _;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
-
done = true;
|
|
34
|
-
};
|
|
35
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
36
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
37
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
38
|
-
};
|
|
39
|
-
import { Component, Input, Output, EventEmitter, HostBinding, } from "@angular/core";
|
|
40
|
-
import { buttonConfig, } from "@lamenna/lxp-shared-components";
|
|
41
|
-
let ButtonComponent = (() => {
|
|
42
|
-
let _classDecorators = [Component({
|
|
43
|
-
selector: "lxp-button",
|
|
44
|
-
template: `
|
|
45
|
-
<button
|
|
46
|
-
[attr.id]="id"
|
|
47
|
-
[attr.data-testid]="testID"
|
|
48
|
-
[attr.aria-label]="ariaLabel"
|
|
49
|
-
[disabled]="disabled"
|
|
50
|
-
(click)="onClick.emit($event)"
|
|
51
|
-
[ngClass]="buttonClasses"
|
|
52
|
-
>
|
|
53
|
-
{{ content }}
|
|
54
|
-
</button>
|
|
55
|
-
`,
|
|
56
|
-
standalone: true,
|
|
57
|
-
})];
|
|
58
|
-
let _classDescriptor;
|
|
59
|
-
let _classExtraInitializers = [];
|
|
60
|
-
let _classThis;
|
|
61
|
-
let _instanceExtraInitializers = [];
|
|
62
|
-
let _content_decorators;
|
|
63
|
-
let _content_initializers = [];
|
|
64
|
-
let _content_extraInitializers = [];
|
|
65
|
-
let _variant_decorators;
|
|
66
|
-
let _variant_initializers = [];
|
|
67
|
-
let _variant_extraInitializers = [];
|
|
68
|
-
let _size_decorators;
|
|
69
|
-
let _size_initializers = [];
|
|
70
|
-
let _size_extraInitializers = [];
|
|
71
|
-
let _disabled_decorators;
|
|
72
|
-
let _disabled_initializers = [];
|
|
73
|
-
let _disabled_extraInitializers = [];
|
|
74
|
-
let _className_decorators;
|
|
75
|
-
let _className_initializers = [];
|
|
76
|
-
let _className_extraInitializers = [];
|
|
77
|
-
let _id_decorators;
|
|
78
|
-
let _id_initializers = [];
|
|
79
|
-
let _id_extraInitializers = [];
|
|
80
|
-
let _ariaLabel_decorators;
|
|
81
|
-
let _ariaLabel_initializers = [];
|
|
82
|
-
let _ariaLabel_extraInitializers = [];
|
|
83
|
-
let _testID_decorators;
|
|
84
|
-
let _testID_initializers = [];
|
|
85
|
-
let _testID_extraInitializers = [];
|
|
86
|
-
let _label_decorators;
|
|
87
|
-
let _label_initializers = [];
|
|
88
|
-
let _label_extraInitializers = [];
|
|
89
|
-
let _onClick_decorators;
|
|
90
|
-
let _onClick_initializers = [];
|
|
91
|
-
let _onClick_extraInitializers = [];
|
|
92
|
-
let _get_hostStyles_decorators;
|
|
93
|
-
var ButtonComponent = _classThis = class {
|
|
94
|
-
get hostStyles() {
|
|
95
|
-
const variantConfig = buttonConfig.variants[this.variant];
|
|
96
|
-
const sizeConfig = buttonConfig.sizes[this.size];
|
|
97
|
-
return {
|
|
98
|
-
...buttonConfig.common,
|
|
99
|
-
...variantConfig,
|
|
100
|
-
...sizeConfig,
|
|
101
|
-
opacity: this.disabled ? "0.6" : "1",
|
|
102
|
-
pointerEvents: this.disabled ? "none" : "auto",
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
get buttonClasses() {
|
|
106
|
-
return {
|
|
107
|
-
[this.className || ""]: !!this.className,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
constructor() {
|
|
111
|
-
Object.defineProperty(this, "content", {
|
|
112
|
-
enumerable: true,
|
|
113
|
-
configurable: true,
|
|
114
|
-
writable: true,
|
|
115
|
-
value: (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _content_initializers, void 0))
|
|
116
|
-
});
|
|
117
|
-
Object.defineProperty(this, "variant", {
|
|
118
|
-
enumerable: true,
|
|
119
|
-
configurable: true,
|
|
120
|
-
writable: true,
|
|
121
|
-
value: (__runInitializers(this, _content_extraInitializers), __runInitializers(this, _variant_initializers, "primary"))
|
|
122
|
-
});
|
|
123
|
-
Object.defineProperty(this, "size", {
|
|
124
|
-
enumerable: true,
|
|
125
|
-
configurable: true,
|
|
126
|
-
writable: true,
|
|
127
|
-
value: (__runInitializers(this, _variant_extraInitializers), __runInitializers(this, _size_initializers, "md"))
|
|
128
|
-
});
|
|
129
|
-
Object.defineProperty(this, "disabled", {
|
|
130
|
-
enumerable: true,
|
|
131
|
-
configurable: true,
|
|
132
|
-
writable: true,
|
|
133
|
-
value: (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _disabled_initializers, false))
|
|
134
|
-
});
|
|
135
|
-
Object.defineProperty(this, "className", {
|
|
136
|
-
enumerable: true,
|
|
137
|
-
configurable: true,
|
|
138
|
-
writable: true,
|
|
139
|
-
value: (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _className_initializers, void 0))
|
|
140
|
-
});
|
|
141
|
-
Object.defineProperty(this, "id", {
|
|
142
|
-
enumerable: true,
|
|
143
|
-
configurable: true,
|
|
144
|
-
writable: true,
|
|
145
|
-
value: (__runInitializers(this, _className_extraInitializers), __runInitializers(this, _id_initializers, void 0))
|
|
146
|
-
});
|
|
147
|
-
Object.defineProperty(this, "ariaLabel", {
|
|
148
|
-
enumerable: true,
|
|
149
|
-
configurable: true,
|
|
150
|
-
writable: true,
|
|
151
|
-
value: (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _ariaLabel_initializers, void 0))
|
|
152
|
-
});
|
|
153
|
-
Object.defineProperty(this, "testID", {
|
|
154
|
-
enumerable: true,
|
|
155
|
-
configurable: true,
|
|
156
|
-
writable: true,
|
|
157
|
-
value: (__runInitializers(this, _ariaLabel_extraInitializers), __runInitializers(this, _testID_initializers, void 0))
|
|
158
|
-
});
|
|
159
|
-
Object.defineProperty(this, "label", {
|
|
160
|
-
enumerable: true,
|
|
161
|
-
configurable: true,
|
|
162
|
-
writable: true,
|
|
163
|
-
value: (__runInitializers(this, _testID_extraInitializers), __runInitializers(this, _label_initializers, void 0))
|
|
164
|
-
});
|
|
165
|
-
Object.defineProperty(this, "onClick", {
|
|
166
|
-
enumerable: true,
|
|
167
|
-
configurable: true,
|
|
168
|
-
writable: true,
|
|
169
|
-
value: (__runInitializers(this, _label_extraInitializers), __runInitializers(this, _onClick_initializers, new EventEmitter()))
|
|
170
|
-
});
|
|
171
|
-
__runInitializers(this, _onClick_extraInitializers);
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
__setFunctionName(_classThis, "ButtonComponent");
|
|
175
|
-
(() => {
|
|
176
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
177
|
-
_content_decorators = [Input()];
|
|
178
|
-
_variant_decorators = [Input()];
|
|
179
|
-
_size_decorators = [Input()];
|
|
180
|
-
_disabled_decorators = [Input()];
|
|
181
|
-
_className_decorators = [Input()];
|
|
182
|
-
_id_decorators = [Input()];
|
|
183
|
-
_ariaLabel_decorators = [Input()];
|
|
184
|
-
_testID_decorators = [Input()];
|
|
185
|
-
_label_decorators = [Input()];
|
|
186
|
-
_onClick_decorators = [Output()];
|
|
187
|
-
_get_hostStyles_decorators = [HostBinding("style")];
|
|
188
|
-
__esDecorate(_classThis, null, _get_hostStyles_decorators, { kind: "getter", name: "hostStyles", static: false, private: false, access: { has: obj => "hostStyles" in obj, get: obj => obj.hostStyles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
189
|
-
__esDecorate(null, null, _content_decorators, { kind: "field", name: "content", static: false, private: false, access: { has: obj => "content" in obj, get: obj => obj.content, set: (obj, value) => { obj.content = value; } }, metadata: _metadata }, _content_initializers, _content_extraInitializers);
|
|
190
|
-
__esDecorate(null, null, _variant_decorators, { kind: "field", name: "variant", static: false, private: false, access: { has: obj => "variant" in obj, get: obj => obj.variant, set: (obj, value) => { obj.variant = value; } }, metadata: _metadata }, _variant_initializers, _variant_extraInitializers);
|
|
191
|
-
__esDecorate(null, null, _size_decorators, { kind: "field", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
192
|
-
__esDecorate(null, null, _disabled_decorators, { kind: "field", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, get: obj => obj.disabled, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, _disabled_initializers, _disabled_extraInitializers);
|
|
193
|
-
__esDecorate(null, null, _className_decorators, { kind: "field", name: "className", static: false, private: false, access: { has: obj => "className" in obj, get: obj => obj.className, set: (obj, value) => { obj.className = value; } }, metadata: _metadata }, _className_initializers, _className_extraInitializers);
|
|
194
|
-
__esDecorate(null, null, _id_decorators, { kind: "field", name: "id", static: false, private: false, access: { has: obj => "id" in obj, get: obj => obj.id, set: (obj, value) => { obj.id = value; } }, metadata: _metadata }, _id_initializers, _id_extraInitializers);
|
|
195
|
-
__esDecorate(null, null, _ariaLabel_decorators, { kind: "field", name: "ariaLabel", static: false, private: false, access: { has: obj => "ariaLabel" in obj, get: obj => obj.ariaLabel, set: (obj, value) => { obj.ariaLabel = value; } }, metadata: _metadata }, _ariaLabel_initializers, _ariaLabel_extraInitializers);
|
|
196
|
-
__esDecorate(null, null, _testID_decorators, { kind: "field", name: "testID", static: false, private: false, access: { has: obj => "testID" in obj, get: obj => obj.testID, set: (obj, value) => { obj.testID = value; } }, metadata: _metadata }, _testID_initializers, _testID_extraInitializers);
|
|
197
|
-
__esDecorate(null, null, _label_decorators, { kind: "field", name: "label", static: false, private: false, access: { has: obj => "label" in obj, get: obj => obj.label, set: (obj, value) => { obj.label = value; } }, metadata: _metadata }, _label_initializers, _label_extraInitializers);
|
|
198
|
-
__esDecorate(null, null, _onClick_decorators, { kind: "field", name: "onClick", static: false, private: false, access: { has: obj => "onClick" in obj, get: obj => obj.onClick, set: (obj, value) => { obj.onClick = value; } }, metadata: _metadata }, _onClick_initializers, _onClick_extraInitializers);
|
|
199
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
200
|
-
ButtonComponent = _classThis = _classDescriptor.value;
|
|
201
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
202
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
203
|
-
})();
|
|
204
|
-
return ButtonComponent = _classThis;
|
|
205
|
-
})();
|
|
206
|
-
export { ButtonComponent };
|
|
207
|
-
//# 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;IAkB3B,eAAe;4BAhB3B,SAAS,CAAC;YACT,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE;;;;;;;;;;;GAWT;YACD,UAAU,EAAE,IAAI;SACjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAcsB,IAAI,UAAU;YAClC,MAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC1D,MAAM,UAAU,GAAG,YAAY,CAA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T,SAAS,6FAAU;QACnB,oKAAA,MAAM,6BAAN,MAAM,uFAAU;QAChB,iKAAA,KAAK,6BAAL,KAAK,qFAAU;QAEd,uKAAA,OAAO,6BAAP,OAAO,yFAAkC;QAXrD,6KA8BC;;;QA9BY,uDAAe;;;;SAAf,eAAe"}
|
|
@@ -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"}
|