primeng icon indicating copy to clipboard operation
primeng copied to clipboard

New Component: Sidebar

Open nsksaisaravana opened this issue 9 years ago • 33 comments

All components are very nice. I looking for a component like Office UI Fabric Panel, to check, please have a look at this url

https://dev.office.com/fabric#/components/panel

I'm submitting a ... (check one with "x")

[ ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports) Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.

http://plnkr.co/edit/Wj39h1?p=preview

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Angular version: 2.0.X
  • PrimeNG version: 2.0.X
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =

nsksaisaravana avatar Jun 19 '17 06:06 nsksaisaravana

Cool component. We have a full page overlay variant in our project (called it lightbox).

ova2 avatar Jun 25 '17 14:06 ova2

In future whether we can have such components in Primeng ?

nsksaisaravana avatar Jun 27 '17 07:06 nsksaisaravana

Would be nice to have - currently a lot of our app depends on a sidebar. We end up using ng-sidebar - but the quality is often spotty and updates unreliable.

IF you consider this - make sure to have a option for non fixed sidebar that could be placed inside a container (like relative parent and absolute sidebar).

A vertical scrollbar would be nice if contents do not fit - instead of stretching the whole page (or leave room to customize it with css). Another major issue with hiding overflows is that it ends up clipping dropdown menus etc - perhaps you can find a solution to that as well?

Separate template able header (where close button is - so we could add extra buttons like toggle for wider sidebar etc).

Ketec avatar Aug 17 '17 06:08 Ketec

We created our own component for something like this. basically just a menu that can slide in from the top/bottom/left/right of a container. Material has something similar called a bottom sheet.

I would consider this an essential component for PrimeNG

dhniels avatar Aug 21 '17 21:08 dhniels

This component will be very useful, instead of pop up window we can use this. Currently, we are using ng-office UI slide bar in AngularJS but in Angular 2 we don't have such component.

nsksaisaravana avatar Aug 23 '17 23:08 nsksaisaravana

Implemented for 4.2.2.

cagataycivici avatar Oct 01 '17 17:10 cagataycivici

ezgif-4-5fa4c98c33

cagataycivici avatar Oct 01 '17 17:10 cagataycivici

Thanks a lot for your hard work and looks awesome.

Can we have properties like small, medium, large and according to that we can have a size of the panel?

nsksaisaravana avatar Oct 01 '17 22:10 nsksaisaravana

Cool. The next topic for PrimeNG's book, second edition -:).

Can we do the sidebar responsive? I mean a "full screen" mode on small screens, like Angular Material Dialog.

ova2 avatar Oct 02 '17 05:10 ova2

Since it has no documentation yet - does it use "fixed" display or relative-absolute? For example could i put it inside the "Documentation" tab in the demo above? Does it close when clicked outside? Or provides a attribute to toggle and implement the open/close ourselves?

Ketec avatar Oct 02 '17 06:10 Ketec

Initial features are;

  • Fixed position relative to the document itself, not to another element
  • 4 positions, top, bottom, left, right
  • Closes when outside is clicked
  • Has a close icon at top right corner to close manually
  • Can be managed from model like a dialog using visible property
  • Has sm, md and lg as built-in sizes
  • Responsive
  • Full screen mode

cagataycivici avatar Oct 02 '17 12:10 cagataycivici

Will we be able to attach this to a certain element? it would be cool to use these as a sort of slide over menu inside of a dialog for example.

dhniels avatar Oct 02 '17 20:10 dhniels

@cagataycivici I am after those features mentioned above !!! Thanks, guys.

nsksaisaravana avatar Oct 02 '17 22:10 nsksaisaravana

I dont see this in the demo https://www.primefaces.org/primeng/#/setup

pieterlouw1974 avatar Oct 04 '17 15:10 pieterlouw1974

Can't find SidebarModule in 4.2.2... the component is there but the module is not exported.

Serranom4 avatar Oct 05 '17 16:10 Serranom4

@cagataycivici How do I prevent closing of the sidebar when outside is clicked?

Thanks

pantonis avatar Oct 05 '17 17:10 pantonis

Will be great when ready! Looks like export not included in primeng.d.ts. Also, can't tell for sure by think sidebar.d.ts needs to implement ngOnDestroy in class declaration. In the demo page source code, there are a bunch of closing curly braces that make for unusable code if someone copies/pastes from there. Hope that helps!

Ah, and the export is missing from primeng.js, I believe. Yes -- that does the trick. On to testing. Thank you!

bjareczek avatar Oct 05 '17 23:10 bjareczek

@bjareczek can you share code fix

pantonis avatar Oct 06 '17 06:10 pantonis

@pantonis , PR is pending: https://github.com/primefaces/primeng/pull/4116

bjareczek avatar Oct 06 '17 10:10 bjareczek

Sidebar gets not closed on ESC key. @cagataycivici: is it possible to implement this behavior like in Dialog?

ova2 avatar Oct 06 '17 12:10 ova2