-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AB#31040
- Loading branch information
Showing
5 changed files
with
79 additions
and
28 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
interfaces/Portalicious/src/app/components/button-menu/button-menu.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<p-button | ||
(click)="menu.toggle($event)" | ||
[label]="label()" | ||
[icon]="menuOpen() ? 'pi pi-chevron-up' : 'pi pi-chevron-down'" | ||
iconPos="right" | ||
rounded | ||
[outlined]="outlined()" | ||
[plain]="plain()" | ||
[text]="text()" | ||
[size]="size()" | ||
> | ||
<ng-template pTemplate> | ||
<span class="inline-flex items-center gap-2"> | ||
@if (icon()) { | ||
<span [class]="'p-button-icon ' + icon()"></span> | ||
} | ||
<span class="p-button-label">{{ label() }}</span> | ||
</span> | ||
</ng-template> | ||
</p-button> | ||
<p-menu | ||
#menu | ||
[model]="menuItems()" | ||
[popup]="true" | ||
styleClass="w-auto [&_.p-menuitem-text]:whitespace-nowrap" | ||
(onShow)="menuOpen.set(true)" | ||
(onHide)="menuOpen.set(false)" | ||
> | ||
<ng-template pTemplate="start"> | ||
<ng-content select="[menu-start]"></ng-content> | ||
</ng-template> | ||
</p-menu> |
30 changes: 30 additions & 0 deletions
30
interfaces/Portalicious/src/app/components/button-menu/button-menu.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
input, | ||
model, | ||
} from '@angular/core'; | ||
|
||
import { MenuItem } from 'primeng/api'; | ||
import { ButtonModule } from 'primeng/button'; | ||
import { MenuModule } from 'primeng/menu'; | ||
|
||
@Component({ | ||
selector: 'app-button-menu', | ||
standalone: true, | ||
imports: [ButtonModule, MenuModule], | ||
templateUrl: './button-menu.component.html', | ||
styles: ``, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class ButtonMenuComponent { | ||
label = input.required<string>(); | ||
menuItems = input.required<MenuItem[]>(); | ||
icon = input<string>(); | ||
outlined = input<boolean>(false); | ||
plain = input<boolean>(false); | ||
text = input<boolean>(false); | ||
size = input<'large' | 'small'>(); | ||
|
||
menuOpen = model(false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters