Skip to content

Commit

Permalink
Merge pull request #7 from unicef-polymer/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
adi130987 authored Apr 24, 2018
2 parents 6fbe043 + 46100c8 commit 140c827
Show file tree
Hide file tree
Showing 14 changed files with 5,533 additions and 199 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.gitignore
demo/*
test/*
node_modules/*
node_modules/*
30 changes: 18 additions & 12 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,27 @@
"html"
],
"rules": {
"padded-blocks": "off",
"brace-style": "off",
"new-cap": ["error", { "capIsNewExceptions": ["Polymer"] }],
"new-cap": [
"error",
{
"capIsNewExceptions": ["Polymer"],
"capIsNewExceptionPattern": "^Etools.."
}
],
"no-var": "off",
"operator-linebreak": 1,
"no-trailing-spaces": 1,
"valid-jsdoc": 0,
"camelcase": 1,
"guard-for-in": 0,
"comma-dangle": 0,
"prefer-spread": 0,
"linebreak-style": 0,
"require-jsdoc": "off",
"max-len": ["error", 120, 4]
"valid-jsdoc": "off",
"comma-dangle": ["error", "never"],
"max-len": ["error", { "code": 120 }],
"camelcase": ["error", {"properties": "never"}],
"arrow-parens": [2, "as-needed", { "requireForBlockBody": true }]
},
"globals": {
"Polymer": true
"moment": true,
"Promise": true,
"Polymer": true,
"EtoolsLogsMixin": true
}
}
}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bower_components/
node_modules/
/bower_components
/node_modules
47 changes: 14 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ check first usage example).
<div>Only content, no header...</div>
</etools-content-panel>

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

Expand All @@ -36,15 +36,12 @@ check first usage example).

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

All attributes of the element are not required.


## Styling

You can use defined variables and mixins to change panel style.
Expand All @@ -53,49 +50,33 @@ Custom property | Description | Default
----------------|-------------|----------
`--ecp-header-height` | Header height | `48px`
`--ecp-header-bg` | Header background color | `#1e86bf`
`--ecp-header-color` | Header color | `#ffffff`
`--ecp-header` | Mixin applied to header | `{}`
`--ecp-toggle-btn` | Mixin applied to expand content button | `{}`
`--ecp-header-title` | Mixin applied to the header title | `{}`
`--ecp-expand-btn` | Mixin applied to expand content utton | `{}`
`--ecp-header-disabled` | Mixin applied to header when it's disabled | `{}`
`--ecp-content` | Mixin applied to content | `{}`
`--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 | `{}`

`--ecp-content` | Mixin applied to content | `{}`
`--ecp-disabled` | Mixin applied in disabled state | `{}`

## Install
```bash
$ bower install --save etools-content-panel
```

## Preview element locally

Install needed dependencies by running: `$ bower install`.
Make sure you have the [Polymer CLI](https://www.npmjs.com/package/polymer-cli) installed. Then run `$ polymer serve` to serve your element application locally.
## Install the Polymer-CLI

## Linting the code
First, make sure you have the [Polymer CLI](https://www.npmjs.com/package/polymer-cli) installed. Then run `polymer serve` to serve your element locally.

Innstall local npm packages (run `npm install`)
Then just run the linting task
## Viewing Your Element

```bash
$ npm run lint
```
You should also use polylint. If you don't have Polylint installed run `npm install -g polylint`.
Then just run the linter on each file you wish to check like so

```bash
$ polylint -i filename.html
$ polymer serve
```
At the moment polylint crashes if it encounters a missing import. If that happens, temporarily comment out such imports and run the command again.

## Running Tests

You need to have `web-component-tester` installed (if not run `npm install -g web-component-tester`)
```bash
$ wtc
```
or
```bash
$ wtc -p
$ polymer test
```

Your application is already set up to be tested via [web-component-tester](https://github.com/Polymer/web-component-tester). Run `polymer test` to run your application's test suite locally.
Loading

0 comments on commit 140c827

Please sign in to comment.