Skip to content

Commit 2e3abea

Browse files
committed
update examples
1 parent b60f1a2 commit 2e3abea

File tree

8 files changed

+70
-66
lines changed

8 files changed

+70
-66
lines changed

examples/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# ![](viewer/jquery.svg)
3+
4+
coming soon...

examples/index.html

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,11 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<style>
5-
6-
* {
7-
box-sizing: border-box;
8-
}
9-
10-
html, body, #app {
11-
width: 100%;
12-
padding: 20px;
13-
margin: 0;
14-
box-sizing: border-box;
15-
font-family: "Segoe UI", "Helvetica Neue";
16-
font-size: 13px;
17-
}
18-
19-
.ax-headers-view {
20-
font-weight: bold;
21-
color: #666;
22-
border-bottom: 1px solid #aaa;
23-
}
24-
25-
.ax-gridlines {
26-
border-bottom: 1px solid #eee;
27-
}
28-
29-
.ax-row.selected {
30-
background: #f7eeff77;
31-
}
32-
33-
</style>
4+
<link href="https://fonts.googleapis.com/css?family=Montserrat:600|Nunito+Sans:400,700&display=swap" rel="stylesheet">
5+
<link href="https://www.activewidgets.com/favicon.ico" rel="shortcut icon">
346
</head>
357
<body>
36-
<div id="app"></div>
37-
<script src="./viewer/viewer.js"></script>
8+
<div id="app">Loading...</div>
9+
<script async src="./viewer/index.js"></script>
3810
</body>
3911
</html>

examples/index.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/viewer/examples.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+

2+
export * from '@activewidgets/datagrid/examples';
3+

examples/viewer/index.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+

2+
import {Viewer} from '@activewidgets/examples';
3+
import '../../';
4+
import $ from 'jquery';
5+
import * as pages from './examples.js';
6+
import readme from '../README.md';
7+
import logo from './jquery.svg';
8+
import pkg from '../../package.json';
9+
10+
11+
let framework = 'jQuery',
12+
container = document.getElementById('app');
13+
14+
15+
function mount(component, props){
16+
17+
let target = document.createElement(component);
18+
19+
container.innerHTML = '';
20+
container.appendChild(target);
21+
22+
$(target).prop(props).mount();
23+
}
24+
25+
26+
function clean(){
27+
container.innerHTML = '';
28+
}
29+
30+
31+
container.innerHTML = '';
32+
33+
34+
const viewer = new Viewer({
35+
target: document.body,
36+
props: {framework, pkg, logo, readme, pages, mount, clean}
37+
});

examples/viewer/jquery.svg

Lines changed: 20 additions & 0 deletions
Loading

examples/viewer/viewer.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
],
1515
"scripts": {
1616
"build": "rimraf dist/* && rollup -c",
17-
"output": "npm run build && rimraf out/* && parcel build examples/index.html examples/*/*.html -d out",
17+
"output": "npm run build && rimraf out/* && build-examples",
1818
"start": "serve-examples",
1919
"test": "npm run output && jest"
2020
},
@@ -26,14 +26,13 @@
2626
"preact": "10.1.1"
2727
},
2828
"devDependencies": {
29-
"@activewidgets/examples": "0.0.1",
29+
"@activewidgets/examples": "0.0.2",
3030
"@activewidgets/options": "0.0.10",
3131
"@activewidgets/puppeteer": "0.0.4",
3232
"@activewidgets/testing": "0.0.3",
3333
"@babel/core": "^7",
3434
"@babel/preset-env": "^7",
3535
"@rollup/plugin-node-resolve": "^6",
36-
"parcel": "^1",
3736
"postcss-import": "^12",
3837
"rimraf": "^3",
3938
"rollup": "^1.20",

0 commit comments

Comments
 (0)