Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to Polymer 3, add events type definitions #183

Merged
merged 34 commits into from
Dec 11, 2020
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
809efca
Remove demo and related dependencies
web-padawan Dec 7, 2020
df2d406
Convert to Polymer 3 with magi-cli
web-padawan Dec 7, 2020
2d50192
Sort package.json, add module entry
web-padawan Dec 7, 2020
470c4d8
Commit typings to version control
web-padawan Dec 7, 2020
6ec5ada
Cleanup typings, extend HTMLElement
web-padawan Dec 7, 2020
747dd6f
Remove Safari 10 workaround
web-padawan Dec 7, 2020
c461ca9
Cleanup and sort Polymer imports
web-padawan Dec 7, 2020
35c5ad3
Update copyright headers
web-padawan Dec 7, 2020
7e68159
Remove non-existing observer argument
web-padawan Dec 7, 2020
5d5768c
Replace dom-module with registerStyles
web-padawan Dec 7, 2020
3c1348a
Remove ShadyCSS workaround
web-padawan Dec 7, 2020
bccdb00
Remove Edge custom property workaround
web-padawan Dec 7, 2020
dfe4e5e
Convert unit tests to web-test-runner
web-padawan Dec 7, 2020
a98d4ee
Convert visual tests to hermione-esm
web-padawan Dec 8, 2020
02a0f35
Add web-dev-server and start script
web-padawan Dec 8, 2020
4b54744
Update visual test screenshots
web-padawan Dec 8, 2020
31c6f0b
Add ESLint, Prettier, Stylelint and magi
web-padawan Dec 8, 2020
a51052c
Replace Travis with GitHub actions
web-padawan Dec 8, 2020
dd21c5d
Fi API docs, add build script for CDN
web-padawan Dec 8, 2020
2eb7db4
Update and cleanup README
web-padawan Dec 8, 2020
0e2b8dc
Add type definitions for custom events
web-padawan Dec 8, 2020
070a7fc
Bump vaadin-item to 3.0.0-alpha1
web-padawan Dec 8, 2020
43cded0
Update dependency versions
web-padawan Dec 8, 2020
7669412
Update coverage threshold
web-padawan Dec 8, 2020
d897fcd
Move flex child tabs to unit tests
web-padawan Dec 8, 2020
4d0bdc9
Update equal width tabs test
web-padawan Dec 8, 2020
6e5671b
Update tabs direction tests
web-padawan Dec 8, 2020
8a4e5cf
Remove legacy Edge workaround
web-padawan Dec 8, 2020
d90b44f
Update tests, skip failing test
web-padawan Dec 8, 2020
f55afbb
Update RTL test: skip in Chrome
web-padawan Dec 8, 2020
5435f6f
Move equal width back to unit tests
web-padawan Dec 8, 2020
ee67c89
Remove demo folder
web-padawan Dec 11, 2020
cd308b6
Remove IE11 workaround
web-padawan Dec 11, 2020
dcde8f1
Fix incorrect dependencies
web-padawan Dec 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"extends": "vaadin",
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"plugins": ["prettier"],
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": [
"html"
],
"globals": {
"Polymer": false,
"Vaadin": false
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018
}
}
22 changes: 0 additions & 22 deletions .gemini.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/sauce.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: sauce

on:
push:
branches:
- '**'
tags-ignore:
- '*.*'

jobs:
unit-tests:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: SauceLabs tests
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: npm run test:sauce

visual-tests:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: Visual tests
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: npm run test:visual
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: tests

on: [pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: Check version
run: npm run check-version

- name: Lint JavaScript
run: npm run lint:js

- name: Lint CSS
run: npm run lint:css

- name: Lint typings
run: npm run lint:types

unit-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: Unit tests
run: npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
package-lock.json
yarn.lock
coverage
dist
analysis.json
21 changes: 21 additions & 0 deletions .hermione.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
browsers: {
chrome: {
baseUrl: 'http://localhost:8080/test/visual/',
screenshotsDir: () => 'test/visual/screens/vaadin-tabs',
desiredCapabilities: {
browserName: 'chrome',
version: '85.0',
platform: 'Windows 10'
}
}
},
plugins: {
'hermione-esm': {
port: 8080
},
'hermione-sauce': {
verbose: false
}
}
};
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"printWidth": 120,
"trailingComma": "none",
"htmlWhitespaceSensitivity": "strict"
}
5 changes: 4 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "stylelint-config-vaadin"
"extends": [
"stylelint-config-vaadin",
"stylelint-config-prettier"
]
}
67 changes: 0 additions & 67 deletions .travis.yml

This file was deleted.

88 changes: 28 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
[![npm version](https://badgen.net/npm/v/@vaadin/vaadin-tabs)](https://www.npmjs.com/package/@vaadin/vaadin-tabs)
[![Bower version](https://badgen.net/github/release/vaadin/vaadin-tabs)](https://github.com/vaadin/vaadin-tabs/releases)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/vaadin/vaadin-tabs)
[![Build Status](https://travis-ci.org/vaadin/vaadin-tabs.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-tabs)
[![Coverage Status](https://coveralls.io/repos/github/vaadin/vaadin-tabs/badge.svg?branch=master)](https://coveralls.io/github/vaadin/vaadin-tabs?branch=master)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vaadin/web-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-tabs)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadinvaadin-tabs.svg)](https://vaadin.com/directory/component/vaadinvaadin-tabs)

# <vaadin-tabs>

[Live Demo ↗](https://vaadin.com/components/vaadin-tabs/html-examples)
|
[API documentation ↗](https://vaadin.com/components/vaadin-tabs/html-api)


[<vaadin-tabs>](https://vaadin.com/components/vaadin-tabs) is a Web Component providing item navigation part of the [Vaadin components](https://vaadin.com/components). It is designed for menu and tab components.

<!--
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="vaadin-tabs.html">
<next-code-block></next-code-block>
</template>
</custom-element-demo>
```
-->
[![npm version](https://badgen.net/npm/v/@vaadin/vaadin-tabs)](https://www.npmjs.com/package/@vaadin/vaadin-tabs)
[![Build Status](https://travis-ci.org/vaadin/vaadin-tabs.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-tabs)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/vaadin/vaadin-tabs)
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-tabs)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadinvaadin-tabs.svg)](https://vaadin.com/directory/component/vaadinvaadin-tabs)
[![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)

```html
<vaadin-tabs selected="3">
<vaadin-tab>Page 1</vaadin-tab>
Expand All @@ -41,28 +26,6 @@

## Installation

The Vaadin components are distributed as Bower and npm packages.
Please note that the version range is the same, as the API has not changed.
You should not mix Bower and npm versions in the same application, though.

Unlike the official Polymer Elements, the converted Polymer 3 compatible Vaadin components
are only published on npm, not pushed to GitHub repositories.

### Polymer 2 and HTML Imports Compatible Version

Install `vaadin-tabs`:

```sh
bower i vaadin/vaadin-tabs --save
```

Once installed, import it in your application:

```html
<link rel="import" href="bower_components/vaadin-tabs/vaadin-tabs.html">
```
### Polymer 3 and ES Modules Compatible Version

Install `vaadin-tabs`:

```sh
Expand All @@ -85,45 +48,50 @@ To use the Material theme, import the correspondent file from the `theme/materia

- The components with the Lumo theme:

`theme/lumo/vaadin-tab.html`
`theme/lumo/vaadin-tabs.html`
`theme/lumo/vaadin-tab.js`
`theme/lumo/vaadin-tabs.js`

- The components with the Material theme:

`theme/material/vaadin-tab.html`
`theme/material/vaadin-tabs.html`
`theme/material/vaadin-tab.js`
`theme/material/vaadin-tabs.js`

- Alias for `theme/lumo/vaadin-tab.html`
`theme/lumo/vaadin-tabs.html`:
- Alias for `theme/lumo/vaadin-tab.js`
`theme/lumo/vaadin-tabs.js`:

`vaadin-tab.html`
`vaadin-tabs.html`
`vaadin-tab.js`
`vaadin-tabs.js`


## Running demos and tests in a browser
## Running API docs and tests in a browser

1. Fork the `vaadin-tabs` repository and clone it locally.

1. Make sure you have [npm](https://www.npmjs.com/) and [Bower](https://bower.io) installed.
1. Make sure you have [node.js](https://nodejs.org/) 12.x installed.

1. When in the `vaadin-tabs` directory, run `npm install` and then `bower install` to install dependencies.
1. Make sure you have [npm](https://www.npmjs.com/) installed.

1. When in the `vaadin-tabs` directory, run `npm install` to install dependencies.

1. Run `npm start`, browser will automatically open the component API documentation.

1. You can also open demo or in-browser tests by adding **demo** or **test** to the URL, for example:
1. You can also open visual tests, for example:

- http://127.0.0.1:3000/components/vaadin-tabs/demo
- http://127.0.0.1:3000/components/vaadin-tabs/test
- http://127.0.0.1:3000/test/visual/horizontal-tabs.html


## Running tests from the command line

1. When in the `vaadin-tabs` directory, run `polymer test`
1. When in the `vaadin-tabs` directory, run `npm test`

## Debugging tests in the browser

1. Run `npm run debug`, then choose manual mode (M) and open the link in browser.


## Following the coding style

We are using [ESLint](http://eslint.org/) for linting JavaScript code. You can check if your code is following our standards by running `npm run lint`, which will automatically lint all `.js` files as well as JavaScript snippets inside `.html` files.
We are using [ESLint](http://eslint.org/) for linting JavaScript code. You can check if your code is following our standards by running `npm run lint`, which will automatically lint all `.js` files.


## Big Thanks
Expand Down
Loading