Skip to content

Commit

Permalink
Fix #4438
Browse files Browse the repository at this point in the history
Refactor #4391 - For BreadCrumb
  • Loading branch information
ulasturann committed May 23, 2023
1 parent f8aaad7 commit 936f964
Show file tree
Hide file tree
Showing 52 changed files with 366 additions and 339 deletions.
7 changes: 7 additions & 0 deletions components/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3607,6 +3607,13 @@
"type": "BreadCrumbPassThroughType<HTMLAttributes<HTMLSpanElement>>",
"description": "Uses to pass attributes to the label's DOM element."
},
{
"name": "separator",
"optional": true,
"readonly": false,
"type": "BreadCrumbPassThroughType<HTMLAttributes<HTMLLIElement>>",
"description": "Uses to pass attributes to the separator's DOM element."
},
{
"name": "separatorIcon",
"optional": true,
Expand Down
5 changes: 5 additions & 0 deletions components/lib/breadcrumb/BreadCrumb.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
align-items: center;
}

.p-breadcrumb .p-menuitem-separator {
display: flex;
align-items: center;
}

.p-breadcrumb::-webkit-scrollbar {
display: none;
}
17 changes: 14 additions & 3 deletions components/lib/breadcrumb/BreadCrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,22 @@ export const BreadCrumb = React.memo(
);
const icon = props.separatorIcon || <ChevronRightIcon {...separatorIconProps} />;
const separatorIcon = IconUtils.getJSXIcon(icon, { ...separatorIconProps }, { props });
const separatorProps = mergeProps(
{
className: 'p-menuitem-separator'
},
ptm('separator')
);

return separatorIcon;
return <li {...separatorProps}>{separatorIcon}</li>;
};

const createMenuitem = (item) => {
if (item.visible === false) {
return null;
}

const className = classNames(item.className, { 'p-disabled': item.disabled });
const className = classNames('p-menuitem', item.className, { 'p-disabled': item.disabled });
const labelProps = mergeProps(
{
className: 'p-menuitem-text'
Expand Down Expand Up @@ -182,7 +188,12 @@ export const BreadCrumb = React.memo(
const home = createHome();
const items = createMenuitems();
const separator = createSeparator();
const menuProps = mergeProps(ptm('menu'));
const menuProps = mergeProps(
{
className: 'p-breadcrumb-list'
},
ptm('menu')
);
const rootProps = mergeProps(
{
id: props.id,
Expand Down
4 changes: 4 additions & 0 deletions components/lib/breadcrumb/breadcrumb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export interface BreadCrumbPassThroughOptions {
* Uses to pass attributes to the label's DOM element.
*/
label?: BreadCrumbPassThroughType<React.HTMLAttributes<HTMLSpanElement>>;
/**
* Uses to pass attributes to the separator's DOM element.
*/
separator?: BreadCrumbPassThroughType<React.HTMLAttributes<HTMLLIElement>>;
/**
* Uses to pass attributes to the separator icon's DOM element.
*/
Expand Down
14 changes: 7 additions & 7 deletions public/themes/arya-blue/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -4527,29 +4527,29 @@
border-radius: 3px;
padding: 1rem;
}
.p-breadcrumb ul li .p-menuitem-link {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link {
transition: box-shadow 0.2s;
border-radius: 3px;
}
.p-breadcrumb ul li .p-menuitem-link:focus {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link:focus {
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 1px #93cbf9;
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-text {
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-icon {
color: rgba(255, 255, 255, 0.6);
}
.p-breadcrumb ul li.p-breadcrumb-chevron {
.p-breadcrumb .p-breadcrumb-list li.p-menuitem-separator {
margin: 0 0.5rem 0 0.5rem;
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-text {
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-icon {
color: rgba(255, 255, 255, 0.6);
}

Expand Down
14 changes: 7 additions & 7 deletions public/themes/arya-green/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -4527,29 +4527,29 @@
border-radius: 3px;
padding: 1rem;
}
.p-breadcrumb ul li .p-menuitem-link {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link {
transition: box-shadow 0.2s;
border-radius: 3px;
}
.p-breadcrumb ul li .p-menuitem-link:focus {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link:focus {
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 1px #a7d8a9;
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-text {
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-icon {
color: rgba(255, 255, 255, 0.6);
}
.p-breadcrumb ul li.p-breadcrumb-chevron {
.p-breadcrumb .p-breadcrumb-list li.p-menuitem-separator {
margin: 0 0.5rem 0 0.5rem;
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-text {
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-icon {
color: rgba(255, 255, 255, 0.6);
}

Expand Down
14 changes: 7 additions & 7 deletions public/themes/arya-orange/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -4527,29 +4527,29 @@
border-radius: 3px;
padding: 1rem;
}
.p-breadcrumb ul li .p-menuitem-link {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link {
transition: box-shadow 0.2s;
border-radius: 3px;
}
.p-breadcrumb ul li .p-menuitem-link:focus {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link:focus {
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 1px #ffe284;
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-text {
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-icon {
color: rgba(255, 255, 255, 0.6);
}
.p-breadcrumb ul li.p-breadcrumb-chevron {
.p-breadcrumb .p-breadcrumb-list li.p-menuitem-separator {
margin: 0 0.5rem 0 0.5rem;
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-text {
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-icon {
color: rgba(255, 255, 255, 0.6);
}

Expand Down
14 changes: 7 additions & 7 deletions public/themes/arya-purple/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -4527,29 +4527,29 @@
border-radius: 3px;
padding: 1rem;
}
.p-breadcrumb ul li .p-menuitem-link {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link {
transition: box-shadow 0.2s;
border-radius: 3px;
}
.p-breadcrumb ul li .p-menuitem-link:focus {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link:focus {
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 1px #cf95d9;
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-text {
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-icon {
color: rgba(255, 255, 255, 0.6);
}
.p-breadcrumb ul li.p-breadcrumb-chevron {
.p-breadcrumb .p-breadcrumb-list li.p-menuitem-separator {
margin: 0 0.5rem 0 0.5rem;
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-text {
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-icon {
color: rgba(255, 255, 255, 0.6);
}

Expand Down
14 changes: 7 additions & 7 deletions public/themes/bootstrap4-dark-blue/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -4539,29 +4539,29 @@
border-radius: 4px;
padding: 1rem;
}
.p-breadcrumb ul li .p-menuitem-link {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link {
transition: box-shadow 0.15s;
border-radius: 4px;
}
.p-breadcrumb ul li .p-menuitem-link:focus {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link:focus {
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 1px #e3f3fe;
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-text {
color: #8dd0ff;
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-icon {
color: #8dd0ff;
}
.p-breadcrumb ul li.p-breadcrumb-chevron {
.p-breadcrumb .p-breadcrumb-list li.p-menuitem-separator {
margin: 0 0.5rem 0 0.5rem;
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-text {
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-icon {
color: rgba(255, 255, 255, 0.87);
}

Expand Down
14 changes: 7 additions & 7 deletions public/themes/bootstrap4-dark-purple/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -4539,29 +4539,29 @@
border-radius: 4px;
padding: 1rem;
}
.p-breadcrumb ul li .p-menuitem-link {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link {
transition: box-shadow 0.15s;
border-radius: 4px;
}
.p-breadcrumb ul li .p-menuitem-link:focus {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link:focus {
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 1px #f0e6f5;
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-text {
color: #c298d8;
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-icon {
color: #c298d8;
}
.p-breadcrumb ul li.p-breadcrumb-chevron {
.p-breadcrumb .p-breadcrumb-list li.p-menuitem-separator {
margin: 0 0.5rem 0 0.5rem;
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-text {
color: rgba(255, 255, 255, 0.87);
}
.p-breadcrumb ul li:last-child .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-icon {
color: rgba(255, 255, 255, 0.87);
}

Expand Down
14 changes: 7 additions & 7 deletions public/themes/bootstrap4-light-blue/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -4539,29 +4539,29 @@
border-radius: 4px;
padding: 1rem;
}
.p-breadcrumb ul li .p-menuitem-link {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link {
transition: box-shadow 0.15s;
border-radius: 4px;
}
.p-breadcrumb ul li .p-menuitem-link:focus {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link:focus {
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-text {
color: #007bff;
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-icon {
color: #007bff;
}
.p-breadcrumb ul li.p-breadcrumb-chevron {
.p-breadcrumb .p-breadcrumb-list li.p-menuitem-separator {
margin: 0 0.5rem 0 0.5rem;
color: #6c757d;
}
.p-breadcrumb ul li:last-child .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-text {
color: #6c757d;
}
.p-breadcrumb ul li:last-child .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-icon {
color: #6c757d;
}

Expand Down
14 changes: 7 additions & 7 deletions public/themes/bootstrap4-light-purple/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -4539,29 +4539,29 @@
border-radius: 4px;
padding: 1rem;
}
.p-breadcrumb ul li .p-menuitem-link {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link {
transition: box-shadow 0.15s;
border-radius: 4px;
}
.p-breadcrumb ul li .p-menuitem-link:focus {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link:focus {
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 0.2rem rgba(136, 60, 174, 0.5);
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-text {
color: #883cae;
}
.p-breadcrumb ul li .p-menuitem-link .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li .p-menuitem-link .p-menuitem-icon {
color: #883cae;
}
.p-breadcrumb ul li.p-breadcrumb-chevron {
.p-breadcrumb .p-breadcrumb-list li.p-menuitem-separator {
margin: 0 0.5rem 0 0.5rem;
color: #6c757d;
}
.p-breadcrumb ul li:last-child .p-menuitem-text {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-text {
color: #6c757d;
}
.p-breadcrumb ul li:last-child .p-menuitem-icon {
.p-breadcrumb .p-breadcrumb-list li:last-child .p-menuitem-icon {
color: #6c757d;
}

Expand Down
Loading

0 comments on commit 936f964

Please sign in to comment.