mirror of
https://github.com/Polymer/polymer-starter-kit.git
synced 2025-02-25 18:55:22 -06:00
Merge branch 'polymer-3-updates' into 3.0-preview
This commit is contained in:
commit
42604f2063
@ -1,21 +0,0 @@
|
||||
{
|
||||
"extends": ["eslint:recommended", "google"],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6
|
||||
},
|
||||
"env": {
|
||||
"browser": true
|
||||
},
|
||||
"plugins": [
|
||||
"html"
|
||||
],
|
||||
"rules": {
|
||||
"brace-style": "off",
|
||||
"new-cap": ["error", { "capIsNewExceptions": ["Polymer"] }],
|
||||
"no-var": "off",
|
||||
"require-jsdoc": "off"
|
||||
},
|
||||
"globals": {
|
||||
"Polymer": true
|
||||
}
|
||||
}
|
@ -15,9 +15,7 @@ cache:
|
||||
directories:
|
||||
- node_modules
|
||||
install:
|
||||
- npm install -g polymer-cli
|
||||
- npm install
|
||||
- polymer install
|
||||
before_script:
|
||||
- npm run lint
|
||||
script:
|
||||
|
10
README.md
10
README.md
@ -45,18 +45,18 @@ Install [Polymer CLI](https://github.com/Polymer/polymer-cli) using
|
||||
|
||||
mkdir my-app
|
||||
cd my-app
|
||||
polymer init polymer-2-starter-kit
|
||||
polymer init polymer-3-starter-kit
|
||||
|
||||
### Start the development server
|
||||
|
||||
This command serves the app at `http://127.0.0.1:8081` and provides basic URL
|
||||
routing for the app:
|
||||
|
||||
polymer serve
|
||||
npm start
|
||||
|
||||
### Build
|
||||
|
||||
The `polymer build` command builds your Polymer application for production, using build configuration options provided by the command line or in your project's `polymer.json` file.
|
||||
The `npm run build` command builds your Polymer application for production, using build configuration options provided by the command line or in your project's `polymer.json` file.
|
||||
|
||||
You can configure your `polymer.json` file to create multiple builds. This is necessary if you will be serving different builds optimized for different browsers. You can define your own named builds, or use presets. See the documentation on [building your project for production](https://www.polymer-project.org/2.0/toolbox/build-for-production) for more information.
|
||||
|
||||
@ -79,14 +79,14 @@ Run `polymer help build` for the full list of available options and optimization
|
||||
|
||||
This command serves your app. Replace `build-folder-name` with the folder name of the build you want to serve.
|
||||
|
||||
polymer serve build/build-folder-name/
|
||||
npm start build/build-folder-name/
|
||||
|
||||
### Run tests
|
||||
|
||||
This command will run [Web Component Tester](https://github.com/Polymer/web-component-tester)
|
||||
against the browsers currently installed on your machine:
|
||||
|
||||
polymer test
|
||||
npm test
|
||||
|
||||
If running Windows you will need to set the following environment variables:
|
||||
|
||||
|
26
bower.json
26
bower.json
@ -1,26 +0,0 @@
|
||||
{
|
||||
"name": "polymer-starter-kit",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"license": "https://polymer.github.io/LICENSE.txt",
|
||||
"dependencies": {
|
||||
"app-layout": "PolymerElements/app-layout#^2.0.0",
|
||||
"app-route": "PolymerElements/app-route#^2.0.0",
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^2.0.0",
|
||||
"iron-iconset-svg": "PolymerElements/iron-iconset-svg#^2.0.0",
|
||||
"iron-media-query": "PolymerElements/iron-media-query#^2.0.0",
|
||||
"iron-pages": "PolymerElements/iron-pages#^2.0.0",
|
||||
"iron-selector": "PolymerElements/iron-selector#^2.0.0",
|
||||
"paper-icon-button": "PolymerElements/paper-icon-button#^2.0.0",
|
||||
"polymer": "Polymer/polymer#^2.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"polymer": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "Polymer/web-component-tester#^6.0.0"
|
||||
},
|
||||
"private": true
|
||||
}
|
@ -85,10 +85,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
</script>
|
||||
|
||||
<!-- Load webcomponents-loader.js to check and load any polyfills your browser needs -->
|
||||
<script src="./node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
|
||||
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
|
||||
|
||||
<!-- Load your application shell -->
|
||||
<script type="module" src="./src/my-app.js"></script>
|
||||
<script type="module" src="src/my-app.js"></script>
|
||||
|
||||
<!-- Add any global styles for body, document, etc. -->
|
||||
<style>
|
||||
|
15653
package-lock.json
generated
15653
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
29
package.json
29
package.json
@ -1,26 +1,17 @@
|
||||
{
|
||||
"name": "polymer-starter-kit",
|
||||
"version": "4.0.0-pre.1",
|
||||
"description": "A starting point for Polymer apps",
|
||||
"author": "The Polymer Authors",
|
||||
"license": "BSD-3-Clause",
|
||||
"devDependencies": {
|
||||
"eslint": "^3.19.0",
|
||||
"eslint-config-google": "^0.7.0",
|
||||
"eslint-plugin-html": "^2.0.0",
|
||||
"wct-browser-legacy": "0.0.1-pre.11"
|
||||
},
|
||||
"repository": "Polymer/polymer-starter-kit",
|
||||
"scripts": {
|
||||
"lint": "npm run lint:javascript && polymer lint",
|
||||
"lint:javascript": "eslint . --ext js,html --ignore-path .gitignore",
|
||||
"start": "polymer serve",
|
||||
"build": "polymer build",
|
||||
"lint": "polymer lint",
|
||||
"test": "polymer test",
|
||||
"test:integration": "polymer build # test that psk builds without error with the CLI"
|
||||
},
|
||||
"version": "4.0.0-pre.1",
|
||||
"resolutions": {
|
||||
"inherits": "2.0.3",
|
||||
"samsam": "1.1.3",
|
||||
"supports-color": "3.1.2",
|
||||
"type-detect": "1.0.0"
|
||||
},
|
||||
"author": "The Polymer Authors",
|
||||
"dependencies": {
|
||||
"@polymer/app-layout": "^3.0.0-pre.12",
|
||||
"@polymer/app-route": "^3.0.0-pre.12",
|
||||
@ -31,6 +22,10 @@
|
||||
"@polymer/iron-selector": "^3.0.0-pre.12",
|
||||
"@polymer/paper-icon-button": "^3.0.0-pre.12",
|
||||
"@polymer/polymer": "^3.0.0-pre.12",
|
||||
"@webcomponents/webcomponentsjs": "^1.0.0"
|
||||
"@webcomponents/webcomponentsjs": "^1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"polymer-cli": "^1.7.0-pre.13",
|
||||
"wct-browser-legacy": "^0.0.1-pre.12"
|
||||
}
|
||||
}
|
||||
|
@ -70,5 +70,10 @@
|
||||
}
|
||||
],
|
||||
"moduleResolution": "node",
|
||||
"npm": true
|
||||
"npm": true,
|
||||
"lint": {
|
||||
"rules": [
|
||||
"polymer-3"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
186
src/my-app.js
186
src/my-app.js
@ -1,122 +1,122 @@
|
||||
import { PolymerElement } from '../node_modules/@polymer/polymer/polymer-element.js';
|
||||
import '../node_modules/@polymer/app-layout/app-drawer/app-drawer.js';
|
||||
import '../node_modules/@polymer/app-layout/app-drawer-layout/app-drawer-layout.js';
|
||||
import '../node_modules/@polymer/app-layout/app-header/app-header.js';
|
||||
import '../node_modules/@polymer/app-layout/app-header-layout/app-header-layout.js';
|
||||
import '../node_modules/@polymer/app-layout/app-scroll-effects/app-scroll-effects.js';
|
||||
import '../node_modules/@polymer/app-layout/app-toolbar/app-toolbar.js';
|
||||
import '../node_modules/@polymer/app-route/app-location.js';
|
||||
import '../node_modules/@polymer/app-route/app-route.js';
|
||||
import '../node_modules/@polymer/iron-pages/iron-pages.js';
|
||||
import '../node_modules/@polymer/iron-selector/iron-selector.js';
|
||||
import '../node_modules/@polymer/paper-icon-button/paper-icon-button.js';
|
||||
import './my-icons.js';
|
||||
import { setPassiveTouchGestures, setRootPath } from '../node_modules/@polymer/polymer/lib/utils/settings.js';
|
||||
import { html } from '../node_modules/@polymer/polymer/lib/utils/html-tag.js';
|
||||
//import { importHref } from '../node_modules/@polymer/polymer/lib/utils/import-href.js';
|
||||
// Gesture events like tap and track generated from touch will not be
|
||||
// preventable, allowing for better scrolling performance.
|
||||
/**
|
||||
@license
|
||||
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
* @license
|
||||
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
import { PolymerElement, html } from "@polymer/polymer/polymer-element.js";
|
||||
import { setPassiveTouchGestures, setRootPath } from '@polymer/polymer/lib/utils/settings.js';
|
||||
import '@polymer/app-layout/app-drawer/app-drawer.js';
|
||||
import '@polymer/app-layout/app-drawer-layout/app-drawer-layout.js';
|
||||
import '@polymer/app-layout/app-header/app-header.js';
|
||||
import '@polymer/app-layout/app-header-layout/app-header-layout.js';
|
||||
import '@polymer/app-layout/app-scroll-effects/app-scroll-effects.js';
|
||||
import '@polymer/app-layout/app-toolbar/app-toolbar.js';
|
||||
import '@polymer/app-route/app-location.js';
|
||||
import '@polymer/app-route/app-route.js';
|
||||
import '@polymer/iron-pages/iron-pages.js';
|
||||
import '@polymer/iron-selector/iron-selector.js';
|
||||
import '@polymer/paper-icon-button/paper-icon-button.js';
|
||||
import './my-icons.js';
|
||||
|
||||
/**
|
||||
* Gesture events like tap and track generated from touch will not be
|
||||
* preventable, allowing for better scrolling performance.
|
||||
*/
|
||||
setPassiveTouchGestures(true);
|
||||
|
||||
setRootPath(Polymer.rootPath);
|
||||
|
||||
class MyApp extends PolymerElement {
|
||||
static get template() {
|
||||
return html`
|
||||
<style>
|
||||
:host {
|
||||
--app-primary-color: #4285f4;
|
||||
--app-secondary-color: black;
|
||||
<style>
|
||||
:host {
|
||||
--app-primary-color: #4285f4;
|
||||
--app-secondary-color: black;
|
||||
|
||||
display: block;
|
||||
}
|
||||
display: block;
|
||||
}
|
||||
|
||||
app-drawer-layout:not([narrow]) [drawer-toggle] {
|
||||
display: none;
|
||||
}
|
||||
app-drawer-layout:not([narrow]) [drawer-toggle] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
app-header {
|
||||
color: #fff;
|
||||
background-color: var(--app-primary-color);
|
||||
}
|
||||
app-header {
|
||||
color: #fff;
|
||||
background-color: var(--app-primary-color);
|
||||
}
|
||||
|
||||
app-header paper-icon-button {
|
||||
--paper-icon-button-ink-color: white;
|
||||
}
|
||||
app-header paper-icon-button {
|
||||
--paper-icon-button-ink-color: white;
|
||||
}
|
||||
|
||||
.drawer-list {
|
||||
margin: 0 20px;
|
||||
}
|
||||
.drawer-list {
|
||||
margin: 0 20px;
|
||||
}
|
||||
|
||||
.drawer-list a {
|
||||
display: block;
|
||||
padding: 0 16px;
|
||||
text-decoration: none;
|
||||
color: var(--app-secondary-color);
|
||||
line-height: 40px;
|
||||
}
|
||||
.drawer-list a {
|
||||
display: block;
|
||||
padding: 0 16px;
|
||||
text-decoration: none;
|
||||
color: var(--app-secondary-color);
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.drawer-list a.iron-selected {
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
.drawer-list a.iron-selected {
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
<app-location route="{{route}}" url-space-regex="^[[rootPath]]">
|
||||
</app-location>
|
||||
<app-location route="{{route}}" url-space-regex="^[[rootPath]]">
|
||||
</app-location>
|
||||
|
||||
<app-route route="{{route}}" pattern="[[rootPath]]:page" data="{{routeData}}" tail="{{subroute}}">
|
||||
</app-route>
|
||||
<app-route route="{{route}}" pattern="[[rootPath]]:page" data="{{routeData}}" tail="{{subroute}}">
|
||||
</app-route>
|
||||
|
||||
<app-drawer-layout fullbleed="" narrow="{{narrow}}">
|
||||
<!-- Drawer content -->
|
||||
<app-drawer id="drawer" slot="drawer" swipe-open="[[narrow]]">
|
||||
<app-toolbar>Menu</app-toolbar>
|
||||
<iron-selector selected="[[page]]" attr-for-selected="name" class="drawer-list" role="navigation">
|
||||
<a name="view1" href="[[rootPath]]view1">View One</a>
|
||||
<a name="view2" href="[[rootPath]]view2">View Two</a>
|
||||
<a name="view3" href="[[rootPath]]view3">View Three</a>
|
||||
</iron-selector>
|
||||
</app-drawer>
|
||||
<app-drawer-layout fullbleed="" narrow="{{narrow}}">
|
||||
<!-- Drawer content -->
|
||||
<app-drawer id="drawer" slot="drawer" swipe-open="[[narrow]]">
|
||||
<app-toolbar>Menu</app-toolbar>
|
||||
<iron-selector selected="[[page]]" attr-for-selected="name" class="drawer-list" role="navigation">
|
||||
<a name="view1" href="[[rootPath]]view1">View One</a>
|
||||
<a name="view2" href="[[rootPath]]view2">View Two</a>
|
||||
<a name="view3" href="[[rootPath]]view3">View Three</a>
|
||||
</iron-selector>
|
||||
</app-drawer>
|
||||
|
||||
<!-- Main content -->
|
||||
<app-header-layout has-scrolling-region="">
|
||||
<!-- Main content -->
|
||||
<app-header-layout has-scrolling-region="">
|
||||
|
||||
<app-header slot="header" condenses="" reveals="" effects="waterfall">
|
||||
<app-toolbar>
|
||||
<paper-icon-button icon="my-icons:menu" drawer-toggle=""></paper-icon-button>
|
||||
<div main-title="">My App</div>
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
<app-header slot="header" condenses="" reveals="" effects="waterfall">
|
||||
<app-toolbar>
|
||||
<paper-icon-button icon="my-icons:menu" drawer-toggle=""></paper-icon-button>
|
||||
<div main-title="">My App</div>
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
|
||||
<iron-pages selected="[[page]]" attr-for-selected="name" role="main">
|
||||
<my-view1 name="view1"></my-view1>
|
||||
<my-view2 name="view2"></my-view2>
|
||||
<my-view3 name="view3"></my-view3>
|
||||
<my-view404 name="view404"></my-view404>
|
||||
</iron-pages>
|
||||
</app-header-layout>
|
||||
</app-drawer-layout>
|
||||
`;
|
||||
<iron-pages selected="[[page]]" attr-for-selected="name" role="main">
|
||||
<my-view1 name="view1"></my-view1>
|
||||
<my-view2 name="view2"></my-view2>
|
||||
<my-view3 name="view3"></my-view3>
|
||||
<my-view404 name="view404"></my-view404>
|
||||
</iron-pages>
|
||||
</app-header-layout>
|
||||
</app-drawer-layout>
|
||||
`;
|
||||
}
|
||||
|
||||
static get is() { return 'my-app'; }
|
||||
|
||||
static get properties() {
|
||||
return {
|
||||
page: {
|
||||
type: String,
|
||||
reflectToAttribute: true,
|
||||
observer: '_pageChanged',
|
||||
observer: '_pageChanged'
|
||||
},
|
||||
routeData: Object,
|
||||
subroute: Object
|
||||
@ -129,7 +129,7 @@ class MyApp extends PolymerElement {
|
||||
|
||||
static get observers() {
|
||||
return [
|
||||
'_routePageChanged(routeData.page)',
|
||||
'_routePageChanged(routeData.page)'
|
||||
];
|
||||
}
|
||||
|
||||
@ -171,4 +171,4 @@ class MyApp extends PolymerElement {
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define(MyApp.is, MyApp);
|
||||
window.customElements.define('my-app', MyApp);
|
||||
|
@ -1,7 +1,16 @@
|
||||
import '../node_modules/@polymer/iron-iconset-svg/iron-iconset-svg.js';
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
import '@polymer/iron-iconset-svg/iron-iconset-svg.js';
|
||||
const $_documentContainer = document.createElement('div');
|
||||
$_documentContainer.setAttribute('style', 'display: none;');
|
||||
|
||||
$_documentContainer.innerHTML = `<iron-iconset-svg name="my-icons" size="24">
|
||||
<svg>
|
||||
<defs>
|
||||
@ -22,14 +31,3 @@ $_documentContainer.innerHTML = `<iron-iconset-svg name="my-icons" size="24">
|
||||
</iron-iconset-svg>`;
|
||||
|
||||
document.head.appendChild($_documentContainer);
|
||||
|
||||
/**
|
||||
@license
|
||||
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
;
|
||||
|
@ -1,36 +1,35 @@
|
||||
import { PolymerElement } from '../node_modules/@polymer/polymer/polymer-element.js';
|
||||
import './shared-styles.js';
|
||||
import { html } from '../node_modules/@polymer/polymer/lib/utils/html-tag.js';
|
||||
/**
|
||||
@license
|
||||
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
* @license
|
||||
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
|
||||
import './shared-styles.js';
|
||||
|
||||
class MyView1 extends PolymerElement {
|
||||
static get template() {
|
||||
return html`
|
||||
<style include="shared-styles">
|
||||
:host {
|
||||
display: block;
|
||||
<style include="shared-styles">
|
||||
:host {
|
||||
display: block;
|
||||
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="card">
|
||||
<div class="circle">1</div>
|
||||
<h1>View One</h1>
|
||||
<p>Ut labores minimum atomorum pro. Laudem tibique ut has.</p>
|
||||
<p>Lorem ipsum dolor sit amet, per in nusquam nominavi periculis, sit elit oportere ea.Lorem ipsum dolor sit amet, per in nusquam nominavi periculis, sit elit oportere ea.Cu mei vide viris gloriatur, at populo eripuit sit.</p>
|
||||
</div>
|
||||
`;
|
||||
<div class="card">
|
||||
<div class="circle">1</div>
|
||||
<h1>View One</h1>
|
||||
<p>Ut labores minimum atomorum pro. Laudem tibique ut has.</p>
|
||||
<p>Lorem ipsum dolor sit amet, per in nusquam nominavi periculis, sit elit oportere ea.Lorem ipsum dolor sit amet, per in nusquam nominavi periculis, sit elit oportere ea.Cu mei vide viris gloriatur, at populo eripuit sit.</p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
static get is() { return 'my-view1'; }
|
||||
}
|
||||
|
||||
window.customElements.define(MyView1.is, MyView1);
|
||||
window.customElements.define('my-view1', MyView1);
|
||||
|
@ -1,36 +1,35 @@
|
||||
import { PolymerElement } from '../node_modules/@polymer/polymer/polymer-element.js';
|
||||
import './shared-styles.js';
|
||||
import { html } from '../node_modules/@polymer/polymer/lib/utils/html-tag.js';
|
||||
/**
|
||||
@license
|
||||
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
* @license
|
||||
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
|
||||
import './shared-styles.js';
|
||||
|
||||
class MyView2 extends PolymerElement {
|
||||
static get template() {
|
||||
return html`
|
||||
<style include="shared-styles">
|
||||
:host {
|
||||
display: block;
|
||||
<style include="shared-styles">
|
||||
:host {
|
||||
display: block;
|
||||
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="card">
|
||||
<div class="circle">2</div>
|
||||
<h1>View Two</h1>
|
||||
<p>Ea duis bonorum nec, falli paulo aliquid ei eum.</p>
|
||||
<p>Id nam odio natum malorum, tibique copiosae expetenda mel ea.Detracto suavitate repudiandae no eum. Id adhuc minim soluta nam.Id nam odio natum malorum, tibique copiosae expetenda mel ea.</p>
|
||||
</div>
|
||||
`;
|
||||
<div class="card">
|
||||
<div class="circle">2</div>
|
||||
<h1>View Two</h1>
|
||||
<p>Ea duis bonorum nec, falli paulo aliquid ei eum.</p>
|
||||
<p>Id nam odio natum malorum, tibique copiosae expetenda mel ea.Detracto suavitate repudiandae no eum. Id adhuc minim soluta nam.Id nam odio natum malorum, tibique copiosae expetenda mel ea.</p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
static get is() { return 'my-view2'; }
|
||||
}
|
||||
|
||||
window.customElements.define(MyView2.is, MyView2);
|
||||
window.customElements.define('my-view2', MyView2);
|
||||
|
@ -1,36 +1,35 @@
|
||||
import { PolymerElement } from '../node_modules/@polymer/polymer/polymer-element.js';
|
||||
import './shared-styles.js';
|
||||
import { html } from '../node_modules/@polymer/polymer/lib/utils/html-tag.js';
|
||||
/**
|
||||
@license
|
||||
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
* @license
|
||||
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
|
||||
import './shared-styles.js';
|
||||
|
||||
class MyView3 extends PolymerElement {
|
||||
static get template() {
|
||||
return html`
|
||||
<style include="shared-styles">
|
||||
:host {
|
||||
display: block;
|
||||
<style include="shared-styles">
|
||||
:host {
|
||||
display: block;
|
||||
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="card">
|
||||
<div class="circle">3</div>
|
||||
<h1>View Three</h1>
|
||||
<p>Modus commodo minimum eum te, vero utinam assueverit per eu.</p>
|
||||
<p>Ea duis bonorum nec, falli paulo aliquid ei eum.Has at minim mucius aliquam, est id tempor laoreet.Pro saepe pertinax ei, ad pri animal labores suscipiantur.</p>
|
||||
</div>
|
||||
`;
|
||||
<div class="card">
|
||||
<div class="circle">3</div>
|
||||
<h1>View Three</h1>
|
||||
<p>Modus commodo minimum eum te, vero utinam assueverit per eu.</p>
|
||||
<p>Ea duis bonorum nec, falli paulo aliquid ei eum.Has at minim mucius aliquam, est id tempor laoreet.Pro saepe pertinax ei, ad pri animal labores suscipiantur.</p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
static get is() { return 'my-view3'; }
|
||||
}
|
||||
|
||||
window.customElements.define(MyView3.is, MyView3);
|
||||
window.customElements.define('my-view3', MyView3);
|
||||
|
@ -1,30 +1,29 @@
|
||||
import { PolymerElement } from '../node_modules/@polymer/polymer/polymer-element.js';
|
||||
import { html } from '../node_modules/@polymer/polymer/lib/utils/html-tag.js';
|
||||
/**
|
||||
@license
|
||||
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
* @license
|
||||
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
|
||||
|
||||
class MyView404 extends PolymerElement {
|
||||
static get template() {
|
||||
return html`
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
|
||||
padding: 10px 20px;
|
||||
}
|
||||
</style>
|
||||
padding: 10px 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Oops you hit a 404. <a href="[[rootPath]]">Head back to home.</a>
|
||||
`;
|
||||
Oops you hit a 404. <a href="[[rootPath]]">Head back to home.</a>
|
||||
`;
|
||||
}
|
||||
|
||||
static get is() { return 'my-view404'; }
|
||||
}
|
||||
|
||||
window.customElements.define(MyView404.is, MyView404);
|
||||
window.customElements.define('my-view404', MyView404);
|
||||
|
@ -1,7 +1,17 @@
|
||||
import '../node_modules/@polymer/polymer/polymer-element.js';
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
import '@polymer/polymer/polymer-element.js';
|
||||
|
||||
const $_documentContainer = document.createElement('div');
|
||||
$_documentContainer.setAttribute('style', 'display: none;');
|
||||
|
||||
$_documentContainer.innerHTML = `<dom-module id="shared-styles">
|
||||
<template>
|
||||
<style>
|
||||
@ -36,15 +46,3 @@ $_documentContainer.innerHTML = `<dom-module id="shared-styles">
|
||||
</dom-module>`;
|
||||
|
||||
document.head.appendChild($_documentContainer);
|
||||
|
||||
/**
|
||||
@license
|
||||
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
/* shared styles for all views */
|
||||
;
|
||||
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"mocha": true
|
||||
},
|
||||
"globals": {
|
||||
"assert": false,
|
||||
"fixture": false,
|
||||
"WCT": false
|
||||
}
|
||||
}
|
@ -16,7 +16,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
|
||||
<title>Tests</title>
|
||||
|
||||
<script src="../../wct-browser-legacy/browser.js"></script>
|
||||
<script src="../node_modules/wct-browser-legacy/browser.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
@ -16,8 +16,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
|
||||
<title>my-view1</title>
|
||||
|
||||
<script src="../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../wct-browser-legacy/browser.js"></script>
|
||||
<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../node_modules/wct-browser-legacy/browser.js"></script>
|
||||
|
||||
<!-- Import the element to test -->
|
||||
<script type="module" src="../src/my-view1.js"></script>
|
||||
@ -30,14 +30,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
</test-fixture>
|
||||
|
||||
<script type="module">
|
||||
import '../src/my-view1.js';
|
||||
suite('my-view1 tests', function() {
|
||||
test('Number in circle should be 1', function() {
|
||||
var myView = fixture('BasicView');
|
||||
var circle = myView.shadowRoot.querySelector('.circle');
|
||||
assert.equal(circle.textContent, '1');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
suite('my-view1 tests', function() {
|
||||
test('Number in circle should be 1', function() {
|
||||
var myView = fixture('BasicView');
|
||||
var circle = myView.shadowRoot.querySelector('.circle');
|
||||
|
||||
assert.equal(circle.textContent, '1');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user