Skip to content

Commit

Permalink
refactor(button-close): input signals, host bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
xidedix committed Aug 16, 2024
1 parent 1fd4bdc commit f59bf08
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions projects/coreui-angular/src/lib/button/button-close.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ import { ButtonDirective } from './button.directive';
selector: '[cButtonClose]',
standalone: true,
hostDirectives: [{ directive: ThemeDirective, inputs: ['dark'] }],
host: { class: 'btn btn-close', '[class]': 'hostClasses()', '[attr.type]': 'type()' }
host: {
class: 'btn btn-close',
'[class]': 'hostClasses()',
'[attr.aria-disabled]': 'ariaDisabled()',
'[attr.aria-pressed]': 'isActive()',
'[attr.disabled]': 'attrDisabled()',
'[attr.tabindex]': 'tabIndex()',
'[attr.type]': 'type()'
}
})
export class ButtonCloseDirective extends ButtonDirective {
/**
Expand All @@ -22,8 +30,8 @@ export class ButtonCloseDirective extends ButtonDirective {
'btn-close': true,
'btn-close-white': this.white(),
[`btn-${this.size()}`]: !!this.size(),
disabled: this.disabled(),
active: this.active()
active: this.active(),
disabled: this._disabled()
} as Record<string, boolean>;
});
}

0 comments on commit f59bf08

Please sign in to comment.