@lamenna/lxp-angular 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.
@@ -1,47 +1,72 @@
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 });
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;
38
6
  };
39
7
  import { Component, Input, Output, EventEmitter, HostBinding, } from "@angular/core";
40
8
  import { buttonConfig, } from "@lamenna/lxp-shared-components";
41
- let ButtonComponent = (() => {
42
- let _classDecorators = [Component({
43
- selector: "lxp-button",
44
- template: `
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: `
45
70
  <button
46
71
  [attr.id]="id"
47
72
  [attr.data-testid]="testID"
@@ -53,155 +78,8 @@ let ButtonComponent = (() => {
53
78
  {{ content }}
54
79
  </button>
55
80
  `,
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
- })();
81
+ standalone: true,
82
+ })
83
+ ], ButtonComponent);
206
84
  export { ButtonComponent };
207
85
  //# sourceMappingURL=button.component.js.map
@@ -1 +1 @@
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,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjD,OAAO;gBACL,GAAG,YAAY,CAAC,MAAM;gBACtB,GAAG,aAAa;gBAChB,GAAG,UAAU;gBACb,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG;gBACpC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;aAC/C,CAAC;QACJ,CAAC;QAED,IAAI,aAAa;YACf,OAAO;gBACL,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS;aACzC,CAAC;QACJ,CAAC;;YA5BQ;;;;wBADE,mDAAe;eACA;YACjB;;;;4HAAyB,SAAS;eAAC;YACnC;;;;yHAAmB,IAAI;eAAC;YACxB;;;;0HAAoB,KAAK;eAAC;YAC1B;;;;;eAAmB;YACnB;;;;;eAAY;YACZ;;;;;eAAmB;YACnB;;;;;eAAgB;YAChB;;;;;eAAe;YAEd;;;;0HAAU,IAAI,YAAY,EAAc;eAAC;;;;;;;+BAVlD,KAAK,EAAE;+BACP,KAAK,EAAE;4BACP,KAAK,EAAE;gCACP,KAAK,EAAE;iCACP,KAAK,EAAE;0BACP,KAAK,EAAE;iCACP,KAAK,EAAE;8BACP,KAAK,EAAE;6BACP,KAAK,EAAE;+BAEP,MAAM,EAAE;sCAER,WAAW,CAAC,OAAO,CAAC;QAAC,2LAAI,UAAU,6DAUnC;QAtBQ,uKAAA,OAAO,6BAAP,OAAO,yFAAU;QACjB,uKAAA,OAAO,6BAAP,OAAO,yFAA4B;QACnC,8JAAA,IAAI,6BAAJ,IAAI,mFAAoB;QACxB,0KAAA,QAAQ,6BAAR,QAAQ,2FAAkB;QAC1B,6KAAA,SAAS,6BAAT,SAAS,6FAAU;QACnB,wJAAA,EAAE,6BAAF,EAAE,+EAAU;QACZ,6KAAA,SAAS,6BAAT,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
+ {"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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8B3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lamenna/lxp-angular",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Angular components for LXP",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",