libs/upp-wdgt/src/components/upp-panel/upp-panel.ts
A versatile panel component with sections for header, content, and footer.
This component is designed to structure content into a panel layout, supporting configurable size and border visibility.
The upp-panel serves as the container, while the upp-panel-header, upp-panel-content, and upp-panel-footer
components define distinct regions within the panel.
small or large).ng-content for dynamic projection.<upp-panel size="large" border="show">
<upp-panel-header>
<h1>Panel Header</h1>
</upp-panel-header>
<upp-panel-content>
<p>Main content goes here.</p>
</upp-panel-content>
<upp-panel-footer>
<button>Submit</button>
</upp-panel-footer>
</upp-panel>size):'small': Displays the panel with a smaller layout.'large' (default): Displays the panel with a larger layout.border):'show' (default): Displays a visible border around the panel.'hide': Hides the panel border.| selector | upp-panel |
| styleUrls | ./upp-panel.scss |
| templateUrl | ./upp-panel.html |
Inputs |
HostBindings |
Accessors |
| lines |
Type : "show" | "hide"
|
Default value : 'hide'
|
|
Controls whether the panel border is visible. Available options:
|
| size |
Type : "small" | "large" | "auto"
|
Default value : 'auto'
|
|
Sets the size of the panel. Available options:
|
| class |
Type : string
|
|
Dynamically calculates the CSS classes for the panel based on the |
| panelClasses |
getpanelClasses()
|
|
Dynamically calculates the CSS classes for the panel based on the
Returns :
string
|
<ng-content></ng-content>
./upp-panel.scss
:host {
--panel-small-max-width: 450px;
position: relative;
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--ion-background-color);
margin: 3px;
height: calc(100% - 6px);
padding: 0px;
@media (max-width: var(--panel-small-max-width)){
min-width: 100% !important;
}
/************************************/
/* HOST BINDINGS */
/************************************/
&.--border-hide {
::ng-deep upp-panel-content {
border: none;
}
}
&.--auto {
margin: 0px;
width: 100%;
}
&.--large {
width: calc(100% - 6px);
::ng-deep upp-panel-content {
width: 100%;
}
&.--border-show {
border-radius: 8px;
border: 2px solid var(--ion-color-light);
border-top-style: none;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
}
}
&.--small {
flex: 0 0 var(--panel-small-max-width);
width: var(--panel-small-max-width);
max-width: var(--panel-small-max-width);
transition: max-width linear 0.1s;
&[hidden] {
display: block !important;
margin: 0px !important;
padding: 0px !important;
border: none !important;
max-width: 0px;
}
::ng-deep upp-panel-content {
width: 100%;
}
&.--border-show {
border-radius: 8px;
border: 2px solid var(--ion-color-light);
border-top-style: none;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
}
}
/************************************/
/* HEADER, CONTENT, FOOTER */
/************************************/
::ng-deep upp-panel-header {
flex: 0 0 auto;
background-color: var(--ion-color-warning);
box-shadow: 0px 2px 4px rgba(var(--ion-color-dark-rgb), 0.2);
}
::ng-deep upp-panel-content {
display: flex;
overflow: hidden;
flex: 1 1 auto;
flex-direction: row;
}
::ng-deep upp-panel-footer {
flex: 0 0 auto;
background-color: var(--ion-color-warning);
box-shadow: 0px -2px 4px rgba(var(--ion-color-dark-rgb), 0.2);
}
}