Skip to content

Commit

Permalink
add tooltip option for main button of SplitButtonModule
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinan997 committed May 17, 2024
1 parent b55baa8 commit f20b33d
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/app/components/splitbutton/splitbutton.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, ContentChildren, ElementRef, EventEmitter, Input, NgModule, Output, QueryList, TemplateRef, ViewChild, ViewEncapsulation, booleanAttribute, numberAttribute, signal } from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
ContentChildren,
ElementRef,
EventEmitter,
Input,
NgModule,
Output,
QueryList,
TemplateRef,
ViewChild,
ViewEncapsulation,
booleanAttribute,
numberAttribute,
signal
} from '@angular/core';
import { MenuItem, PrimeTemplate } from 'primeng/api';
import { ButtonModule } from 'primeng/button';
import { ChevronDownIcon } from 'primeng/icons/chevrondown';
Expand Down Expand Up @@ -35,6 +51,7 @@ type SplitButtonIconPosition = 'left' | 'right';
[ariaLabel]="buttonProps?.['ariaLabel'] || label"
pAutoFocus
[autofocus]="autofocus"
[pTooltip]="tooltip"
>
<ng-container *ngTemplateOutlet="contentTemplate"></ng-container>
</button>
Expand All @@ -58,6 +75,7 @@ type SplitButtonIconPosition = 'left' | 'right';
[ariaLabel]="buttonProps?.['ariaLabel']"
pAutoFocus
[autofocus]="autofocus"
[pTooltip]="tooltip"
></button>
</ng-template>
<button
Expand Down Expand Up @@ -155,6 +173,11 @@ export class SplitButton {
* @group Props
*/
@Input() label: string | undefined;
/**
* Tooltip for the main button.
* @group Props
*/
@Input() tooltip: string | undefined;
/**
* Inline style of the element.
* @group Props
Expand Down

0 comments on commit f20b33d

Please sign in to comment.