Skip to content

Commit

Permalink
Refactor #5784, #5785
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed May 27, 2024
1 parent a3292d5 commit 543b69e
Show file tree
Hide file tree
Showing 24 changed files with 59 additions and 59 deletions.
4 changes: 2 additions & 2 deletions api-generator/components/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const CalendarProps = [
description: 'Icon of the calendar button.'
},
{
name: 'previousIcon',
name: 'prevIcon',
type: 'string',
default: 'null',
description: 'Icon to show in the previous button.'
Expand Down Expand Up @@ -484,7 +484,7 @@ const CalendarSlots = [
description: 'Custom dropdown icon template.'
},
{
name: 'previousicon',
name: 'prevIcon',
description: 'Custom previous icon template.'
},
{
Expand Down
2 changes: 1 addition & 1 deletion api-generator/components/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const CarouselSlots = [
description: 'Custom content for the component item.'
},
{
name: 'previousicon',
name: 'previcon',
description: 'Custom previous icon template.'
},
{
Expand Down
4 changes: 2 additions & 2 deletions api-generator/components/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const DatePickerProps = [
description: 'Icon of the calendar button.'
},
{
name: 'previousIcon',
name: 'previcon',
type: 'string',
default: 'null',
description: 'Icon to show in the previous button.'
Expand Down Expand Up @@ -484,7 +484,7 @@ const DatePickerSlots = [
description: 'Custom dropdown icon template.'
},
{
name: 'previousicon',
name: 'previcon',
description: 'Custom previous icon template.'
},
{
Expand Down
2 changes: 1 addition & 1 deletion api-generator/components/tabview.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const TabViewProps = [
description: 'When enabled, the focused tab is activated.'
},
{
name: 'previousButtonProps',
name: 'prevButtonProps',
type: 'any',
default: 'null',
description: 'Used to pass all properties of the HTMLButtonElement to the previous button.'
Expand Down
2 changes: 1 addition & 1 deletion components/lib/carousel/Carousel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export interface CarouselPassThroughOptions {
* Used to pass attributes to the previous button's DOM element.
* @see {@link ButtonPassThroughOptions}
*/
pcPreviousButton?: ButtonPassThroughOptions<CarouselSharedPassThroughMethodOptions>;
pcPrevButton?: ButtonPassThroughOptions<CarouselSharedPassThroughMethodOptions>;
/**
* Used to pass attributes to the viewport's DOM element.
*/
Expand Down
10 changes: 5 additions & 5 deletions components/lib/carousel/Carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<div :class="[cx('content'), contentClass]" :aria-live="allowAutoplay ? 'polite' : 'off'" v-bind="ptm('content')">
<Button
v-if="showNavigators"
:class="cx('pcPreviousButton')"
:class="cx('pcPrevButton')"
:disabled="backwardIsDisabled"
:aria-label="ariaPrevButtonLabel"
:unstyled="unstyled"
@click="navBackward"
v-bind="prevButtonProps"
:pt="ptm('pcPreviousButton')"
:pt="ptm('pcPrevButton')"
data-pc-group-section="navigator"
>
<template #icon="slotProps">
<slot name="previousicon">
<component :is="isVertical() ? 'ChevronUpIcon' : 'ChevronLeftIcon'" :class="[cx('previousButtonIcon'), slotProps.icon]" v-bind="ptm('pcPreviousButton')['icon']" />
<slot name="previcon">
<component :is="isVertical() ? 'ChevronUpIcon' : 'ChevronLeftIcon'" :class="slotProps.icon" v-bind="ptm('pcPrevButton')['icon']" />
</slot>
</template>
</Button>
Expand Down Expand Up @@ -72,7 +72,7 @@
>
<template #icon="slotProps">
<slot name="nexticon">
<component :is="isVertical() ? 'ChevronDownIcon' : 'ChevronRightIcon'" :class="[cx('nextButtonIcon'), slotProps.class]" v-bind="ptm('pcNextButton')['icon']" />
<component :is="isVertical() ? 'ChevronDownIcon' : 'ChevronRightIcon'" :class="slotProps.class" v-bind="ptm('pcNextButton')['icon']" />
</slot>
</template>
</Button>
Expand Down
2 changes: 1 addition & 1 deletion components/lib/carousel/style/CarouselStyle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export enum CarouselClasses {
/**
* Class name of the previous button element
*/
pcPreviousButton = 'p-carousel-prev-button',
pcPrevButton = 'p-carousel-prev-button',
/**
* Class name of the viewport element
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/carousel/style/CarouselStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const classes = {
header: 'p-carousel-header',
contentContainer: 'p-carousel-content-container',
content: 'p-carousel-content',
pcPreviousButton: ({ instance }) => [
pcPrevButton: ({ instance }) => [
'p-carousel-prev-button',
{
'p-disabled': instance.backwardIsDisabled
Expand Down
2 changes: 1 addition & 1 deletion components/lib/datepicker/BaseDatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
type: String,
default: undefined
},
previousIcon: {
prevIcon: {
type: String,
default: undefined
},
Expand Down
8 changes: 4 additions & 4 deletions components/lib/datepicker/DatePicker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export interface DatePickerPassThroughOptions {
* Used to pass attributes to the previous button's DOM element.
* @see {@link ButtonPassThroughOptions}
*/
pcPreviousButton?: ButtonPassThroughOptions<DatePickerSharedPassThroughMethodOptions>;
pcPrevButton?: ButtonPassThroughOptions<DatePickerSharedPassThroughMethodOptions>;
/**
* Used to pass attributes to the title's DOM element.
*/
Expand Down Expand Up @@ -570,9 +570,9 @@ export interface DatePickerProps {
icon?: string | undefined;
/**
* Icon to show in the previous button.
* @deprecated since v3.27.0. Use 'previousicon' slot.
* @deprecated since v3.27.0. Use 'previcon' slot.
*/
previousIcon?: string | undefined;
prevIcon?: string | undefined;
/**
* Icon to show in the next button.
* @deprecated since v3.27.0. Use 'nexticon' slot.
Expand Down Expand Up @@ -937,7 +937,7 @@ export interface DatePickerSlots {
* Custom previous icon template.
* @param {Object} scope - previous icon slot's params.
*/
previousicon(scope: {
previcon(scope: {
/**
* Style class of the previous icon
*/
Expand Down
8 changes: 4 additions & 4 deletions components/lib/datepicker/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@
<Button
v-show="showOtherMonths ? groupIndex === 0 : false"
:ref="previousButtonRef"
:class="cx('pcPreviousButton')"
:class="cx('pcPrevButton')"
:disabled="disabled"
:aria-label="currentView === 'year' ? $primevue.config.locale.prevDecade : currentView === 'month' ? $primevue.config.locale.prevYear : $primevue.config.locale.prevMonth"
:unstyled="unstyled"
@click="onPrevButtonClick"
@keydown="onContainerButtonKeydown"
v-bind="navigatorButtonProps"
:pt="ptm('pcPreviousButton')"
:pt="ptm('pcPrevButton')"
data-pc-group-section="navigator"
>
<template #icon="slotProps">
<slot name="previousicon">
<component :is="previousIcon ? 'span' : 'ChevronLeftIcon'" :class="[previousIcon, slotProps.class]" v-bind="ptm('pcPreviousButton')['icon']" />
<slot name="previcon">
<component :is="prevIcon ? 'span' : 'ChevronLeftIcon'" :class="[prevIcon, slotProps.class]" v-bind="ptm('pcPrevButton')['icon']" />
</slot>
</template>
</Button>
Expand Down
2 changes: 1 addition & 1 deletion components/lib/datepicker/style/DatePickerStyle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export enum DatePickerClasses {
/**
* Class name of the previous button element
*/
pcPreviousButton = 'p-datepicker-prev-button',
pcPrevButton = 'p-datepicker-prev-button',
/**
* Class name of the title element
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/datepicker/style/DatePickerStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ const classes = {
calendarContainer: 'p-datepicker-calendar-container',
calendar: 'p-datepicker-calendar',
header: 'p-datepicker-header',
pcPreviousButton: 'p-datepicker-prev-button',
pcPrevButton: 'p-datepicker-prev-button',
title: 'p-datepicker-title',
viewMonth: 'p-datepicker-view-month',
viewYear: 'p-datepicker-view-year',
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tablist/TabList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface TabListPassThroughOptions {
/**
* Used to pass attributes to the previous button component.
*/
previousButton?: TabListPassThroughOptionType;
prevButton?: TabListPassThroughOptionType;
/**
* Used to pass attributes to the next button component.
*/
Expand Down
6 changes: 3 additions & 3 deletions components/lib/tablist/TabList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
v-if="showNavigators && isPrevButtonEnabled"
ref="prevButton"
v-ripple
:class="cx('previousButton')"
:class="cx('prevButton')"
:aria-label="prevButtonAriaLabel"
:tabindex="$pcTabs.tabindex"
@click="onPrevButtonClick"
v-bind="ptm('previousButton')"
v-bind="ptm('prevButton')"
data-pc-group-section="navigator"
>
<component :is="templates.previousicon || 'ChevronLeftIcon'" aria-hidden="true" v-bind="ptm('previousIcon')" />
<component :is="templates.previcon || 'ChevronLeftIcon'" aria-hidden="true" v-bind="ptm('prevIcon')" />
</button>
<div ref="content" :class="cx('content')" @scroll="onScroll" v-bind="ptm('content')">
<div ref="tabs" :class="cx('tabs')" role="tablist" :aria-orientation="$pcTabs.orientation || 'horizontal'" v-bind="ptm('tabs')">
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tablist/style/TabListStyle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export enum TabListClasses {
/**
* Class name of the previous button element
*/
previousButton = 'p-tablist-prev-button',
prevButton = 'p-tablist-prev-button',
/**
* Class name of the next button element
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tablist/style/TabListStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const classes = {
],
tabs: 'p-tablist-tab-list',
inkbar: 'p-tablist-active-bar',
previousButton: 'p-tablist-prev-button p-tablist-nav-button',
prevButton: 'p-tablist-prev-button p-tablist-nav-button',
nextButton: 'p-tablist-next-button p-tablist-nav-button'
};

Expand Down
2 changes: 1 addition & 1 deletion components/lib/tabs/Tabs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export interface TabsSlots {
/**
* Previous button icon template for the scrollable component.
*/
previousicon(): VNode[];
previcon(): VNode[];
/**
* Next button icon template for the scrollable component.
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tabview/BaseTabView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default {
type: Boolean,
default: false
},
previousButtonProps: {
prevButtonProps: {
type: null,
default: null
},
Expand Down
10 changes: 5 additions & 5 deletions components/lib/tabview/TabView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ export interface TabViewPassThroughOptions {
/**
* Used to pass attributes to the previous button's DOM element.
*/
previousButton?: TabViewPassThroughOptionType;
prevButton?: TabViewPassThroughOptionType;
/**
* Used to pass attributes to the previous button icon's DOM element.
*/
previousIcon?: TabViewPassThroughOptionType;
prevIcon?: TabViewPassThroughOptionType;
/**
* Used to pass attributes to the next button's DOM element.
*/
Expand Down Expand Up @@ -193,15 +193,15 @@ export interface TabViewProps {
* Used to pass all properties of the HTMLButtonElement to the previous button.
* @deprecated since v3.26.0. Use 'pt' property instead.
*/
previousButtonProps?: ButtonHTMLAttributes | undefined;
prevButtonProps?: ButtonHTMLAttributes | undefined;
/**
* Used to pass all properties of the HTMLButtonElement to the next button.
* @deprecated since v3.26.0. Use 'pt' property instead.
*/
nextButtonProps?: ButtonHTMLAttributes | undefined;
/**
* Previous icon of the scrollable tabview.
* @deprecated since v3.27.0. Use 'previousicon' slot.
* @deprecated since v3.27.0. Use 'previcon' slot.
*/
prevIcon?: string | undefined;
/**
Expand Down Expand Up @@ -241,7 +241,7 @@ export interface TabViewSlots {
/**
* Previous button icon template for the scrollable component.
*/
previousicon(): VNode[];
previcon(): VNode[];
/**
* Next button icon template for the scrollable component.
*/
Expand Down
8 changes: 4 additions & 4 deletions components/lib/tabview/TabView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
ref="prevBtn"
v-ripple
type="button"
:class="cx('previousButton')"
:class="cx('prevButton')"
:tabindex="tabindex"
:aria-label="prevButtonAriaLabel"
@click="onPrevButtonClick"
v-bind="{ ...previousButtonProps, ...ptm('previousButton') }"
v-bind="{ ...prevButtonProps, ...ptm('prevButton') }"
data-pc-group-section="navbutton"
>
<slot name="previousicon">
<component :is="prevIcon ? 'span' : 'ChevronLeftIcon'" aria-hidden="true" :class="prevIcon" v-bind="ptm('previousIcon')" />
<slot name="previcon">
<component :is="prevIcon ? 'span' : 'ChevronLeftIcon'" aria-hidden="true" :class="prevIcon" v-bind="ptm('prevIcon')" />
</slot>
</button>
<div ref="content" :class="cx('navContent')" @scroll="onScroll" v-bind="ptm('navContent')">
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tabview/style/TabViewStyle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export enum TabViewClasses {
/**
* Class name of the previous button element
*/
previousButton = 'p-tabview-prev-button',
prevButton = 'p-tabview-prev-button',
/**
* Class name of the nav content element
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tabview/style/TabViewStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const classes = {
}
],
navContainer: 'p-tabview-tablist-container',
previousButton: 'p-tabview-prev-button',
prevButton: 'p-tabview-prev-button',
navContent: 'p-tabview-tablist-scroll-container',
nav: 'p-tabview-tablist',
tab: {
Expand Down
Loading

0 comments on commit 543b69e

Please sign in to comment.