1.0.0 • Published 2 years ago

jsim-lazy-expandable v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Jsim Lazy Expandable

Light weight and easy to use expansion panel with lazy loaded content.

Built in Angular 13.

No dependencies on Angular Materials or Angular CDK.

Default styling based on Angular materials but fully costumizable with CSS classes of low specificity.

Demo

Demo on StackBlitz

Usage

Import the LazyExpandableModule Create the expandable panel with the element jsim-lazy-expandable

Contents of the panel can be set with directives and some properties.

Directives

NameDescription
exp-header-titleContent for the left of the Header
exp-header-subtitleContent for the right of the header
exp-contentMain content of the expansion panel
*jsimLazyContentDirective to activate lazy loading of content

Properties

PropertyTypeI/ODefaultDescription
isOpenbooleanInputfalseSets panel open or closed
openChangedEventEmitterOutputN/AEmits when open/close changes
hideIconbooleanInputfalseSets arrow icon hidden
headerHeightnumberInput48Height of header when collapsed in pixels
headerHeightExpandednumberInput64Height of header when expanded in pixels
animationSpeednumberInput0.5Speed of animation in pixels per millisecond
animationEndEventEmitterOutputN/AEmits when animation end with current isOpen
disabledbooleanInputfalseDisables the expansion and collapse of the panel

Example

<jsim-lazy-expandable [isOpen]="false">
    <div exp-header-title>This is my Title</div>
    <div exp-header-subtitle>This is a Description</div>
    <div exp-content *jsimLazyContent>
        <my-lazy-component></my-lazy-component>
    </div>
</jsim-lazy-expandable>

Styling

Every element has a specific css class and most classes are very low specificity.

ClassDescription
lazy-exp-containerOuter container for expansion panel
lazy-exp-headerThe header row
lazy-exp-header-titleContent on the left side of the header
lazy-exp-header-subtitleContent of the right side of the header
lazy-exp-header-iconArrow icon
lazy-exp-contentContainer of the main content

Css variables set in lazy-exp-container

VariableDescriptionValue
--background-colorColor of the panelwhite
--background-color-hoverColor of the Header when hoveredrgba(0,0,0,0.04)
--icon-colorColor of the arrow iconrgb(119,119,119)

License

MIT

1.0.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago