Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion angular/projects/catalyst/src/lib/catalyst.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ const CatComponents = [
Components.CatTime,
Components.CatToggle,
Components.CatTooltip,
Components.CatTag
Components.CatTag,
Components.CatMenu,
Components.CatMenuItem
];

const CatDirectives = [
Expand Down
140 changes: 140 additions & 0 deletions angular/projects/catalyst/src/lib/directives/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,146 @@ export declare interface CatInput extends Components.CatInput {
catChangeFiles: EventEmitter<CustomEvent<FileList | null>>;
}

@ProxyCmp({
inputs: [
'arrowNavigation',
'delayedTriggerInit',
'disabled',
'justify',
'noResize',
'overflow',
'placement',
'triggerA11yLabel',
'triggerClass',
'triggerColor',
'triggerIcon',
'triggerIconOnly',
'triggerLabel',
'triggerNativeAttributes',
'triggerSize',
'triggerTestId',
'triggerVariant'
],
methods: ['open', 'close', 'toggle']
})
@Component({
selector: 'cat-menu',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: [
'arrowNavigation',
'delayedTriggerInit',
'disabled',
'justify',
'noResize',
'overflow',
'placement',
'triggerA11yLabel',
'triggerClass',
'triggerColor',
'triggerIcon',
'triggerIconOnly',
'triggerLabel',
'triggerNativeAttributes',
'triggerSize',
'triggerTestId',
'triggerVariant'
],
outputs: ['catOpen', 'catClose', 'catTriggerClick'],
standalone: false
})
export class CatMenu {
protected el: HTMLCatMenuElement;
@Output() catOpen = new EventEmitter<CustomEvent<FocusEvent>>();
@Output() catClose = new EventEmitter<CustomEvent<FocusEvent>>();
@Output() catTriggerClick = new EventEmitter<CustomEvent<MouseEvent>>();
constructor(
c: ChangeDetectorRef,
r: ElementRef,
protected z: NgZone
) {
c.detach();
this.el = r.nativeElement;
}
}

export declare interface CatMenu extends Components.CatMenu {
/**
* Emitted when the dropdown is opened.
*/
catOpen: EventEmitter<CustomEvent<FocusEvent>>;
/**
* Emitted when the dropdown is closed.
*/
catClose: EventEmitter<CustomEvent<FocusEvent>>;
/**
* Emitted when the trigger button is clicked.
*/
catTriggerClick: EventEmitter<CustomEvent<MouseEvent>>;
}

@ProxyCmp({
inputs: [
'active',
'color',
'disabled',
'icon',
'iconOnly',
'iconRight',
'identifier',
'loading',
'nativeAttributes',
'testId',
'url',
'urlTarget',
'variant'
],
methods: ['doFocus', 'doBlur']
})
@Component({
selector: 'cat-menu-item',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: [
'active',
'color',
'disabled',
'icon',
'iconOnly',
'iconRight',
'identifier',
'loading',
'nativeAttributes',
'testId',
'url',
'urlTarget',
'variant'
],
outputs: ['catClick'],
standalone: false
})
export class CatMenuItem {
protected el: HTMLCatMenuItemElement;
@Output() catClick = new EventEmitter<CustomEvent<MouseEvent>>();
constructor(
c: ChangeDetectorRef,
r: ElementRef,
protected z: NgZone
) {
c.detach();
this.el = r.nativeElement;
}
}

export declare interface CatMenuItem extends Components.CatMenuItem {
/**
* Emitted when the trigger button is clicked.
*/
catClick: EventEmitter<CustomEvent<MouseEvent>>;
}

@ProxyCmp({
inputs: [
'activePadding',
Expand Down
Loading
Loading