From 857fa6b1e768769a0ac049337f8e1ede6c8c1f3e Mon Sep 17 00:00:00 2001 From: Melloware Date: Fri, 1 Jul 2022 12:30:41 -0400 Subject: [PATCH] Fix #2808: MegaMenu start and end template attributes (#2809) * Fix #2808: MegaMenu start and end template attributes * Fix #2808: MegaMenu start and end template attributes --- api-generator/components/megamenu.js | 12 ++++++ components/doc/megamenu/index.js | 57 ++++++++++++++++++++++++--- components/lib/megamenu/MegaMenu.css | 6 +++ components/lib/megamenu/MegaMenu.d.ts | 7 ++++ components/lib/megamenu/MegaMenu.js | 36 +++++++++++++---- components/lib/menubar/Menubar.js | 12 ------ pages/megamenu/index.js | 13 +++++- 7 files changed, 116 insertions(+), 27 deletions(-) diff --git a/api-generator/components/megamenu.js b/api-generator/components/megamenu.js index 5c295625ef..4398f863da 100644 --- a/api-generator/components/megamenu.js +++ b/api-generator/components/megamenu.js @@ -28,6 +28,18 @@ const MegaMenuProps = [ type: 'string', default: 'horizontal', description: 'Defines the orientation, valid values are horizontal and vertical.' + }, + { + name: 'start', + type: 'any', + default: 'null', + description: 'The template of starting element.' + }, + { + name: 'end', + type: 'any', + default: 'null', + description: 'The template of trailing element' } ]; diff --git a/components/doc/megamenu/index.js b/components/doc/megamenu/index.js index 2cc481f0a4..026e132c93 100644 --- a/components/doc/megamenu/index.js +++ b/components/doc/megamenu/index.js @@ -133,6 +133,9 @@ export class MegaMenuDemo extends Component { ]; } + const start = logo e.target.src='https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png'} height="40" className="mr-2">; + const end = ; + render() { return (
@@ -142,6 +145,11 @@ export class MegaMenuDemo extends Component {
Vertical
+ +
Templating
+ +
+
); @@ -270,6 +278,9 @@ const MegaMenuDemo = () => { } ]; + const start = logo e.target.src='https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png'} height="40" className="mr-2">; + const end = ; + return (
@@ -278,6 +289,11 @@ const MegaMenuDemo = () => {
Vertical
+ +
Templating
+ +
+
); @@ -405,6 +421,9 @@ const MegaMenuDemo = () => { } ]; + const start = logo e.target.src='https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png'} height="40" className="mr-2">; + const end = ; + return (
@@ -413,6 +432,11 @@ const MegaMenuDemo = () => {
Vertical
+ +
Templating
+ +
+
); @@ -543,6 +567,9 @@ const MegaMenuDemo = () => { } ]; + const start = logo e.target.src='https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png'} height="40" className="mr-2">; + const end = ; + return (
@@ -551,6 +578,11 @@ const MegaMenuDemo = () => {
Vertical
+ +
Templating
+ +
+
); @@ -714,13 +746,14 @@ const items = [
Custom Content
-

Any content inside the megamenu will be displayed on the right side by default. You may use ".ui-megamenu-custom" style class to change the location of the content.

+

The megamenu can display custom content by using the "start" and "end" properties.

{` - - -