matcha-components 20.152.0 → 20.154.0

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.
@@ -2953,6 +2953,8 @@ class MatchaSlideToggleComponent {
2953
2953
  }
2954
2954
  writeValue(value) {
2955
2955
  this.checked = !!value;
2956
+ // Marca para detecção quando o valor é escrito (necessário para OnPush)
2957
+ this.cdr.markForCheck();
2956
2958
  }
2957
2959
  registerOnChange(fn) {
2958
2960
  this.onChange = fn;
@@ -2963,8 +2965,9 @@ class MatchaSlideToggleComponent {
2963
2965
  setDisabledState(isDisabled) {
2964
2966
  this.disabled = isDisabled;
2965
2967
  }
2966
- constructor(elementRef) {
2968
+ constructor(elementRef, cdr) {
2967
2969
  this.elementRef = elementRef;
2970
+ this.cdr = cdr;
2968
2971
  this.color = 'accent';
2969
2972
  this._checked = false;
2970
2973
  this._disabled = false;
@@ -2981,6 +2984,10 @@ class MatchaSlideToggleComponent {
2981
2984
  this.elementRef.nativeElement.removeAttribute('disabled');
2982
2985
  }
2983
2986
  }
2987
+ if (changes['checked']) {
2988
+ // Marca para detecção quando o checked muda (necessário para OnPush)
2989
+ this.cdr.markForCheck();
2990
+ }
2984
2991
  }
2985
2992
  ngAfterViewInit() {
2986
2993
  if (this.disabled) {
@@ -2998,8 +3005,10 @@ class MatchaSlideToggleComponent {
2998
3005
  this.onChange(newCheckedState);
2999
3006
  this.onTouched();
3000
3007
  this.change.emit({ checked: newCheckedState });
3008
+ // Marca para detecção após mudança (necessário para OnPush)
3009
+ this.cdr.markForCheck();
3001
3010
  }
3002
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaSlideToggleComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
3011
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaSlideToggleComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
3003
3012
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: MatchaSlideToggleComponent, isStandalone: false, selector: "matcha-slide-toggle", inputs: { color: "color", checked: "checked", disabled: "disabled" }, outputs: { change: "change" }, providers: [
3004
3013
  {
3005
3014
  provide: NG_VALUE_ACCESSOR,
@@ -3017,7 +3026,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
3017
3026
  multi: true,
3018
3027
  },
3019
3028
  ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<label\n class=\"matcha-slide-toggle-wrapper flex-align-center\"\n [class.matcha-slide-toggle-disabled]=\"disabled\"\n >\n <input\n type=\"checkbox\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n (change)=\"onInputChange($event)\"\n />\n\n <span class=\"matcha-slide-toggle-label ml-8 fw-500 fs-16 lh-20\">\n <ng-content></ng-content>\n </span>\n</label>\n" }]
3020
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { color: [{
3029
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { color: [{
3021
3030
  type: Input
3022
3031
  }], checked: [{
3023
3032
  type: Input