Skip to content

Commit

Permalink
Refactor #3889 - button updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed May 2, 2023
1 parent 4fe92f0 commit 21ab0ad
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
8 changes: 3 additions & 5 deletions components/lib/speeddial/SpeedDial.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
*/
import { VNode } from 'vue';
import { ButtonPassThroughOptions } from '../button';
import { MenuItem } from '../menuitem';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';

Expand All @@ -33,12 +34,9 @@ export interface SpeedDialPassThroughOptions {
root?: SpeedDialPassThroughOptionType;
/**
* Uses to pass attributes to the button's DOM element.
* @see {@link ButtonPassThroughOptions}
*/
button?: SpeedDialPassThroughOptionType;
/**
* Uses to pass attributes to the icon's DOM element.
*/
icon?: SpeedDialPassThroughOptionType;
button?: ButtonPassThroughOptions;
/**
* Uses to pass attributes to the menu's DOM element.
*/
Expand Down
6 changes: 3 additions & 3 deletions components/lib/speeddial/SpeedDial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
:aria-controls="id + '_list'"
:aria-label="ariaLabel"
:aria-labelledby="ariaLabelledby"
v-bind="ptm('button')"
:pt="ptm('button')"
>
<template #icon>
<slot name="icon" :visible="d_visible">
<component v-if="d_visible && !!hideIcon" :is="hideIcon ? 'span' : 'PlusIcon'" :class="hideIcon" v-bind="ptm('icon')" />
<component v-else :is="showIcon ? 'span' : 'PlusIcon'" :class="showIcon" v-bind="ptm('icon')" />
<component v-if="d_visible && !!hideIcon" :is="hideIcon ? 'span' : 'PlusIcon'" :class="hideIcon" v-bind="ptm('button')['icon']" />
<component v-else :is="showIcon ? 'span' : 'PlusIcon'" :class="showIcon" v-bind="ptm('button')['icon']" />
</slot>
</template>
</SDButton>
Expand Down
8 changes: 3 additions & 5 deletions components/lib/splitbutton/SplitButton.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
*/
import { ButtonHTMLAttributes, VNode } from 'vue';
import { ButtonPassThroughOptions } from '../button';
import { MenuItem } from '../menuitem';
import { TieredMenuPassThroughOptions } from '../tieredmenu';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
Expand Down Expand Up @@ -41,12 +42,9 @@ export interface SplitButtonPassThroughOptions {
icon?: SplitButtonPassThroughOptionType;
/**
* Uses to pass attributes to the menu button's DOM element.
* @see {@link ButtonPassThroughOptions}
*/
menuButton?: SplitButtonPassThroughOptionType;
/**
* Uses to pass attributes to the menu button icon's DOM element.
*/
menuButtonIcon?: SplitButtonPassThroughOptionType;
menuButton?: ButtonPassThroughOptions;
/**
* Uses to pass attributes to the menu's DOM element.
* @see {@link TieredMenuPassThroughOptions}
Expand Down
5 changes: 3 additions & 2 deletions components/lib/splitbutton/SplitButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
:aria-controls="ariaId + '_overlay'"
@click="onDropdownButtonClick"
@keydown="onDropdownKeydown"
v-bind="{ ...menuButtonProps, ...ptm('menuButton') }"
:pt="ptm('menuButton')"
v-bind="menuButtonProps"
>
<template #icon="slotProps">
<slot name="menubuttonicon">
<component :is="menuButtonIcon ? 'span' : 'ChevronDownIcon'" :class="[menuButtonIcon, slotProps.class]" v-bind="ptm('menuButtonIcon')" />
<component :is="menuButtonIcon ? 'span' : 'ChevronDownIcon'" :class="[menuButtonIcon, slotProps.class]" v-bind="ptm('menuButton')['icon']" />
</slot>
</template>
</PVSButton>
Expand Down

0 comments on commit 21ab0ad

Please sign in to comment.