Skip to content

Commit 8a6a00b

Browse files
committed
Squash-merge PR #13
1 parent 4187caa commit 8a6a00b

Some content is hidden

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

97 files changed

+13790
-9669
lines changed

.babelrc

-3
This file was deleted.
File renamed without changes.

.gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
jspm_packages/
2-
node_modules/
3-
npm-debug.log
4-
react-starter/dist/
1+
# dependencies
2+
/node_modules
3+
.history
4+
/dist

LICENSE

-23
This file was deleted.

react-starter/README.md README-new.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Usage
22

33
git clone https://github.com/yoonka/unigrid.git
44
cd unigrid
5-
cd react-starter
5+
66
npm install
77

88
Then to view the examples:

README.md

-127
This file was deleted.
File renamed without changes.

bin/server.js

-11
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/UnigridExample1.js

+21-19
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525
*/
2626

2727
import React from 'react';
28-
// import tableData from './json/tableResp1.json!';
28+
import { tableData } from './data/Resp1';
2929
import {
3030
Unigrid,
3131
UnigridEmptyCell,
3232
UnigridTextCell,
3333
isDefined,
3434
idMaker
35-
} from 'src/index';
35+
} from '../unigrid';
3636

3737
export class UnigridExample1 extends React.Component {
3838
handleClick() {
@@ -48,6 +48,7 @@ export class UnigridExample1 extends React.Component {
4848
}
4949

5050
render() {
51+
5152
const idCounter = idMaker();
5253
const mkKey = () => idCounter.next().value;
5354

@@ -62,10 +63,10 @@ export class UnigridExample1 extends React.Component {
6263
$do: [
6364
{
6465
cells: [
65-
{show: 'hAgent', as: UnigridTextCell},
66+
{ show: 'hAgent', as: UnigridTextCell },
6667
'hDate',
6768
'hStreet',
68-
{show: 'hName', as: 'string', className: 'name-header-cell'},
69+
{ show: 'hName', as: 'string', className: 'name-header-cell' },
6970
'hNumber'
7071
],
7172
rowAs: 'header'
@@ -80,29 +81,29 @@ export class UnigridExample1 extends React.Component {
8081
className: 'unigrid-segment',
8182
$do: [
8283
{
83-
condition: {ifDoes: 'exist', property: 'list'},
84+
condition: { ifDoes: 'exist', property: 'list' },
8485
fromProperty: 'list',
8586
select: 0,
8687
$do: [
8788
{
8889
cells: [
8990
'hCategory',
90-
{as: 'empty', colSpan: 1},
91-
{show: this.showFun},
91+
{ as: 'empty', colSpan: 1 },
92+
{ show: this.showFun },
9293
this.showFun2,
9394
'hNumber'],
9495
rowAs: 'header'
9596
}
9697
]
9798
},
9899
{
99-
condition: {ifDoes: 'exist', property: 'list'},
100+
condition: { ifDoes: 'exist', property: 'list' },
100101
fromProperty: 'list',
101102
$do: [
102103
{
103104
cells: [
104-
{cell: 'category2'},
105-
{as: 'empty', colSpan: 3},
105+
{ cell: 'category2' },
106+
{ as: 'empty', colSpan: 3 },
106107
'hNumber'],
107108
rowAs: 'header'
108109
}
@@ -112,20 +113,21 @@ export class UnigridExample1 extends React.Component {
112113
className: 'some-row-class',
113114
cells: [
114115
'agent', 'date', 'street', 'name',
115-
{show: 'number',
116-
as: 'string',
117-
className: 'number-cell',
118-
onClick: this.handleClick,
119-
bindToCell: 'onClick'
116+
{
117+
show: 'number',
118+
as: 'string',
119+
className: 'number-cell',
120+
onClick: this.handleClick,
121+
bindToCell: 'onClick'
120122
}]
121123
},
122124
{
123-
condition: {ifDoes: 'exist', property: 'list'},
125+
condition: { ifDoes: 'exist', property: 'list' },
124126
fromProperty: 'list',
125127
select: 'all',
126128
$do: [
127129
{
128-
cells: [{as: 'empty', colSpan: 3}, 'name', 'number'],
130+
cells: [{ as: 'empty', colSpan: 3 }, 'name', 'number'],
129131
mixIn: {
130132
onClick: this.handleClick,
131133
bindToCell: 'onClick'
@@ -144,8 +146,8 @@ export class UnigridExample1 extends React.Component {
144146
{
145147
select: 0,
146148
$do: [
147-
{cells: [null, null, null, 'fSum', 'fTotal']},
148-
{cells: [null, null, null, 'sum', 'total']}
149+
{ cells: [null, null, null, 'fSum', 'fTotal'] },
150+
{ cells: [null, null, null, 'sum', 'total'] }
149151
]
150152
}
151153
]

examples/UnigridExample10.js

+27-27
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525
*/
2626

2727
import React from 'react';
28-
import tableData from './json/tableResp6.json!';
28+
import { tableData } from './data/Resp6';
2929
import {
3030
Unigrid,
3131
UnigridHeader,
@@ -34,7 +34,7 @@ import {
3434
UnigridTextCell,
3535
getSorter,
3636
sort
37-
} from 'src/index';
37+
} from '../unigrid';
3838

3939
export class UnigridExample10 extends React.Component {
4040
clickHandler(field) {
@@ -44,32 +44,32 @@ export class UnigridExample10 extends React.Component {
4444
render() {
4545
return (
4646
<div>
47-
<p>Example 10 : Sorting with null, undefined and empty values</p>
48-
<Unigrid
49-
box={{column: 'a', order: 'asc'}}
50-
data={tableData}
51-
ref={ref => {this.unigrid = ref;}}
52-
>
53-
<UnigridHeader>
54-
<UnigridRow rowAs={'header'}>
55-
<UnigridTextCell cell="A" onClick={this.clickHandler('a')} />
56-
<UnigridTextCell cell="B" onClick={this.clickHandler('b')} />
57-
<UnigridTextCell cell="C" onClick={this.clickHandler('c')} />
58-
<UnigridTextCell cell="D" onClick={this.clickHandler('d')} />
59-
</UnigridRow>
60-
</UnigridHeader>
61-
<UnigridSegment
62-
process={getSorter()}
63-
select={'all'}
47+
<p>Example 10 : Sorting with null, undefined and empty values</p>
48+
<Unigrid
49+
box={{ column: 'a', order: 'asc' }}
50+
data={tableData}
51+
ref={ref => { this.unigrid = ref; }}
6452
>
65-
<UnigridRow>
66-
<UnigridTextCell show="a" />
67-
<UnigridTextCell show="b" />
68-
<UnigridTextCell show="c" />
69-
<UnigridTextCell show="d" />
70-
</UnigridRow>
71-
</UnigridSegment>
72-
</Unigrid>
53+
<UnigridHeader>
54+
<UnigridRow rowAs={'header'}>
55+
<UnigridTextCell cell="A" onClick={this.clickHandler('a')} />
56+
<UnigridTextCell cell="B" onClick={this.clickHandler('b')} />
57+
<UnigridTextCell cell="C" onClick={this.clickHandler('c')} />
58+
<UnigridTextCell cell="D" onClick={this.clickHandler('d')} />
59+
</UnigridRow>
60+
</UnigridHeader>
61+
<UnigridSegment
62+
process={getSorter()}
63+
select={'all'}
64+
>
65+
<UnigridRow>
66+
<UnigridTextCell show="a" />
67+
<UnigridTextCell show="b" />
68+
<UnigridTextCell show="c" />
69+
<UnigridTextCell show="d" />
70+
</UnigridRow>
71+
</UnigridSegment>
72+
</Unigrid>
7373
</div>
7474
);
7575
}

0 commit comments

Comments
 (0)