Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: optimise json display #2091

Merged
merged 2 commits into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"jest-websocket-mock": "^2.1.0",
"mock-socket": "^9.0.3",
"mockjs": "^1.1.0",
"react-drag-listview": "^0.1.6"
"react-drag-listview": "^0.1.6",
"react-json-view": "^1.21.3"
},
"engines": {
"node": ">=8.0.0"
Expand Down
7 changes: 5 additions & 2 deletions packages/hooks/src/useAntdTable/demo/cache.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import { Button, Col, Form, Input, Row, Table, Select } from 'antd';
import { useAntdTable, clearCache } from 'ahooks';
import ReactJson from 'react-json-view';

const { Option } = Select;

Expand Down Expand Up @@ -138,8 +139,10 @@ const UserList = () => {
<Table columns={columns} rowKey="email" {...tableProps} />

<div style={{ background: '#f5f5f5', padding: 8 }}>
<p>Current Table: {JSON.stringify(params[0])}</p>
<p>Current Form: {JSON.stringify(params[1])}</p>
<p>Current Table:</p>
<ReactJson src={params[0]!} collapsed={2} />
<p>Current Form:</p>
<ReactJson src={params[0]!} collapsed={2} />
</div>
</div>
);
Expand Down
7 changes: 5 additions & 2 deletions packages/hooks/src/useAntdTable/demo/form.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { Button, Col, Form, Input, Row, Table, Select } from 'antd';
import { useAntdTable } from 'ahooks';
import ReactJson from 'react-json-view';

const { Option } = Select;

Expand Down Expand Up @@ -124,8 +125,10 @@ export default () => {
<Table columns={columns} rowKey="email" {...tableProps} />

<div style={{ background: '#f5f5f5', padding: 8 }}>
<p>Current Table: {JSON.stringify(params[0])}</p>
<p>Current Form: {JSON.stringify(params[1])}</p>
<p>Current Table:</p>
<ReactJson src={params[0]!} collapsed={2} />
<p>Current Form:</p>
<ReactJson src={params[1]!} collapsed={2} />
</div>
</div>
);
Expand Down
7 changes: 5 additions & 2 deletions packages/hooks/src/useAntdTable/demo/init.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { Button, Col, Form, Input, Row, Table, Select } from 'antd';
import { useAntdTable } from 'ahooks';
import ReactJson from 'react-json-view';

const { Option } = Select;

Expand Down Expand Up @@ -128,8 +129,10 @@ export default () => {
<Table columns={columns} rowKey="email" {...tableProps} />

<div style={{ background: '#f5f5f5', padding: 8 }}>
<p>Current Table: {JSON.stringify(params[0])}</p>
<p>Current Form: {JSON.stringify(params[1])}</p>
<p>Current Table:</p>
<ReactJson src={params[0]!} collapsed={2} />
<p>Current Form:</p>
<ReactJson src={params[1]!} collapsed={2} />
</div>
</div>
);
Expand Down
7 changes: 5 additions & 2 deletions packages/hooks/src/useAntdTable/demo/ready.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import { Button, Col, Form, Input, Row, Table, Select } from 'antd';
import { useAntdTable } from 'ahooks';
import ReactJson from 'react-json-view';

const { Option } = Select;

Expand Down Expand Up @@ -133,8 +134,10 @@ export default () => {
<Table columns={columns} rowKey="email" {...tableProps} />

<div style={{ background: '#f5f5f5', padding: 8 }}>
<p>Current Table: {JSON.stringify(params[0])}</p>
<p>Current Form: {JSON.stringify(params[1])}</p>
<p>Current Table:</p>
<ReactJson src={params[0]!} collapsed={2} />
<p>Current Form:</p>
<ReactJson src={params[1]!} collapsed={2} />
</div>
</div>
);
Expand Down
7 changes: 5 additions & 2 deletions packages/hooks/src/useAntdTable/demo/validate.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Form, Input, Select, Table } from 'antd';
import React from 'react';
import { useAntdTable } from 'ahooks';
import ReactJson from 'react-json-view';

const { Option } = Select;

Expand Down Expand Up @@ -90,8 +91,10 @@ export default () => {
<Table columns={columns} rowKey="email" {...tableProps} />

<div style={{ background: '#f5f5f5', padding: 8 }}>
<p>Current Table: {JSON.stringify(params[0])}</p>
<p>Current Form: {JSON.stringify(params[1])}</p>
<p>Current Table:</p>
<ReactJson src={params[0]!} collapsed={2} />
<p>Current Form:</p>
<ReactJson src={params[1]!} collapsed={2} />
</div>
</div>
);
Expand Down
7 changes: 5 additions & 2 deletions packages/hooks/src/useFusionTable/demo/cache.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import { Table, Pagination, Field, Form, Input, Button } from '@alifd/next';
import { useFusionTable } from 'ahooks';
import ReactJson from 'react-json-view';

interface Item {
name: {
Expand Down Expand Up @@ -108,8 +109,10 @@ const AppList = () => {
</Table>
<Pagination style={{ marginTop: 16 }} {...paginationProps} />
<div style={{ background: '#f5f5f5', padding: 8, marginTop: 16 }}>
<p>Current Table: {JSON.stringify(params[0])}</p>
<p>Current Form: {JSON.stringify(params[1])}</p>
<p>Current Table:</p>
<ReactJson src={params[0]!} collapsed={2} />
<p>Current Form:</p>
<ReactJson src={params[1]!} collapsed={2} />
</div>
</div>
);
Expand Down
7 changes: 5 additions & 2 deletions packages/hooks/src/useFusionTable/demo/form.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { Table, Pagination, Field, Form, Input, Button, Select, Icon } from '@alifd/next';
import { useFusionTable } from 'ahooks';
import ReactJson from 'react-json-view';

interface Item {
name: {
Expand Down Expand Up @@ -119,8 +120,10 @@ const AppList = () => {
</Table>
<Pagination style={{ marginTop: 16 }} {...paginationProps} />
<div style={{ background: '#f5f5f5', padding: 8, marginTop: 16 }}>
<p>Current Table: {JSON.stringify(params[0])}</p>
<p>Current Form: {JSON.stringify(params[1])}</p>
<p>Current Table:</p>
<ReactJson src={params[0]!} collapsed={2} />
<p>Current Form:</p>
<ReactJson src={params[1]!} collapsed={2} />
</div>
</>
);
Expand Down
7 changes: 5 additions & 2 deletions packages/hooks/src/useFusionTable/demo/init.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Button, Field, Form, Icon, Input, Pagination, Select, Table } from '@alifd/next';
import React from 'react';
import { useFusionTable } from 'ahooks';
import ReactJson from 'react-json-view';

interface Item {
name: {
Expand Down Expand Up @@ -124,8 +125,10 @@ const AppList = () => {
</Table>
<Pagination style={{ marginTop: 16 }} {...paginationProps} />
<div style={{ background: '#f5f5f5', padding: 8, marginTop: 16 }}>
<p>Current Table: {JSON.stringify(params[0])}</p>
<p>Current Form: {JSON.stringify(params[1])}</p>
<p>Current Table:</p>
<ReactJson src={params[0]!} collapsed={2} />
<p>Current Form:</p>
<ReactJson src={params[1]!} collapsed={2} />
</div>
</>
);
Expand Down
7 changes: 5 additions & 2 deletions packages/hooks/src/useFusionTable/demo/validate.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { Table, Pagination, Field, Form, Input, Select, Icon } from '@alifd/next';
import { useFusionTable } from 'ahooks';
import ReactJson from 'react-json-view';

interface Item {
name: {
Expand Down Expand Up @@ -71,8 +72,10 @@ const AppList = () => {
</Table>
<Pagination style={{ marginTop: 16 }} {...paginationProps} />
<div style={{ background: '#f5f5f5', padding: 8, marginTop: 16 }}>
<p>Current Table: {JSON.stringify(params[0])}</p>
<p>Current Form: {JSON.stringify(params[1])}</p>
<p>Current Table:</p>
<ReactJson src={params[0]!} collapsed={2} />
<p>Current Form:</p>
<ReactJson src={params[1]!} collapsed={2} />
</div>
</>
);
Expand Down
Loading