Skip to content

Commit 9f89b4e

Browse files
committed
almost finish
1 parent 0858bb0 commit 9f89b4e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1316
-188
lines changed

README.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
react-virtualize-search-table
2+
===
3+
4+
Table powered by react-virtualized table with search and sort.
5+
6+
demo: https://flyingpath.github.io/react-virtualize-search-table
7+
8+
### Prop Types
9+
| Property | Type | Required? | Description|
10+
| :------- | :----- | :-------: | :--------- |
11+
| title | element or string | | table title |
12+
| columns | array | Y | Array of data object with dataKey and label [Example](#Columns) |
13+
| data | array | Y | Array of data object with element, searchKey and orderKey. [Example](#dataExample)
14+
15+
### <a name="Columns"></a>columns
16+
17+
```
18+
[
19+
{
20+
dataKey: 'name',
21+
label: 'name'
22+
},
23+
{
24+
dataKey: 'description',
25+
label: 'description'
26+
},
27+
{
28+
dataKey: 'danger',
29+
label: '危機值危機值危機值危'
30+
}
31+
]
32+
```
33+
34+
35+
### <a name="dataExample"></a>data
36+
37+
38+
The keys in the object is linked to the dataKeys in columns.
39+
40+
SearchKey is used for search.
41+
OrderKey is used for sort.
42+
43+
```
44+
[
45+
{
46+
name : {
47+
element : ( <div>Brian Vaughn</div> ),
48+
searchKey : 'Brian Vaughn',
49+
orderKey : 'Brian Vaughn'
50+
},
51+
description: {
52+
element : ( <div>xxxxx</div> ),
53+
searchKey : 'Software engineer',
54+
orderKey : 'Software engineer'
55+
},
56+
danger: {
57+
element : ( <div>0</div> ),
58+
searchKey : false,
59+
orderKey : 0
60+
}
61+
},
62+
{
63+
name : {
64+
element : ( <div></div> ),
65+
searchKey : 'Brian Vaughn2',
66+
orderKey : 'Brian Vaughn2'
67+
},
68+
description: {
69+
element : ( <div>xxxxx</div> ),
70+
searchKey : 'Software engineer3',
71+
orderKey : 'Software engineer3'
72+
},
73+
danger: {
74+
element : ( <div></div> ),
75+
searchKey : false,
76+
orderKey : 0
77+
}
78+
}, ...
79+
]
80+
```
81+
82+
### Example
83+
84+
```
85+
import React from 'react'
86+
import ReactVirtulizeSearchTable from './components/index'
87+
88+
class App extends React.Component {
89+
constructor(props) {
90+
super(props)
91+
this.state = {
92+
columns: [],
93+
data: []
94+
}
95+
}
96+
97+
render() {
98+
const demo = {
99+
title: '門診紀錄列表',
100+
columns: [
101+
{ dataKey: 'name', label: 'name' },
102+
{ dataKey: 'description', label: 'description' },
103+
{ dataKey: 'danger', label: '危機值危機值危機值危' },
104+
],
105+
data: [
106+
{
107+
name : {
108+
element : ( <div>1234</div> ),
109+
searchKey : '12343',
110+
orderKey : 'Brian Vaughn1'
111+
},
112+
description: {
113+
element : ( <div>1234</div> ),
114+
searchKey : '12343',
115+
orderKey : 'Software engineer'
116+
},
117+
danger: {
118+
element : ( <div>o</div> ),
119+
searchKey : true,
120+
orderKey : 1
121+
}
122+
}
123+
]
124+
}
125+
126+
return (
127+
<div style={{ height: '100%' }}>
128+
<ReactVirtulizeSearchTable {...demo} />
129+
</div>
130+
)
131+
}
132+
133+
}
134+
135+
export default App
136+
```

build/asset-manifest.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"files": {
3+
"main.css": "/static/css/main.22dbb9b8.chunk.css",
4+
"main.js": "/static/js/main.c536bcc0.chunk.js",
5+
"main.js.map": "/static/js/main.c536bcc0.chunk.js.map",
6+
"runtime-main.js": "/static/js/runtime-main.43fcef8b.js",
7+
"runtime-main.js.map": "/static/js/runtime-main.43fcef8b.js.map",
8+
"static/css/2.71916e70.chunk.css": "/static/css/2.71916e70.chunk.css",
9+
"static/js/2.c7602393.chunk.js": "/static/js/2.c7602393.chunk.js",
10+
"static/js/2.c7602393.chunk.js.map": "/static/js/2.c7602393.chunk.js.map",
11+
"index.html": "/index.html",
12+
"precache-manifest.79447699682972c07e34efaba6423d93.js": "/precache-manifest.79447699682972c07e34efaba6423d93.js",
13+
"service-worker.js": "/service-worker.js",
14+
"static/css/2.71916e70.chunk.css.map": "/static/css/2.71916e70.chunk.css.map",
15+
"static/css/main.22dbb9b8.chunk.css.map": "/static/css/main.22dbb9b8.chunk.css.map"
16+
},
17+
"entrypoints": [
18+
"static/js/runtime-main.43fcef8b.js",
19+
"static/css/2.71916e70.chunk.css",
20+
"static/js/2.c7602393.chunk.js",
21+
"static/css/main.22dbb9b8.chunk.css",
22+
"static/js/main.c536bcc0.chunk.js"
23+
]
24+
}

build/favicon.ico

3.78 KB
Binary file not shown.

build/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><link href="/static/css/2.71916e70.chunk.css" rel="stylesheet"><link href="/static/css/main.22dbb9b8.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(i){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],a=0,l=[];a<n.length;a++)t=n[a],Object.prototype.hasOwnProperty.call(f,t)&&f[t]&&l.push(f[t][0]),f[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(i[r]=o[r]);for(s&&s(e);l.length;)l.shift()();return p.push.apply(p,u||[]),c()}function c(){for(var e,r=0;r<p.length;r++){for(var t=p[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==f[u]&&(n=!1)}n&&(p.splice(r--,1),e=a(a.s=t[0]))}return e}var t={},f={1:0},p=[];function a(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return i[e].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=i,a.c=t,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(r,e){if(1&e&&(r=a(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)a.d(t,n,function(e){return r[e]}.bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="/";var r=this["webpackJsonpreact-virtualize-search-table"]=this["webpackJsonpreact-virtualize-search-table"]||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;c()}([])</script><script src="/static/js/2.c7602393.chunk.js"></script><script src="/static/js/main.c536bcc0.chunk.js"></script></body></html>

build/logo192.png

5.22 KB
Loading

build/logo512.png

9.44 KB
Loading

build/manifest.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
self.__precacheManifest = (self.__precacheManifest || []).concat([
2+
{
3+
"revision": "1c93883e7983967d9cf7037e2181dfdd",
4+
"url": "/index.html"
5+
},
6+
{
7+
"revision": "9ab853f67a1b072d4f73",
8+
"url": "/static/css/2.71916e70.chunk.css"
9+
},
10+
{
11+
"revision": "64d632d0aeb8f97f78fe",
12+
"url": "/static/css/main.22dbb9b8.chunk.css"
13+
},
14+
{
15+
"revision": "9ab853f67a1b072d4f73",
16+
"url": "/static/js/2.c7602393.chunk.js"
17+
},
18+
{
19+
"revision": "64d632d0aeb8f97f78fe",
20+
"url": "/static/js/main.c536bcc0.chunk.js"
21+
},
22+
{
23+
"revision": "8a189f75ad33b7735ca9",
24+
"url": "/static/js/runtime-main.43fcef8b.js"
25+
}
26+
]);

build/robots.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *

build/service-worker.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Welcome to your Workbox-powered service worker!
3+
*
4+
* You'll need to register this file in your web app and you should
5+
* disable HTTP caching for this file too.
6+
* See https://goo.gl/nhQhGp
7+
*
8+
* The rest of the code is auto-generated. Please don't update this file
9+
* directly; instead, make changes to your Workbox build configuration
10+
* and re-run your build process.
11+
* See https://goo.gl/2aRDsh
12+
*/
13+
14+
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
15+
16+
importScripts(
17+
"/precache-manifest.79447699682972c07e34efaba6423d93.js"
18+
);
19+
20+
self.addEventListener('message', (event) => {
21+
if (event.data && event.data.type === 'SKIP_WAITING') {
22+
self.skipWaiting();
23+
}
24+
});
25+
26+
workbox.core.clientsClaim();
27+
28+
/**
29+
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
30+
* requests for URLs in the manifest.
31+
* See https://goo.gl/S9QRab
32+
*/
33+
self.__precacheManifest = [].concat(self.__precacheManifest || []);
34+
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
35+
36+
workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/index.html"), {
37+
38+
blacklist: [/^\/_/,/\/[^\/?]+\.[^\/]+$/],
39+
});

0 commit comments

Comments
 (0)