Skip to content

Commit

Permalink
Menu Section - classnames not being set in unstyled mode #6329
Browse files Browse the repository at this point in the history
  • Loading branch information
gucal committed Apr 9, 2024
1 parent f5207ba commit 0909626
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 26 deletions.
4 changes: 2 additions & 2 deletions components/lib/breadcrumb/BreadCrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PrimeReactContext } from '../api/Api';
import { useHandleStyle } from '../componentbase/ComponentBase';
import { useMergeProps, useMountEffect } from '../hooks/Hooks';
import { ChevronRightIcon } from '../icons/chevronright';
import { IconUtils, ObjectUtils, UniqueComponentId } from '../utils/Utils';
import { IconUtils, ObjectUtils, UniqueComponentId, classNames } from '../utils/Utils';
import { BreadCrumbBase } from './BreadCrumbBase';

export const BreadCrumb = React.memo(
Expand Down Expand Up @@ -243,7 +243,7 @@ export const BreadCrumb = React.memo(
{
id: props.id,
ref: elementRef,
className: cx('root'),
className: classNames(props.className, cx('root')),
style: props.style
},
BreadCrumbBase.getOtherProps(props),
Expand Down
2 changes: 1 addition & 1 deletion components/lib/breadcrumb/BreadCrumbBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const classes = {
separator: 'p-menuitem-separator',
menuitem: ({ item }) => classNames('p-menuitem', item.className, { 'p-disabled': item.disabled }),
menu: 'p-breadcrumb-list',
root: ({ props }) => classNames('p-breadcrumb p-component', props.className)
root: 'p-breadcrumb p-component'
};

const styles = `
Expand Down
2 changes: 1 addition & 1 deletion components/lib/panelmenu/PanelMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export const PanelMenu = React.memo(
const rootProps = mergeProps(
{
ref: elementRef,
className: cx('root'),
className: classNames(props.className, cx('root')),
id: props.id,
style: props.style
},
Expand Down
2 changes: 1 addition & 1 deletion components/lib/panelmenu/PanelMenuBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const classes = {
header: ({ active, item }) => classNames('p-component p-panelmenu-header', { 'p-highlight': active && !!item.items, 'p-disabled': item.disabled }),
headerContent: 'p-panelmenu-header-content',
menuContent: 'p-panelmenu-content',
root: ({ props }) => classNames('p-panelmenu p-component', props.className),
root: 'p-panelmenu p-component',
separator: 'p-menuitem-separator',
toggleableContent: ({ active }) =>
classNames('p-toggleable-content', {
Expand Down
2 changes: 1 addition & 1 deletion components/lib/steps/Steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export const Steps = React.memo(
{
id: props.id,
ref: elementRef,
className: cx('root'),
className: classNames(props.className, cx('root')),
style: props.style
},
StepsBase.getOtherProps(props),
Expand Down
10 changes: 3 additions & 7 deletions components/lib/steps/StepsBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ const classes = {
'p-disabled': disabled
}),
root: ({ props }) =>
classNames(
'p-steps p-component',
{
'p-readonly': props.readOnly
},
props.className
)
classNames('p-steps p-component', {
'p-readonly': props.readOnly
})
};

const styles = `
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tabmenu/TabMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export const TabMenu = React.memo(
{
id: props.id,
ref: elementRef,
className: cx('root'),
className: classNames(props.className, cx('root')),
style: props.style
},
TabMenuBase.getOtherProps(props),
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tabmenu/TabMenuBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const classes = {
),
inkbar: 'p-tabmenu-ink-bar',
menu: 'p-tabmenu-nav p-reset',
root: ({ props }) => classNames('p-tabmenu p-component', props.className)
root: 'p-tabmenu p-component'
};

const styles = `
Expand Down
4 changes: 2 additions & 2 deletions components/lib/tieredmenu/TieredMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CSSTransition } from '../csstransition/CSSTransition';
import { useEventListener, useMatchMedia, useMergeProps, useMountEffect, useResizeListener, useUnmountEffect, useUpdateEffect } from '../hooks/Hooks';
import { OverlayService } from '../overlayservice/OverlayService';
import { Portal } from '../portal/Portal';
import { DomHandler, ObjectUtils, UniqueComponentId, ZIndexUtils } from '../utils/Utils';
import { DomHandler, ObjectUtils, UniqueComponentId, ZIndexUtils, classNames } from '../utils/Utils';
import { TieredMenuBase } from './TieredMenuBase';
import { TieredMenuSub } from './TieredMenuSub';

Expand Down Expand Up @@ -682,7 +682,7 @@ export const TieredMenu = React.memo(
{
ref: containerRef,
id: props.id,
className: cx('root'),
className: classNames(props.className, cx('root')),
style: props.style,
onClick: onPanelClick
},
Expand Down
14 changes: 5 additions & 9 deletions components/lib/tieredmenu/TieredMenuBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ import { classNames } from '../utils/Utils';

const classes = {
root: ({ props, context }) =>
classNames(
'p-tieredmenu p-component',
{
'p-tieredmenu-overlay': props.popup,
'p-input-filled': (context && context.inputStyle === 'filled') || PrimeReact.inputStyle === 'filled',
'p-ripple-disabled': (context && context.ripple === false) || PrimeReact.ripple === false
},
props.className
),
classNames('p-tieredmenu p-component', {
'p-tieredmenu-overlay': props.popup,
'p-input-filled': (context && context.inputStyle === 'filled') || PrimeReact.inputStyle === 'filled',
'p-ripple-disabled': (context && context.ripple === false) || PrimeReact.ripple === false
}),
separator: 'p-menuitem-separator',
icon: ({ _icon }) => classNames('p-menuitem-icon', _icon),
content: 'p-menuitem-content',
Expand Down

0 comments on commit 0909626

Please sign in to comment.