5.1.0 • Published 1 year ago

@unicef-polymer/etools-content-panel v5.1.0

Weekly downloads
83
License
Apache-2.0
Repository
github
Last release
1 year ago

\<etools-content-panel>

A simple panel with header to display a collapsible content. The header can also have buttons on the right side on the title (slotted content slot="panel-btns"", check first usage example).

alt tag

Usage

<etools-content-panel panel-title="Panel title" show-expand-btn>
  <div slot="panel-btns">
    <paper-icon-button icon="add-circle"></paper-icon-button>
    <paper-icon-button icon="create"></paper-icon-button>
    <paper-icon-button icon="polymer"></paper-icon-button>
  </div>
  <div>Your content goes here...</div>
</etools-content-panel>

<etools-content-panel panel-title="Panel title" no-header elevation="2">
  <div>Only content, no header...</div>
</etools-content-panel>

<etools-content-panel panel-title="Panel title" elevation="3" disabled show-expand-btn>
  <div>Disabled state...</div>
</etools-content-panel>

<etools-content-panel panel-title="Panel title" elevation="4">
  <div>No content expand or collapse button</div>
</etools-content-panel>

<etools-content-panel panel-title="Panel title" title-style="align-center" elevation="5">
  <div>Panel elevation increased to maximum value</div>
</etools-content-panel>

Attributes:

  • elevation - Number Default: 1
  • disabled - Boolean, Default: false
  • noHeader - Boolean, Default: false
  • open - Boolean, Default: true - notifies
  • showExpandBtn - Boolean, Default: false
  • panelTitle - String, Default: Panel title

Styling

You can use defined variables and mixins to change panel style.

Custom propertyDescriptionDefault
--ecp-header-heightHeader height48px
--ecp-header-bgHeader background color#0099ff
--epc-header-colorHeader color#ffffff
etools-content-panel::part(ecp-header)Mixin applied to header{}
--ecp-title-white-spaceHeader title white spacenowrap
etools-content-panel::part(ecp-toggle-btn)Mixin applied to expand content button{}
etools-content-panel::part(ecp-header-title)Mixin applied to the header title{}
etools-content-panel::part(ecp-header-btns-wrapper)Mixin appplied to panel header right btns container{}
etools-content-panel::part(ecp-content)Mixin applied to content{}
--ecp-content-bg-colorContent Header color#ffffff
etools-content-panel::part(ecp-header):disabledMixin applied in disabled state{}

Install

$ npm i --save @unicef-polymer/etools-content-panel

Linting the code

Install local npm packages (run npm install) Then just run the linting task

$ npm run lint

Preview element locally

Install needed dependencies by running: $ npm install. Make sure you have the Polymer CLI installed. Then run $ polymer serve to serve your element application locally.

Running Tests

TODO: improve and add more tests

$ polymer test

Circle CI

Package will be automatically published after tag push (git tag 1.2.3 , git push --tags). Tag name must correspond to SemVer (Semantic Versioning) rules.
Examples:

Version matchResult
1.2.3match
1.2.3-prematch
1.2.3+buildmatch
1.2.3-pre+buildmatch
v1.2.3-pre+buildmatch
1.2no match

You can see more details here

5.1.0

1 year ago

5.0.5-rc1

1 year ago

5.0.4

2 years ago

5.0.4-rc.1

2 years ago

5.0.3

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

5.0.0-rc.1

3 years ago

5.0.0-rc.2

3 years ago

4.1.0-rc.1

3 years ago

4.1.0

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

4.0.0-rc.2

3 years ago

4.0.0-rc.1

3 years ago

3.0.6

4 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0-rc.1

5 years ago