mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 05:21:52 +08:00
chore(): moved themes into ionic and created components folder.
This commit is contained in:
80
packages/ionic/demos/button/basic.html
Normal file
80
packages/ionic/demos/button/basic.html
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Ionic Slides Basic</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<script src="/dist/ionic-web/ionic.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<ion-app>
|
||||||
|
<ion-content>
|
||||||
|
<ion-button button-type="bar-button">Test button</ion-button>
|
||||||
|
|
||||||
|
<ion-button button-type="test-button">Test button</ion-button>
|
||||||
|
|
||||||
|
<ion-button button-type="test-button" class="my-test-button">Test button w/ class</ion-button>
|
||||||
|
|
||||||
|
<ion-button button-type="alert-radio-button">
|
||||||
|
Alert button
|
||||||
|
</ion-button>
|
||||||
|
|
||||||
|
<ion-button button-type="alert-radio-button" class="alert-tappable alert-radio" role="radio">
|
||||||
|
Alert button w/ class & role
|
||||||
|
</ion-button>
|
||||||
|
|
||||||
|
<ion-button href="#">Anchor Button</ion-button>
|
||||||
|
<a href="#">Anchor Link</a>
|
||||||
|
|
||||||
|
<h4>Colors</h4>
|
||||||
|
<ion-button>Default</ion-button>
|
||||||
|
<ion-button color="secondary">Secondary</ion-button>
|
||||||
|
<ion-button color="danger">Danger</ion-button>
|
||||||
|
<ion-button color="light">Light</ion-button>
|
||||||
|
<ion-button color="dark">Dark</ion-button>
|
||||||
|
|
||||||
|
<h4>Shapes</h4>
|
||||||
|
<ion-button full>Full Button</ion-button>
|
||||||
|
<ion-button block>Block Button</ion-button>
|
||||||
|
<ion-button round>Round Button</ion-button>
|
||||||
|
|
||||||
|
<h4>Outlines</h4>
|
||||||
|
<ion-button full outline>Outline + Full + No Color</ion-button>
|
||||||
|
<ion-button color="secondary" full outline>Outline + Full</ion-button>
|
||||||
|
<ion-button color="secondary" block outline>Outline + Block</ion-button>
|
||||||
|
<ion-button color="secondary" round outline>Outline + Round</ion-button>
|
||||||
|
|
||||||
|
<h4>Clear</h4>
|
||||||
|
<ion-button full clear>Clear + Full + No Color</ion-button>
|
||||||
|
<ion-button color="danger" full clear>Clear + Full</ion-button>
|
||||||
|
<ion-button color="danger" block clear>Clear + Block</ion-button>
|
||||||
|
<ion-button color="danger" round clear>Clear + Round</ion-button>
|
||||||
|
|
||||||
|
<h4>Icons</h4>
|
||||||
|
|
||||||
|
<ion-button color="dark">
|
||||||
|
<ion-icon slot="start" name="star"></ion-icon>
|
||||||
|
Left Icon
|
||||||
|
</ion-button>
|
||||||
|
|
||||||
|
<ion-button color="dark">
|
||||||
|
Right Icon
|
||||||
|
<ion-icon slot="end" name="star"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
|
||||||
|
<ion-button color="dark">
|
||||||
|
<ion-icon slot="icon-only" name="star"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
|
||||||
|
<h4>Sizes</h4>
|
||||||
|
<ion-button color="light" large>Large</ion-button>
|
||||||
|
<ion-button color="light">Default</ion-button>
|
||||||
|
<ion-button color="light" small>Small</ion-button>
|
||||||
|
|
||||||
|
<h4>States</h4>
|
||||||
|
<ion-button disabled>Large</ion-button>
|
||||||
|
<ion-button color="secondary" disabled clear>Large</ion-button>
|
||||||
|
</ion-content>
|
||||||
|
</ion-app>
|
||||||
|
</body>
|
||||||
|
</html>
|
248
packages/ionic/demos/button/toolbar.html
Normal file
248
packages/ionic/demos/button/toolbar.html
Normal file
@ -0,0 +1,248 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Ionic Slides Basic</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<script src="/dist/ionic-web/ionic.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<ion-app>
|
||||||
|
<ion-content>
|
||||||
|
<ion-toolbar no-padding>
|
||||||
|
<ion-title>This should have no padding</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>This is the title that never ends. It just goes on and on my friend.</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button>
|
||||||
|
<ion-icon slot="icon-only" name="contact"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
<ion-button>
|
||||||
|
<ion-icon slot="icon-only" name="search"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button color="secondary">
|
||||||
|
<ion-icon slot="icon-only" name="more"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>This is a long title with buttons. It just goes on and on my friend.</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar color="primary">
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button class="closeButton" clear>
|
||||||
|
Close
|
||||||
|
</ion-button>
|
||||||
|
<ion-button>
|
||||||
|
<ion-icon slot="icon-only" name="search"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button color="secondary">
|
||||||
|
<ion-icon slot="icon-only" name="more"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>This is a long title with buttons. It just goes on and on my friend.</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button>
|
||||||
|
<ion-icon slot="icon-only" name="contact"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
<ion-button>
|
||||||
|
<ion-icon slot="icon-only" name="search"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button color="secondary">
|
||||||
|
<ion-icon slot="icon-only" name="more"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Defaults</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button class="activated">
|
||||||
|
<ion-icon slot="icon-only" name="contact"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
<ion-button class="activated">
|
||||||
|
<ion-icon slot="icon-only" name="search"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button color="secondary" class="activated">
|
||||||
|
<ion-icon slot="icon-only" name="more"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Defaults.activated</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button solid>
|
||||||
|
<ion-icon slot="icon-only" name="contact"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
<ion-button solid>
|
||||||
|
<ion-icon name="contact" slot="start"></ion-icon>
|
||||||
|
Solid
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Solid</ion-title>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button solid color="secondary">
|
||||||
|
Help
|
||||||
|
<ion-icon name="help-circle" slot="end"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button solid class="activated">
|
||||||
|
<ion-icon slot="icon-only" name="contact"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
<ion-button solid class="activated">
|
||||||
|
<ion-icon name="contact" slot="start"></ion-icon>
|
||||||
|
Solid
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Solid Activated</ion-title>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button solid color="secondary" class="activated">
|
||||||
|
Help
|
||||||
|
<ion-icon name="help-circle" slot="end"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button outline>
|
||||||
|
<ion-icon slot="icon-only" name="contact"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
<ion-button outline>
|
||||||
|
<ion-icon name="star" slot="start"></ion-icon>
|
||||||
|
Star
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button color="secondary" outline>
|
||||||
|
<ion-icon slot="icon-only" name="contact"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Outline</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button outline class="activated">
|
||||||
|
<ion-icon slot="icon-only" name="contact"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
<ion-button outline class="activated">
|
||||||
|
<ion-icon name="star" slot="start"></ion-icon>
|
||||||
|
Star
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button color="secondary" outline class="activated">
|
||||||
|
<ion-icon slot="icon-only" name="contact"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Outline.activated</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button>
|
||||||
|
<ion-icon name="contact" slot="start"></ion-icon>
|
||||||
|
Clear
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button href="#">
|
||||||
|
Edit
|
||||||
|
<ion-icon name="create" slot="end"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Icon/Color Attr</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button>
|
||||||
|
Go Back
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button href="#">
|
||||||
|
Edit
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Text Only</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-button menuToggle slot="start">
|
||||||
|
<ion-icon name="menu"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button>
|
||||||
|
<ion-icon slot="icon-only" name="star"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Left side menu toggle</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button #button1 (click)="buttonClick(button1)">
|
||||||
|
<ion-icon slot="icon-only" name="star"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Right side menu toggle</ion-title>
|
||||||
|
<ion-button menuToggle slot="end">
|
||||||
|
<ion-icon name="menu"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button #button2 (click)="buttonClick(button2)">
|
||||||
|
<ion-icon slot="icon-only" name="search"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-segment color="secondary">
|
||||||
|
<ion-segment-button value="something">
|
||||||
|
Something
|
||||||
|
</ion-segment-button>
|
||||||
|
<ion-segment-button value="else">
|
||||||
|
Else
|
||||||
|
</ion-segment-button>
|
||||||
|
</ion-segment>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-segment>
|
||||||
|
<ion-segment-button value="light">
|
||||||
|
Light
|
||||||
|
</ion-segment-button>
|
||||||
|
<ion-segment-button value="toolbar">
|
||||||
|
Toolbar
|
||||||
|
</ion-segment-button>
|
||||||
|
<ion-segment-button value="default">
|
||||||
|
Default Segment
|
||||||
|
</ion-segment-button>
|
||||||
|
</ion-segment>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-content>
|
||||||
|
</ion-app>
|
||||||
|
</body>
|
||||||
|
</html>
|
58
packages/ionic/demos/core-hn-ssr/app.js
Normal file
58
packages/ionic/demos/core-hn-ssr/app.js
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
var express = require('express');
|
||||||
|
var app = express();
|
||||||
|
var ionicUniversal = require('../../dist/ionic-universal');
|
||||||
|
var fs = require('fs');
|
||||||
|
var path = require('path');
|
||||||
|
|
||||||
|
|
||||||
|
var ionicServerConfig = {
|
||||||
|
staticDir: path.join('../../dist/ionic-web')
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('load components from:', ionicServerConfig.staticDir);
|
||||||
|
|
||||||
|
|
||||||
|
var ionic = ionicUniversal.init(ionicServerConfig);
|
||||||
|
|
||||||
|
|
||||||
|
app.get('/', function (req, res) {
|
||||||
|
console.time(`serve: ${req.url}`);
|
||||||
|
|
||||||
|
var filePath = path.join(__dirname, '../core-hn/index.html');
|
||||||
|
|
||||||
|
fs.readFile(filePath, 'utf-8', (err, html) => {
|
||||||
|
if (err) {
|
||||||
|
console.error(err);
|
||||||
|
res.send(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var opts = {
|
||||||
|
req: req
|
||||||
|
};
|
||||||
|
|
||||||
|
ionic.hydrate(html, opts).then(hydratedHtml => {
|
||||||
|
console.timeEnd(`serve: ${req.url}`);
|
||||||
|
res.send(hydratedHtml);
|
||||||
|
|
||||||
|
}).catch(err => {
|
||||||
|
res.send(err.toString() + err.stack && err.stack.toString());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
app.get('/dist/*', function (req, res) {
|
||||||
|
// manually serve other dist files
|
||||||
|
var filePath = path.join(__dirname, '../../', req.url);
|
||||||
|
console.log(filePath)
|
||||||
|
fs.readFile(filePath, 'utf-8', (err, data) => {
|
||||||
|
res.send(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
app.listen(3000, () => {
|
||||||
|
console.log('app listening on port 3000!');
|
||||||
|
});
|
9
packages/ionic/demos/core-hn-ssr/package.json
Normal file
9
packages/ionic/demos/core-hn-ssr/package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "core-hn-ssr",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.0.1",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"express": "^4.15.2"
|
||||||
|
}
|
||||||
|
}
|
8
packages/ionic/demos/core-hn-ssr/readme.md
Normal file
8
packages/ionic/demos/core-hn-ssr/readme.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Core HN SSR
|
||||||
|
|
||||||
|
npm install
|
||||||
|
|
||||||
|
node app.js
|
||||||
|
|
||||||
|
|
||||||
|
[http://localhost:3000/](http://localhost:3000/)
|
20
packages/ionic/demos/core-hn/index.html
Normal file
20
packages/ionic/demos/core-hn/index.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html dir="ltr">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Ionic Example</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<meta name="format-detection" content="telephone=no">
|
||||||
|
<meta name="msapplication-tap-highlight" content="no">
|
||||||
|
|
||||||
|
<script src="/dist/ionic-web/ionic.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<ion-app>
|
||||||
|
<news-container></news-container>
|
||||||
|
</ion-app>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
1
packages/ionic/demos/core-hn/ionic.svg
Normal file
1
packages/ionic/demos/core-hn/ionic.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#FFFFFF" d="M256 164.3c-50.6 0-91.7 41.1-91.7 91.7s41.1 91.7 91.7 91.7 91.7-41.1 91.7-91.7-41.1-91.7-91.7-91.7z"/><circle fill="#FFFFFF" cx="394" cy="124.6" r="43.8"/><path fill="#FFFFFF" d="M445.3 169.8c-7.4 8.4-16.9 15-27.6 19 8.6 20.7 13.4 43.4 13.4 67.2 0 96.6-78.6 175.2-175.2 175.2S80.7 352.6 80.7 256 159.3 80.8 255.9 80.8c26.9 0 52.3 6.1 75.1 16.9 4.5-10.5 11.5-19.6 20.3-26.6C322.8 56.4 290.4 48 256 48 141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208c0-30.7-6.7-59.9-18.7-86.2z"/></svg>
|
After Width: | Height: | Size: 580 B |
59
packages/ionic/demos/fiber-demo/index.html
Normal file
59
packages/ionic/demos/fiber-demo/index.html
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html style="width: 100%; height: 100%; overflow: hidden">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Ionic Perf Demo</title>
|
||||||
|
<script src="/dist/ionic-web/ionic.js"></script>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background: #fff;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 1.7;
|
||||||
|
margin: 0;
|
||||||
|
padding: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #4a8bfc;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
font-size: 2.0em;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0 0 15px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo {
|
||||||
|
font-weight: 500;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo:hover {
|
||||||
|
color: #317bfc;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Ionic Perf Demo</h1>
|
||||||
|
<p>
|
||||||
|
The goal of this demo is to show smooth animations while at
|
||||||
|
the same time updating 729 text nodes every second. Only one property
|
||||||
|
is updated at the root node, which is then passed down through over
|
||||||
|
1,700 nodes every second. Additionally, user interactions, such as
|
||||||
|
mouseenter and mouseleave, take precedence, yet should not interfer with
|
||||||
|
animations and node updates. This demo was adopted from the
|
||||||
|
<a href="https://claudiopro.github.io/react-fiber-vs-stack-demo/">React Fiber demo</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<a class="demo" href="perf.html">Show Demo</a>
|
||||||
|
</body>
|
||||||
|
</html>
|
57
packages/ionic/demos/fiber-demo/perf.html
Normal file
57
packages/ionic/demos/fiber-demo/perf.html
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html style="width: 100%; height: 100%; overflow: hidden">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Ionic Perf Demo</title>
|
||||||
|
<script src="/dist/ionic-web/ionic.js"></script>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background: #fff;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 1.7;
|
||||||
|
margin: 0;
|
||||||
|
padding: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #4183c4;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
font-size: 2.0em;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0 0 15px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 2;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Ionic Perf Demo</h1>
|
||||||
|
|
||||||
|
<fiber-demo></fiber-demo>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var start = Date.now();
|
||||||
|
var baseEl = document.querySelector('fiber-demo');
|
||||||
|
|
||||||
|
function update() {
|
||||||
|
baseEl.elapsed = Date.now() - start;
|
||||||
|
requestAnimationFrame(update);
|
||||||
|
}
|
||||||
|
|
||||||
|
requestAnimationFrame(update);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
47
packages/ionic/demos/inside-shadow/index.html
Normal file
47
packages/ionic/demos/inside-shadow/index.html
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Ionic</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<script src="/dist/ionic-web/ionic.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<ion-app>
|
||||||
|
|
||||||
|
<ion-page>
|
||||||
|
|
||||||
|
<button-bar></button-bar>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
class ButtonBar extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
const shadowRoot = this.attachShadow({ mode: 'open' });
|
||||||
|
shadowRoot.innerHTML = `
|
||||||
|
<style>
|
||||||
|
:host {
|
||||||
|
|
||||||
|
};
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-button>News</ion-button>
|
||||||
|
</ion-toolbar>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
customElements.define('button-bar', ButtonBar)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
|
|
||||||
|
</ion-page>
|
||||||
|
|
||||||
|
</ion-app>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
70
packages/ionic/demos/item/basic.html
Normal file
70
packages/ionic/demos/item/basic.html
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Ionic Slides Basic</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<script src="/dist/ionic-web/ionic.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<ion-app>
|
||||||
|
<ion-header>
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>Button Icons</ion-title>
|
||||||
|
<ion-buttons slot="end">
|
||||||
|
<ion-button color="secondary">
|
||||||
|
Default
|
||||||
|
<ion-icon name="star" slot="end"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
<ion-button color="secondary">
|
||||||
|
<ion-icon slot="icon-only" name="home"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Item Icons</ion-label>
|
||||||
|
<ion-icon name="heart" slot="end"></ion-icon>
|
||||||
|
<ion-icon name="star" slot="start"></ion-icon>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Item No Size Button</ion-label>
|
||||||
|
<ion-button slot="start"><ion-icon name="heart" slot="end"></ion-icon>Start Button</ion-button>
|
||||||
|
<ion-button slot="end">End Button<ion-icon name="star" slot="start"></ion-icon></ion-button>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Item Outline Button</ion-label>
|
||||||
|
<ion-button outline slot="start"><ion-icon name="heart" slot="end"></ion-icon>Start Button</ion-button>
|
||||||
|
<ion-button outline slot="end">End Button<ion-icon name="star" slot="start"></ion-icon></ion-button>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Item Large Button</ion-label>
|
||||||
|
<ion-button large slot="start"><ion-icon name="star" slot="end"></ion-icon>Start Button</ion-button>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Item Large Button</ion-label>
|
||||||
|
<ion-button large slot="end">End Button<ion-icon name="star" slot="start"></ion-icon></ion-button>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Item Small Button</ion-label>
|
||||||
|
<ion-button small slot="start"><ion-icon name="star" slot="end"></ion-icon>Start Button</ion-button>
|
||||||
|
<ion-button small slot="end">End Button<ion-icon name="star" slot="start"></ion-icon></ion-button>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Item Default Button</ion-label>
|
||||||
|
<ion-button default slot="start"><ion-icon name="star" slot="end"></ion-icon>Start Button</ion-button>
|
||||||
|
<ion-button default slot="end">End Button<ion-icon name="star" slot="start"></ion-icon></ion-button>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
|
</ion-app>
|
||||||
|
</body>
|
||||||
|
</html>
|
18
packages/ionic/demos/react/.gitignore
vendored
Normal file
18
packages/ionic/demos/react/.gitignore
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
|
||||||
|
# testing
|
||||||
|
/coverage
|
||||||
|
|
||||||
|
# production
|
||||||
|
/build
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
.env
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
1603
packages/ionic/demos/react/README.md
Normal file
1603
packages/ionic/demos/react/README.md
Normal file
File diff suppressed because it is too large
Load Diff
18
packages/ionic/demos/react/package.json
Normal file
18
packages/ionic/demos/react/package.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "react-demo",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"react": "^15.4.2",
|
||||||
|
"react-dom": "^15.4.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"react-scripts": "0.9.4"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "react-scripts start",
|
||||||
|
"build": "react-scripts build",
|
||||||
|
"test": "react-scripts test --env=jsdom",
|
||||||
|
"eject": "react-scripts eject"
|
||||||
|
}
|
||||||
|
}
|
BIN
packages/ionic/demos/react/public/favicon.ico
Normal file
BIN
packages/ionic/demos/react/public/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
35
packages/ionic/demos/react/public/index.html
Normal file
35
packages/ionic/demos/react/public/index.html
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Ionic Web</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<meta name="format-detection" content="telephone=no">
|
||||||
|
<meta name="msapplication-tap-highlight" content="no">
|
||||||
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||||
|
<script src="%PUBLIC_URL%/ionic.web.js"></script>
|
||||||
|
<!--
|
||||||
|
Notice the use of %PUBLIC_URL% in the tag above.
|
||||||
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
|
|
||||||
|
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||||
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
|
-->
|
||||||
|
<title>React App</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<!--
|
||||||
|
This HTML file is a template.
|
||||||
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|
||||||
|
You can add webfonts, meta tags, or analytics to this file.
|
||||||
|
The build step will place the bundled scripts into the <body> tag.
|
||||||
|
|
||||||
|
To begin the development, run `npm start`.
|
||||||
|
To create a production bundle, use `npm run build`.
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
1149
packages/ionic/demos/react/public/ionic.web.js
Normal file
1149
packages/ionic/demos/react/public/ionic.web.js
Normal file
File diff suppressed because it is too large
Load Diff
24
packages/ionic/demos/react/src/App.css
Normal file
24
packages/ionic/demos/react/src/App.css
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
.App {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.App-logo {
|
||||||
|
animation: App-logo-spin infinite 20s linear;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.App-header {
|
||||||
|
background-color: #222;
|
||||||
|
height: 150px;
|
||||||
|
padding: 20px;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.App-intro {
|
||||||
|
font-size: large;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes App-logo-spin {
|
||||||
|
from { transform: rotate(0deg); }
|
||||||
|
to { transform: rotate(360deg); }
|
||||||
|
}
|
43
packages/ionic/demos/react/src/App.js
Normal file
43
packages/ionic/demos/react/src/App.js
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
import logo from './logo.svg';
|
||||||
|
import './App.css';
|
||||||
|
|
||||||
|
class App extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
text: `Hello`,
|
||||||
|
num: 1
|
||||||
|
};
|
||||||
|
}
|
||||||
|
componentDidMount() {
|
||||||
|
setInterval(() => {
|
||||||
|
this.setState({
|
||||||
|
num: this.state.num += 1
|
||||||
|
});
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div className="App">
|
||||||
|
<div className="App-header">
|
||||||
|
<img src={logo} className="App-logo" alt="logo" />
|
||||||
|
<h2>Welcome to React</h2>
|
||||||
|
</div>
|
||||||
|
<p className="App-intro">
|
||||||
|
To get started, edit <code>src/App.js</code> and save to reload.
|
||||||
|
</p>
|
||||||
|
<ion-item>
|
||||||
|
<ion-checkbox>{this.state.text}{this.state.num}</ion-checkbox>
|
||||||
|
<ion-label>{this.state.text}{this.state.num}</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item>
|
||||||
|
<ion-checkbox>{this.state.text}{this.state.num}</ion-checkbox>
|
||||||
|
{this.state.text}{this.state.num}
|
||||||
|
</ion-item>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
8
packages/ionic/demos/react/src/App.test.js
Normal file
8
packages/ionic/demos/react/src/App.test.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import ReactDOM from 'react-dom';
|
||||||
|
import App from './App';
|
||||||
|
|
||||||
|
it('renders without crashing', () => {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
ReactDOM.render(<App />, div);
|
||||||
|
});
|
5
packages/ionic/demos/react/src/index.css
Normal file
5
packages/ionic/demos/react/src/index.css
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-family: sans-serif;
|
||||||
|
}
|
9
packages/ionic/demos/react/src/index.js
Normal file
9
packages/ionic/demos/react/src/index.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import ReactDOM from 'react-dom';
|
||||||
|
import App from './App';
|
||||||
|
import './index.css';
|
||||||
|
|
||||||
|
ReactDOM.render(
|
||||||
|
<App />,
|
||||||
|
document.getElementById('root')
|
||||||
|
);
|
7
packages/ionic/demos/react/src/logo.svg
Normal file
7
packages/ionic/demos/react/src/logo.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
|
||||||
|
<g fill="#61DAFB">
|
||||||
|
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
|
||||||
|
<circle cx="420.9" cy="296.5" r="45.7"/>
|
||||||
|
<path d="M520.5 78.1z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
33
packages/ionic/demos/slider/index.html
Normal file
33
packages/ionic/demos/slider/index.html
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Ionic Slides Basic</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<script src="/dist/ionic-web/ionic.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<ion-slides style="background: black"
|
||||||
|
(ionSlideWillChange)="onSlideWillChange($event)"
|
||||||
|
(ionSlideDidChange)="onSlideDidChange($event)"
|
||||||
|
(ionSlideDrag)="onSlideDrag($event)"
|
||||||
|
pager="true"
|
||||||
|
effect="flip">
|
||||||
|
|
||||||
|
<ion-slide style="background: red; color: white;">
|
||||||
|
<h1>Slide 1</h1>
|
||||||
|
</ion-slide>
|
||||||
|
|
||||||
|
<ion-slide style="background: white; color: blue;">
|
||||||
|
<h1>Slide 2</h1>
|
||||||
|
</ion-slide>
|
||||||
|
|
||||||
|
<ion-slide style="background: blue; color: white;">
|
||||||
|
<h1>Slide 3</h1>
|
||||||
|
</ion-slide>
|
||||||
|
|
||||||
|
</ion-slides>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
18
packages/ionic/demos/test/index.html
Normal file
18
packages/ionic/demos/test/index.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Ionic Slides Basic</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<script src="/dist/ionic-web/ionic.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<ion-app>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Item Icons</ion-label>
|
||||||
|
<ion-icon name="heart" slot="end"></ion-icon>
|
||||||
|
<ion-icon name="star" slot="start"></ion-icon>
|
||||||
|
</ion-item>
|
||||||
|
</ion-app>
|
||||||
|
</body>
|
||||||
|
</html>
|
53
packages/ionic/demos/universal/app.js
Normal file
53
packages/ionic/demos/universal/app.js
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
var express = require('express');
|
||||||
|
var app = express();
|
||||||
|
var fs = require('fs');
|
||||||
|
var path = require('path');
|
||||||
|
|
||||||
|
|
||||||
|
var stencil = require('../../dist/stencil-server-renderer');
|
||||||
|
var renderer = stencil.createRenderer({
|
||||||
|
staticDir: path.join('../../dist/ionic-web'),
|
||||||
|
debug: true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
app.get('/', function (req, res, next) {
|
||||||
|
console.log(`serve: ${req.url}`);
|
||||||
|
|
||||||
|
var filePath = path.join(__dirname, '../vanilla/index.html');
|
||||||
|
|
||||||
|
fs.readFile(filePath, 'utf-8', (err, html) => {
|
||||||
|
if (err) {
|
||||||
|
console.error(err);
|
||||||
|
res.send(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
renderer.hydrateToString(
|
||||||
|
{
|
||||||
|
html: html,
|
||||||
|
req: req,
|
||||||
|
config: {}
|
||||||
|
},
|
||||||
|
function(err, html) {
|
||||||
|
res.send(html);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
app.get('/dist/*', function (req, res) {
|
||||||
|
// manually serve other dist files
|
||||||
|
var filePath = path.join(__dirname, '../../', req.url);
|
||||||
|
console.log(filePath)
|
||||||
|
fs.readFile(filePath, 'utf-8', (err, data) => {
|
||||||
|
res.send(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
app.listen(3000, () => {
|
||||||
|
console.log('app listening on port 3000!');
|
||||||
|
});
|
12
packages/ionic/demos/universal/package.json
Normal file
12
packages/ionic/demos/universal/package.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "universal-demo",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.0.1",
|
||||||
|
"license": "MIT",
|
||||||
|
"scripts": {
|
||||||
|
"serve": "node app.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"express": "^4.15.2"
|
||||||
|
}
|
||||||
|
}
|
8
packages/ionic/demos/universal/readme.md
Normal file
8
packages/ionic/demos/universal/readme.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Ionic Universal
|
||||||
|
|
||||||
|
npm install
|
||||||
|
|
||||||
|
node app.js
|
||||||
|
|
||||||
|
|
||||||
|
[http://localhost:3000/](http://localhost:3000/)
|
120
packages/ionic/demos/user-component/index.html
Normal file
120
packages/ionic/demos/user-component/index.html
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Ionic</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<script src="/dist/ionic-web/ionic.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<button id="presentModal">Present Modal</button>
|
||||||
|
|
||||||
|
<my-app></my-app>
|
||||||
|
|
||||||
|
<my-other-app></my-other-app>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('presentModal').addEventListener('click', function() {
|
||||||
|
var userId = Math.round(Math.random() * 10000);
|
||||||
|
|
||||||
|
console.log('open profile modal for userId:', userId);
|
||||||
|
|
||||||
|
Ionic.controller('modal', { component: 'profile-page', componentProps: { userId: userId } }).then(modal => {
|
||||||
|
console.log('start presenting modal, userId:', modal.componentProps.userId);
|
||||||
|
|
||||||
|
modal.present().then(() => {
|
||||||
|
console.log('finished presenting modal, userId:', modal.componentProps.userId);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
class MyApp extends HTMLElement {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
const shadowRoot = this.attachShadow({mode: 'open'});
|
||||||
|
|
||||||
|
shadowRoot.innerHTML = `
|
||||||
|
<ion-card>
|
||||||
|
<ion-card-header>Header</ion-card-header>
|
||||||
|
<ion-card-content>Content</ion-card-content>
|
||||||
|
</ion-card>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
customElements.define('my-app', MyApp);
|
||||||
|
|
||||||
|
|
||||||
|
class MyOtherApp extends HTMLElement {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
const shadowRoot = this.attachShadow({mode: 'open'});
|
||||||
|
|
||||||
|
shadowRoot.innerHTML = `
|
||||||
|
<style>
|
||||||
|
.card-header {
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
.card-content {
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<ion-card>
|
||||||
|
<ion-card-header>Header</ion-card-header>
|
||||||
|
<ion-card-content>Content</ion-card-content>
|
||||||
|
</ion-card>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
customElements.define('my-other-app', MyOtherApp);
|
||||||
|
|
||||||
|
|
||||||
|
class ProfilePage extends HTMLElement {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
const shadowRoot = this.attachShadow({mode: 'open'});
|
||||||
|
|
||||||
|
shadowRoot.innerHTML = `
|
||||||
|
<ion-header>
|
||||||
|
<ion-toolbar>
|
||||||
|
My Profile
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content padding>
|
||||||
|
<p>User Id: <span id="userId"></span></p>
|
||||||
|
<p>
|
||||||
|
<ion-button>Dismiss</ion-button>
|
||||||
|
</p>
|
||||||
|
</ion-content>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
connectedCallback() {
|
||||||
|
var btn = this.shadowRoot.querySelector('ion-button');
|
||||||
|
|
||||||
|
btn.addEventListener('click', (uiEvent) => {
|
||||||
|
console.log('dismiss profile page for userId:', this.userId);
|
||||||
|
var ev = new CustomEvent('ionDismiss', { composed: true, bubbles: true });
|
||||||
|
uiEvent.target.dispatchEvent(ev);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.shadowRoot.getElementById('userId').textContent = this.userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
customElements.define('profile-page', ProfilePage);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
179
packages/ionic/demos/vanilla/icon/index.html
Normal file
179
packages/ionic/demos/vanilla/icon/index.html
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html dir="ltr">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Ionic</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<script src="/dist/ionic-web/ionic.js"></script>
|
||||||
|
<style>
|
||||||
|
profile-modal {
|
||||||
|
background: red;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<ion-app>
|
||||||
|
|
||||||
|
<ion-page>
|
||||||
|
|
||||||
|
|
||||||
|
<ion-header>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>Icons</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
|
||||||
|
<ion-list>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon id="dynamicColor" name="home" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
dynamicColor name="home"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon name="home" is-active="true" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
name="home" is-active="true"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon id="dynamicProp" is-active="false" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
dynamicProp is-active="false"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon id="dynamicAttr" is-active="false" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
dynamicAttr is-active="false"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon name="md-home" is-active="true" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
name="md-home" is-active="true"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon name="ios-home" is-active="true" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
name="ios-home" is-active="true"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon name="ios-home" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
name="ios-home"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon name="ios-home-outline" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
name="ios-home-outline"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon name="ios-home-outline" is-active="false" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
name="ios-home-outline" is-active="false"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon name="md-home" color="primary" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
name="md-home"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon name="logo-twitter" color="secondary" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
name="logo-twitter"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon ios="logo-apple" md="logo-android" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
ios="logo-apple" md="logo-android"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon ios="md-color-filter" md="ios-color-filter" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
ios="md-color-filter" md="ios-color-filter"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon ios="md-color-filter" md="ios-color-filter" is-active="false" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
ios="md-color-filter" md="ios-color-filter" is-active="false"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
name="null"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-icon name="home" hidden="true" slot="start"></ion-icon>
|
||||||
|
<code>
|
||||||
|
name="home" hidden="true"
|
||||||
|
</code>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
</ion-list>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var dynamicColor = document.getElementById('dynamicColor');
|
||||||
|
var dynamicProp = document.getElementById('dynamicProp');
|
||||||
|
var dynamicAttr = document.getElementById('dynamicAttr');
|
||||||
|
|
||||||
|
dynamicColor.setAttribute('color', 'danger');
|
||||||
|
|
||||||
|
let interval = setInterval(function () {
|
||||||
|
if (dynamicProp.name === 'home') {
|
||||||
|
dynamicProp.name = 'ios-home';
|
||||||
|
dynamicAttr.setAttribute('name', 'ios-home');
|
||||||
|
} else if (dynamicProp.name === 'ios-home') {
|
||||||
|
dynamicProp.name = 'md-home';
|
||||||
|
dynamicAttr.setAttribute('name', 'md-home');
|
||||||
|
} else {
|
||||||
|
dynamicProp.name = 'home';
|
||||||
|
dynamicAttr.setAttribute('name', 'home');
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
clearInterval(interval);
|
||||||
|
}, 4000);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
|
</ion-page>
|
||||||
|
</ion-app>
|
||||||
|
</body>
|
||||||
|
</html>
|
305
packages/ionic/demos/vanilla/index.html
Normal file
305
packages/ionic/demos/vanilla/index.html
Normal file
@ -0,0 +1,305 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html dir="ltr">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<script>
|
||||||
|
console.time('app-load');
|
||||||
|
</script>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Ionic</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<!--<script src="/dist/ionic-web/ionic.js"></script>-->
|
||||||
|
<style>
|
||||||
|
profile-modal {
|
||||||
|
background: red;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<ion-app>
|
||||||
|
|
||||||
|
<ion-menu ssr="false" content="#menu-content">
|
||||||
|
<ion-header>
|
||||||
|
Menu Header
|
||||||
|
</ion-header>
|
||||||
|
<ion-content>
|
||||||
|
Menu Content
|
||||||
|
</ion-content>
|
||||||
|
</ion-menu>
|
||||||
|
|
||||||
|
<ion-page id="menu-content">
|
||||||
|
|
||||||
|
<ion-header md-height="77px" ios-height="61px">
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>Header</ion-title>
|
||||||
|
<ion-buttons slot="end">
|
||||||
|
<ion-button id="toggleMenu">Menu</ion-button>
|
||||||
|
<ion-button id="presentModal">Modal</ion-button>
|
||||||
|
<ion-button id="presentLoading">Loading</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
</ion-toolbar>
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>Buttons</ion-title>
|
||||||
|
<ion-buttons slot="mode-start">
|
||||||
|
<ion-button id="presentLoading">M.Start</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons slot="mode-end">
|
||||||
|
<ion-button id="presentLoading">M.End</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons slot="start">
|
||||||
|
<ion-button id="presentLoading">Start</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons slot="end">
|
||||||
|
<ion-button id="presentLoading">End</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content id="content" fullscreen>
|
||||||
|
|
||||||
|
<ion-list>
|
||||||
|
|
||||||
|
<ion-item-divider>
|
||||||
|
<div slot="start">item start</div>
|
||||||
|
<div slot="end">item end</div>
|
||||||
|
<ion-label>Item Divider</ion-label>
|
||||||
|
</ion-item-divider>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-button slot="start">Default</ion-button>
|
||||||
|
<div slot="end">item end</div>
|
||||||
|
<ion-label>Hello!</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label><b>Item Label</b></ion-label>
|
||||||
|
<ion-item slot="start">
|
||||||
|
<div slot="start">start</div>
|
||||||
|
<div slot="end">end</div>
|
||||||
|
<ion-label>Item Start</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Hello</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-avatar slot="start"><img src="http://placehold.it/150x150" /></ion-avatar>
|
||||||
|
<ion-label>Avatar</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-toggle slot="start"></ion-toggle>
|
||||||
|
<ion-label>Toggle Enabled</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-toggle slot="start" disabled></ion-toggle>
|
||||||
|
<ion-label>Toggle Disabled</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-toggle slot="end"></ion-toggle>
|
||||||
|
<ion-label>Toggle</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item-divider color="secondary">
|
||||||
|
<div slot="start">item start</div>
|
||||||
|
<div slot="end">item end</div>
|
||||||
|
<ion-label>Item Divider</ion-label>
|
||||||
|
</ion-item-divider>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-thumbnail slot="end"><img src="http://placehold.it/150x150" /></ion-thumbnail>
|
||||||
|
<ion-label>Thumbnail</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Gender</ion-label>
|
||||||
|
<ion-select [(ngModel)]="login.gender" formControlName="gender">
|
||||||
|
<ion-option value="f">Female</ion-option>
|
||||||
|
<ion-option value="m">Male</ion-option>
|
||||||
|
</ion-select>
|
||||||
|
</ion-item>
|
||||||
|
</ion-list>
|
||||||
|
|
||||||
|
<ion-card>
|
||||||
|
<ion-card-header>
|
||||||
|
Card Header
|
||||||
|
</ion-card-header>
|
||||||
|
<ion-card-content>
|
||||||
|
Card Content
|
||||||
|
<h1>Heading 1</h1>
|
||||||
|
<h2>Heading 2</h2>
|
||||||
|
</ion-card-content>
|
||||||
|
</ion-card>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ion-toggle checked></ion-toggle>Toggle
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<ion-toggle disabled></ion-toggle>Toggle Disabled
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ion-badge></ion-badge>
|
||||||
|
<ion-badge>default</ion-badge>
|
||||||
|
<ion-badge color="secondary">secondary</ion-badge>
|
||||||
|
<ion-badge color="danger">danger</ion-badge>
|
||||||
|
<ion-badge color="light">light</ion-badge>
|
||||||
|
<ion-badge color="dark">dark</ion-badge>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ion-badge id="dynamicProp">dynamic property</ion-badge>
|
||||||
|
<ion-badge id="dynamicAttr">dynamic attribute</ion-badge>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p id="dynamicBadges"></p>
|
||||||
|
|
||||||
|
<ion-button>Default</ion-button>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
var content = document.getElementById('content');
|
||||||
|
content.addEventListener('ionScrollStart', function(ev) {
|
||||||
|
console.log('ionScrollStart', ev.detail.directionY);
|
||||||
|
});
|
||||||
|
content.addEventListener('ionScroll', function(ev) {
|
||||||
|
console.log('ionScroll', ev.detail.directionY);
|
||||||
|
});
|
||||||
|
content.addEventListener('ionScrollEnd', function(ev) {
|
||||||
|
console.log('ionScrollEnd', ev.detail.directionY);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var dynamicProp = document.getElementById('dynamicProp');
|
||||||
|
var dynamicAttr = document.getElementById('dynamicAttr');
|
||||||
|
|
||||||
|
setInterval(function () {
|
||||||
|
if (dynamicProp.color === 'secondary') {
|
||||||
|
dynamicProp.color = 'danger';
|
||||||
|
dynamicAttr.setAttribute('color', 'danger');
|
||||||
|
|
||||||
|
} else if (dynamicProp.color === 'danger') {
|
||||||
|
dynamicProp.color = 'light';
|
||||||
|
dynamicAttr.setAttribute('color', 'light');
|
||||||
|
|
||||||
|
} else if (dynamicProp.color === 'light') {
|
||||||
|
dynamicProp.color = 'dark';
|
||||||
|
dynamicAttr.setAttribute('color', 'dark');
|
||||||
|
|
||||||
|
} else if (dynamicProp.color === 'dark') {
|
||||||
|
dynamicProp.color = 'primary';
|
||||||
|
dynamicAttr.setAttribute('color', 'primary');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
dynamicProp.color = 'secondary';
|
||||||
|
dynamicAttr.setAttribute('color', 'secondary');
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
|
||||||
|
var dynamicBadges = document.getElementById('dynamicBadges');
|
||||||
|
for (var i = 0; i < 100; i++) {
|
||||||
|
var div = document.createElement('div');
|
||||||
|
div.innerHTML = '<ion-badge>' + i + '</ion-badge>';
|
||||||
|
dynamicBadges.appendChild(div);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
document.getElementById('presentModal').addEventListener('click', function() {
|
||||||
|
var userId = Math.round(Math.random() * 10000);
|
||||||
|
|
||||||
|
console.log('open profile modal for userId:', userId);
|
||||||
|
|
||||||
|
Ionic.controller('modal', { component: 'profile-page', componentProps: { userId: userId } }).then(modal => {
|
||||||
|
console.log('start presenting modal, userId:', modal.componentProps.userId);
|
||||||
|
|
||||||
|
modal.present().then(() => {
|
||||||
|
console.log('finished presenting modal, userId:', modal.componentProps.userId);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
class ProfilePage extends HTMLElement {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
const shadowRoot = this.attachShadow({mode: 'open'});
|
||||||
|
|
||||||
|
shadowRoot.innerHTML = `
|
||||||
|
<ion-header>
|
||||||
|
<ion-toolbar>
|
||||||
|
My Profile
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content padding>
|
||||||
|
<p>User Id: <span id="userId"></span></p>
|
||||||
|
<p>
|
||||||
|
<ion-button>Dismiss</ion-button>
|
||||||
|
</p>
|
||||||
|
</ion-content>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
connectedCallback() {
|
||||||
|
var btn = this.shadowRoot.querySelector('ion-button');
|
||||||
|
|
||||||
|
btn.addEventListener('click', (uiEvent) => {
|
||||||
|
console.log('dismiss profile page for userId:', this.userId);
|
||||||
|
var ev = new CustomEvent('ionDismiss', { composed: true, bubbles: true });
|
||||||
|
uiEvent.target.dispatchEvent(ev);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.shadowRoot.getElementById('userId').textContent = this.userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
customElements.define('profile-page', ProfilePage);
|
||||||
|
|
||||||
|
|
||||||
|
document.getElementById('presentLoading').addEventListener('click', function() {
|
||||||
|
console.log('open loading');
|
||||||
|
|
||||||
|
Ionic.controller('loading', { duration: 1000 }).then(loading => {
|
||||||
|
console.log('start presenting loading');
|
||||||
|
|
||||||
|
loading.present().then(() => {
|
||||||
|
console.log('finished presenting loading');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
document.getElementById('toggleMenu').addEventListener('click', function() {
|
||||||
|
console.log('toggle menu');
|
||||||
|
|
||||||
|
Ionic.controller('menu').then(menuCtrl => {
|
||||||
|
console.log('start menu toggle');
|
||||||
|
|
||||||
|
menuCtrl.toggle().then(() => {
|
||||||
|
console.log('finished menu toggle');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener('ionLoad', function() {
|
||||||
|
console.timeEnd('app-load');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
|
|
||||||
|
</ion-page>
|
||||||
|
|
||||||
|
</ion-app>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user