@wlcm/angular 18.2.30 → 18.2.31

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,4 +1,4 @@
1
- import { ChangeDetectionStrategy, Component, Input, Output, EventEmitter, input } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, Output, EventEmitter, input, computed, } from '@angular/core';
2
2
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
3
3
  import { CommonModule } from '@angular/common';
4
4
  import * as i0 from "@angular/core";
@@ -9,33 +9,36 @@ export class WlcmButtonComponent {
9
9
  /**
10
10
  * @deprecated Use `styleType` instead. This input will be removed in a future release.
11
11
  */
12
- this.type = 'primary';
12
+ this.type = input(undefined);
13
13
  this.size = input('large');
14
14
  this.styleType = input('filled');
15
15
  this.buttonColor = input('primary');
16
16
  this.buttonType = input('button');
17
- this.isDisabled = false;
18
- this.isLoading = false;
17
+ this.isDisabled = input(false);
18
+ this.isLoading = input(false);
19
19
  this.clicked = new EventEmitter();
20
+ this.buttonClassMap = computed(() => ({
21
+ 'wlcm-button': true,
22
+ [`wlcm-button--${this.type()}`]: !!this.type(),
23
+ [`wlcm-button--${this.size()}`]: !!this.size(),
24
+ [`wlcm-button--style-${this.styleType()}`]: !!this.styleType(),
25
+ [`wlcm-button--color-${this.buttonColor()}`]: !!this.buttonColor(),
26
+ 'wlcm-button--loading': this.isLoading(),
27
+ 'wlcm-button--disabled': this.isDisabled(),
28
+ }));
20
29
  }
21
30
  onClick() {
22
- if (this.isDisabled || this.isLoading)
31
+ if (this.isDisabled() || this.isLoading())
23
32
  return;
24
33
  this.clicked.emit();
25
34
  }
26
35
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
27
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.5", type: WlcmButtonComponent, isStandalone: true, selector: "wlcm-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, styleType: { classPropertyName: "styleType", publicName: "styleType", isSignal: true, isRequired: false, transformFunction: null }, buttonColor: { classPropertyName: "buttonColor", publicName: "buttonColor", isSignal: true, isRequired: false, transformFunction: null }, buttonType: { classPropertyName: "buttonType", publicName: "buttonType", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n (click)=\"onClick()\"\n class=\"wlcm-button\n wlcm-button--{{ type }}\n wlcm-button--{{ size() }}\n wlcm-button--style-{{ styleType() }}\n wlcm-button--color-{{ buttonColor() }}\"\n [ngClass]=\"{\n 'wlcm-button--loading': isLoading,\n 'wlcm-button--disabled': isDisabled\n }\"\n [type]=\"buttonType()\"\n>\n <div class=\"wlcm-button__content\">\n <mat-spinner\n *ngIf=\"isLoading\"\n [color]=\"type === 'primary' ? 'accent' : 'primary'\"\n [diameter]=\"16\"\n ></mat-spinner>\n\n <ng-content></ng-content>\n </div>\n</button>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
36
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.5", type: WlcmButtonComponent, isStandalone: true, selector: "wlcm-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, styleType: { classPropertyName: "styleType", publicName: "styleType", isSignal: true, isRequired: false, transformFunction: null }, buttonColor: { classPropertyName: "buttonColor", publicName: "buttonColor", isSignal: true, isRequired: false, transformFunction: null }, buttonType: { classPropertyName: "buttonType", publicName: "buttonType", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n (click)=\"onClick()\"\n [ngClass]=\"buttonClassMap()\"\n [type]=\"buttonType()\"\n>\n <div class=\"wlcm-button__content\">\n <mat-spinner\n *ngIf=\"isLoading()\"\n [color]=\"(type() || buttonColor()) === 'primary' ? 'accent' : 'primary'\"\n [diameter]=\"16\"\n ></mat-spinner>\n\n <ng-content></ng-content>\n </div>\n</button>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
28
37
  }
29
38
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmButtonComponent, decorators: [{
30
39
  type: Component,
31
- args: [{ selector: 'wlcm-button', standalone: true, imports: [CommonModule, MatProgressSpinnerModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n (click)=\"onClick()\"\n class=\"wlcm-button\n wlcm-button--{{ type }}\n wlcm-button--{{ size() }}\n wlcm-button--style-{{ styleType() }}\n wlcm-button--color-{{ buttonColor() }}\"\n [ngClass]=\"{\n 'wlcm-button--loading': isLoading,\n 'wlcm-button--disabled': isDisabled\n }\"\n [type]=\"buttonType()\"\n>\n <div class=\"wlcm-button__content\">\n <mat-spinner\n *ngIf=\"isLoading\"\n [color]=\"type === 'primary' ? 'accent' : 'primary'\"\n [diameter]=\"16\"\n ></mat-spinner>\n\n <ng-content></ng-content>\n </div>\n</button>\n" }]
32
- }], propDecorators: { type: [{
33
- type: Input
34
- }], isDisabled: [{
35
- type: Input
36
- }], isLoading: [{
37
- type: Input
38
- }], clicked: [{
40
+ args: [{ selector: 'wlcm-button', standalone: true, imports: [CommonModule, MatProgressSpinnerModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n (click)=\"onClick()\"\n [ngClass]=\"buttonClassMap()\"\n [type]=\"buttonType()\"\n>\n <div class=\"wlcm-button__content\">\n <mat-spinner\n *ngIf=\"isLoading()\"\n [color]=\"(type() || buttonColor()) === 'primary' ? 'accent' : 'primary'\"\n [diameter]=\"16\"\n ></mat-spinner>\n\n <ng-content></ng-content>\n </div>\n</button>\n" }]
41
+ }], propDecorators: { clicked: [{
39
42
  type: Output
40
43
  }] } });
41
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL21vZHVsZXMvYnV0dG9uL3NyYy9saWIvY29tcG9uZW50cy9idXR0b24vYnV0dG9uLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uL21vZHVsZXMvYnV0dG9uL3NyYy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XG4gICAgJ3dsY20tYnV0dG9uLS1sb2FkaW5nJzogdGhpcy5pc0xvYWRpbmcoKSxcbiAgICAnd2xjbS1idXR0b24tLWRpc2FibGVkJzogdGhpcy5pc0Rpc2FibGVkKCksXG4gIH0pKTtcblxuICBvbkNsaWNrKCkge1xuICAgIGlmICh0aGlzLmlzRGlzYWJsZWQoKSB8fCB0aGlzLmlzTG9hZGluZygpKSByZXR1cm47XG5cbiAgICB0aGlzLmNsaWNrZWQuZW1pdCgpO1xuICB9XG59XG4iLCI8YnV0dG9uXG4gIChjbGljayk9XCJvbkNsaWNrKClcIlxuICBbbmdDbGFzc109XCJidXR0b25DbGFzc01hcCgpXCJcbiAgW3R5cGVdPVwiYnV0dG9uVHlwZSgpXCJcbj5cbiAgPGRpdiBjbGFzcz1cIndsY20tYnV0dG9uX19jb250ZW50XCI+XG4gICAgPG1hdC1zcGlubmVyXG4gICAgICAqbmdJZj1cImlzTG9hZGluZygpXCJcbiAgICAgIFtjb2xvcl09XCIodHlwZSgpIHx8IGJ1dHRvbkNvbG9yKCkpID09PSAncHJpbWFyeScgPyAnYWNjZW50JyA6ICdwcmltYXJ5J1wiXG4gICAgICBbZGlhbWV0ZXJdPVwiMTZcIlxuICAgID48L21hdC1zcGlubmVyPlxuXG4gICAgPG5nLWNvbnRlbnQ+PC9uZy1jb250ZW50PlxuICA8L2Rpdj5cbjwvYnV0dG9uPlxuIl19
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, NgModule } from '@angular/core';
2
+ import { input, EventEmitter, computed, Component, ChangeDetectionStrategy, Output, NgModule } from '@angular/core';
3
3
  import * as i2 from '@angular/material/progress-spinner';
4
4
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
5
5
  import * as i1 from '@angular/common';
@@ -10,33 +10,36 @@ class WlcmButtonComponent {
10
10
  /**
11
11
  * @deprecated Use `styleType` instead. This input will be removed in a future release.
12
12
  */
13
- this.type = 'primary';
13
+ this.type = input(undefined);
14
14
  this.size = input('large');
15
15
  this.styleType = input('filled');
16
16
  this.buttonColor = input('primary');
17
17
  this.buttonType = input('button');
18
- this.isDisabled = false;
19
- this.isLoading = false;
18
+ this.isDisabled = input(false);
19
+ this.isLoading = input(false);
20
20
  this.clicked = new EventEmitter();
21
+ this.buttonClassMap = computed(() => ({
22
+ 'wlcm-button': true,
23
+ [`wlcm-button--${this.type()}`]: !!this.type(),
24
+ [`wlcm-button--${this.size()}`]: !!this.size(),
25
+ [`wlcm-button--style-${this.styleType()}`]: !!this.styleType(),
26
+ [`wlcm-button--color-${this.buttonColor()}`]: !!this.buttonColor(),
27
+ 'wlcm-button--loading': this.isLoading(),
28
+ 'wlcm-button--disabled': this.isDisabled(),
29
+ }));
21
30
  }
22
31
  onClick() {
23
- if (this.isDisabled || this.isLoading)
32
+ if (this.isDisabled() || this.isLoading())
24
33
  return;
25
34
  this.clicked.emit();
26
35
  }
27
36
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
28
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.5", type: WlcmButtonComponent, isStandalone: true, selector: "wlcm-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, styleType: { classPropertyName: "styleType", publicName: "styleType", isSignal: true, isRequired: false, transformFunction: null }, buttonColor: { classPropertyName: "buttonColor", publicName: "buttonColor", isSignal: true, isRequired: false, transformFunction: null }, buttonType: { classPropertyName: "buttonType", publicName: "buttonType", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n (click)=\"onClick()\"\n class=\"wlcm-button\n wlcm-button--{{ type }}\n wlcm-button--{{ size() }}\n wlcm-button--style-{{ styleType() }}\n wlcm-button--color-{{ buttonColor() }}\"\n [ngClass]=\"{\n 'wlcm-button--loading': isLoading,\n 'wlcm-button--disabled': isDisabled\n }\"\n [type]=\"buttonType()\"\n>\n <div class=\"wlcm-button__content\">\n <mat-spinner\n *ngIf=\"isLoading\"\n [color]=\"type === 'primary' ? 'accent' : 'primary'\"\n [diameter]=\"16\"\n ></mat-spinner>\n\n <ng-content></ng-content>\n </div>\n</button>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
37
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.5", type: WlcmButtonComponent, isStandalone: true, selector: "wlcm-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, styleType: { classPropertyName: "styleType", publicName: "styleType", isSignal: true, isRequired: false, transformFunction: null }, buttonColor: { classPropertyName: "buttonColor", publicName: "buttonColor", isSignal: true, isRequired: false, transformFunction: null }, buttonType: { classPropertyName: "buttonType", publicName: "buttonType", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n (click)=\"onClick()\"\n [ngClass]=\"buttonClassMap()\"\n [type]=\"buttonType()\"\n>\n <div class=\"wlcm-button__content\">\n <mat-spinner\n *ngIf=\"isLoading()\"\n [color]=\"(type() || buttonColor()) === 'primary' ? 'accent' : 'primary'\"\n [diameter]=\"16\"\n ></mat-spinner>\n\n <ng-content></ng-content>\n </div>\n</button>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
29
38
  }
30
39
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmButtonComponent, decorators: [{
31
40
  type: Component,
32
- args: [{ selector: 'wlcm-button', standalone: true, imports: [CommonModule, MatProgressSpinnerModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n (click)=\"onClick()\"\n class=\"wlcm-button\n wlcm-button--{{ type }}\n wlcm-button--{{ size() }}\n wlcm-button--style-{{ styleType() }}\n wlcm-button--color-{{ buttonColor() }}\"\n [ngClass]=\"{\n 'wlcm-button--loading': isLoading,\n 'wlcm-button--disabled': isDisabled\n }\"\n [type]=\"buttonType()\"\n>\n <div class=\"wlcm-button__content\">\n <mat-spinner\n *ngIf=\"isLoading\"\n [color]=\"type === 'primary' ? 'accent' : 'primary'\"\n [diameter]=\"16\"\n ></mat-spinner>\n\n <ng-content></ng-content>\n </div>\n</button>\n" }]
33
- }], propDecorators: { type: [{
34
- type: Input
35
- }], isDisabled: [{
36
- type: Input
37
- }], isLoading: [{
38
- type: Input
39
- }], clicked: [{
41
+ args: [{ selector: 'wlcm-button', standalone: true, imports: [CommonModule, MatProgressSpinnerModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n (click)=\"onClick()\"\n [ngClass]=\"buttonClassMap()\"\n [type]=\"buttonType()\"\n>\n <div class=\"wlcm-button__content\">\n <mat-spinner\n *ngIf=\"isLoading()\"\n [color]=\"(type() || buttonColor()) === 'primary' ? 'accent' : 'primary'\"\n [diameter]=\"16\"\n ></mat-spinner>\n\n <ng-content></ng-content>\n </div>\n</button>\n" }]
42
+ }], propDecorators: { clicked: [{
40
43
  type: Output
41
44
  }] } });
42
45
 
@@ -1 +1 @@
1
- {"version":3,"file":"wlcm-angular-button.mjs","sources":["../../../../modules/button/src/lib/components/button/button.component.ts","../../../../modules/button/src/lib/components/button/button.component.html","../../../../modules/button/src/lib/button.module.ts","../../../../modules/button/src/wlcm-angular-button.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input, Output, EventEmitter, InputSignal, input } from '@angular/core';\nimport { WlcmButtonColor, WlcmButtonSize, WlcmButtonStyleType, WlcmButtonType } from '../../models/button.models';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'wlcm-button',\n standalone: true,\n imports: [CommonModule, MatProgressSpinnerModule],\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class WlcmButtonComponent {\n /**\n * @deprecated Use `styleType` instead. This input will be removed in a future release.\n */\n @Input() type = 'primary';\n\n size: InputSignal<WlcmButtonSize> = input<WlcmButtonSize>('large');\n\n styleType: InputSignal<WlcmButtonStyleType> = input<WlcmButtonStyleType>('filled');\n\n buttonColor: InputSignal<WlcmButtonColor> = input<WlcmButtonColor>('primary');\n\n buttonType: InputSignal<WlcmButtonType> = input<WlcmButtonType>('button');\n\n @Input() isDisabled = false;\n\n @Input() isLoading = false;\n\n @Output() clicked: EventEmitter<void> = new EventEmitter();\n\n onClick() {\n if (this.isDisabled || this.isLoading) return;\n\n this.clicked.emit();\n }\n}\n","<button\n (click)=\"onClick()\"\n class=\"wlcm-button\n wlcm-button--{{ type }}\n wlcm-button--{{ size() }}\n wlcm-button--style-{{ styleType() }}\n wlcm-button--color-{{ buttonColor() }}\"\n [ngClass]=\"{\n 'wlcm-button--loading': isLoading,\n 'wlcm-button--disabled': isDisabled\n }\"\n [type]=\"buttonType()\"\n>\n <div class=\"wlcm-button__content\">\n <mat-spinner\n *ngIf=\"isLoading\"\n [color]=\"type === 'primary' ? 'accent' : 'primary'\"\n [diameter]=\"16\"\n ></mat-spinner>\n\n <ng-content></ng-content>\n </div>\n</button>\n","import { NgModule } from '@angular/core';\nimport { WlcmButtonComponent } from './components/button/button.component';\n\n@NgModule({\n imports: [WlcmButtonComponent],\n exports: [WlcmButtonComponent],\n})\nexport class WlcmButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAaa,mBAAmB,CAAA;AARhC,IAAA,WAAA,GAAA;AASE;;AAEG;QACM,IAAI,CAAA,IAAA,GAAG,SAAS,CAAC;AAE1B,QAAA,IAAA,CAAA,IAAI,GAAgC,KAAK,CAAiB,OAAO,CAAC,CAAC;AAEnE,QAAA,IAAA,CAAA,SAAS,GAAqC,KAAK,CAAsB,QAAQ,CAAC,CAAC;AAEnF,QAAA,IAAA,CAAA,WAAW,GAAiC,KAAK,CAAkB,SAAS,CAAC,CAAC;AAE9E,QAAA,IAAA,CAAA,UAAU,GAAgC,KAAK,CAAiB,QAAQ,CAAC,CAAC;QAEjE,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;QAEnB,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;AAEjB,QAAA,IAAA,CAAA,OAAO,GAAuB,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AgB,CAAA;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAhB,gBAAgB,EAAA,OAAA,EAAA,CAHjB,mBAAmB,CAAA,EAAA,OAAA,EAAA,CACnB,mBAAmB,CAAA,EAAA,CAAA,CAAA,EAAA;AAElB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHjB,mBAAmB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGlB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,mBAAmB,CAAC;oBAC9B,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC/B,iBAAA,CAAA;;;ACND;;AAEG;;;;"}
1
+ {"version":3,"file":"wlcm-angular-button.mjs","sources":["../../../../modules/button/src/lib/components/button/button.component.ts","../../../../modules/button/src/lib/components/button/button.component.html","../../../../modules/button/src/lib/button.module.ts","../../../../modules/button/src/wlcm-angular-button.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Output,\n EventEmitter,\n InputSignal,\n input,\n computed,\n Signal,\n} from '@angular/core';\nimport { WlcmButtonColor, WlcmButtonSize, WlcmButtonStyleType, WlcmButtonType } from '../../models/button.models';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'wlcm-button',\n standalone: true,\n imports: [CommonModule, MatProgressSpinnerModule],\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class WlcmButtonComponent {\n /**\n * @deprecated Use `styleType` instead. This input will be removed in a future release.\n */\n type: InputSignal<string | undefined> = input<string | undefined>(undefined);\n\n size: InputSignal<WlcmButtonSize> = input<WlcmButtonSize>('large');\n\n styleType: InputSignal<WlcmButtonStyleType> = input<WlcmButtonStyleType>('filled');\n\n buttonColor: InputSignal<WlcmButtonColor> = input<WlcmButtonColor>('primary');\n\n buttonType: InputSignal<WlcmButtonType> = input<WlcmButtonType>('button');\n\n isDisabled: InputSignal<boolean> = input(false);\n\n isLoading: InputSignal<boolean> = input(false);\n\n @Output() clicked: EventEmitter<void> = new EventEmitter();\n\n protected readonly buttonClassMap: Signal<Record<string, boolean>> = computed(() => ({\n 'wlcm-button': true,\n [`wlcm-button--${this.type()}`]: !!this.type(),\n [`wlcm-button--${this.size()}`]: !!this.size(),\n [`wlcm-button--style-${this.styleType()}`]: !!this.styleType(),\n [`wlcm-button--color-${this.buttonColor()}`]: !!this.buttonColor(),\n 'wlcm-button--loading': this.isLoading(),\n 'wlcm-button--disabled': this.isDisabled(),\n }));\n\n onClick() {\n if (this.isDisabled() || this.isLoading()) return;\n\n this.clicked.emit();\n }\n}\n","<button\n (click)=\"onClick()\"\n [ngClass]=\"buttonClassMap()\"\n [type]=\"buttonType()\"\n>\n <div class=\"wlcm-button__content\">\n <mat-spinner\n *ngIf=\"isLoading()\"\n [color]=\"(type() || buttonColor()) === 'primary' ? 'accent' : 'primary'\"\n [diameter]=\"16\"\n ></mat-spinner>\n\n <ng-content></ng-content>\n </div>\n</button>\n","import { NgModule } from '@angular/core';\nimport { WlcmButtonComponent } from './components/button/button.component';\n\n@NgModule({\n imports: [WlcmButtonComponent],\n exports: [WlcmButtonComponent],\n})\nexport class WlcmButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAsBa,mBAAmB,CAAA;AARhC,IAAA,WAAA,GAAA;AASE;;AAEG;AACH,QAAA,IAAA,CAAA,IAAI,GAAoC,KAAK,CAAqB,SAAS,CAAC,CAAC;A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BAAmB,CAAA,EAAA,CAAA,CAAA,EAAA;AAElB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHjB,mBAAmB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGlB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,mBAAmB,CAAC;oBAC9B,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC/B,iBAAA,CAAA;;;ACND;;AAEG;;;;"}
@@ -1,19 +1,20 @@
1
- import { EventEmitter, InputSignal } from '@angular/core';
1
+ import { EventEmitter, InputSignal, Signal } from '@angular/core';
2
2
  import { WlcmButtonColor, WlcmButtonSize, WlcmButtonStyleType, WlcmButtonType } from '../../models/button.models';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class WlcmButtonComponent {
5
5
  /**
6
6
  * @deprecated Use `styleType` instead. This input will be removed in a future release.
7
7
  */
8
- type: string;
8
+ type: InputSignal<string | undefined>;
9
9
  size: InputSignal<WlcmButtonSize>;
10
10
  styleType: InputSignal<WlcmButtonStyleType>;
11
11
  buttonColor: InputSignal<WlcmButtonColor>;
12
12
  buttonType: InputSignal<WlcmButtonType>;
13
- isDisabled: boolean;
14
- isLoading: boolean;
13
+ isDisabled: InputSignal<boolean>;
14
+ isLoading: InputSignal<boolean>;
15
15
  clicked: EventEmitter<void>;
16
+ protected readonly buttonClassMap: Signal<Record<string, boolean>>;
16
17
  onClick(): void;
17
18
  static ɵfac: i0.ɵɵFactoryDeclaration<WlcmButtonComponent, never>;
18
- static ɵcmp: i0.ɵɵComponentDeclaration<WlcmButtonComponent, "wlcm-button", never, { "type": { "alias": "type"; "required": false; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "styleType": { "alias": "styleType"; "required": false; "isSignal": true; }; "buttonColor": { "alias": "buttonColor"; "required": false; "isSignal": true; }; "buttonType": { "alias": "buttonType"; "required": false; "isSignal": true; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; }, { "clicked": "clicked"; }, never, ["*"], true, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<WlcmButtonComponent, "wlcm-button", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "styleType": { "alias": "styleType"; "required": false; "isSignal": true; }; "buttonColor": { "alias": "buttonColor"; "required": false; "isSignal": true; }; "buttonType": { "alias": "buttonType"; "required": false; "isSignal": true; }; "isDisabled": { "alias": "isDisabled"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; }, never, ["*"], true, never>;
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wlcm/angular",
3
- "version": "18.2.30",
3
+ "version": "18.2.31",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./index.mjs",