Skip to content

Commit

Permalink
Merge pull request #6 from unicef-polymer/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
adi130987 authored Jun 27, 2017
2 parents ac438ed + 2e68df7 commit 6fbe043
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# \<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](etools-content-panel-demo.png)

## Usage
```html
<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>

Expand Down Expand Up @@ -53,6 +60,7 @@ Custom property | Description | Default
`--ecp-disabled-color` | Content disabled color | `#d1d1d1`
`--epc-toolbar-content` | Mixin applied to toolbar content | `{}`
`--epc-toolbar` | Mixin applied to paper-toolbar element | `{}`
`--ecp-header-btns-wrapper` | Mixin appplied to panel header right btns container | `{}`


## Install
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "etools-content-panel",
"description": "A simple panel with heading to display content in an organized manner. ",
"version": "1.0.5",
"version": "1.0.6",
"license": "https://github.com/unicef-polymer/etools-content-panel/blob/master/LICENSE.md",
"main": "etools-content-panel.html",
"dependencies": {
Expand Down
14 changes: 14 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>

<script>
window.Polymer = {
dom: 'shadow',
lazyRegister: true
};
</script>

<link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html">
<link rel="import" href="../../iron-demo-helpers/demo-snippet.html">
<link rel="import" href="../../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../../iron-icons/iron-icons.html">

<link rel="import" href="../etools-content-panel.html">

Expand All @@ -28,6 +37,11 @@ <h1>etools-content-panel demo</h1>
<demo-snippet>
<template>
<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>

Expand Down
Binary file modified etools-content-panel-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions etools-content-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
`--ecp-disabled-color` | Content disabled color | `#d1d1d1`
`--epc-toolbar-content` | Mixin applied to toolbar content | `{}`
`--epc-toolbar` | Mixin applied to paper-toolbar element | `{}`
`--ecp-header-btns-wrapper` | Mixin appplied to panel header right btns container | `{}`
@demo demo/index.html
-->
Expand Down Expand Up @@ -62,6 +63,11 @@
}
}

#panel-btns-wrapper {
opacity: 0.8;
@apply(--ecp-header-btns-wrapper);
}

.disabled paper-toolbar {
opacity: 0.5;
@apply(--ecp-header-disabled);
Expand All @@ -87,6 +93,9 @@
hidden$="[[!showExpandBtn]]"
disabled$="[[isDisabled]]"></paper-icon-button>
<div class="title">[[panelTitle]]</div>
<div id="panel-btns-wrapper">
<slot name="panel-btns"></slot>
</div>
</paper-toolbar>
<iron-collapse opened="{{open}}">
<div id="content-wrapper">
Expand Down

0 comments on commit 6fbe043

Please sign in to comment.