-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78cbfea
commit c93fe86
Showing
18 changed files
with
762 additions
and
102 deletions.
There are no files selected for viewing
36 changes: 0 additions & 36 deletions
36
packages/gi-assets-basic/src/components/ConciseContainer/Component.tsx
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
packages/gi-assets-basic/src/components/ConciseContainer/index.less
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
packages/gi-assets-basic/src/components/ConciseContainer/registerMeta.ts
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
packages/gi-assets-basic/src/components/RichContainer/Component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useContainer, useContext } from '@antv/gi-sdk'; | ||
import React from 'react'; | ||
import './index.less'; | ||
|
||
const ConciseContainer = props => { | ||
const { children } = props; | ||
const context = useContext(); | ||
const { config, assets, HAS_GRAPH } = context; | ||
const Containers = useContainer(context); | ||
|
||
const [NavbarArea, ViewArea, DataArea, StylingArea, CanvasArea] = Containers; | ||
console.log('containers', Containers); | ||
|
||
return ( | ||
<div className="gi-rich-container"> | ||
<div className="gi-rich-container-navbar">{NavbarArea.children.map(item => item.component)}</div> | ||
<div className="gi-rich-container-toolbar">,,,,,,</div> | ||
<div className="gi-rich-container-content"> | ||
<div className="gi-rich-container-side"></div> | ||
<div className="gi-rich-container-canvas">{children}</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ConciseContainer; |
43 changes: 43 additions & 0 deletions
43
packages/gi-assets-basic/src/components/RichContainer/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@panel-width: 600px; | ||
.gi-rich-container { | ||
position: absolute; | ||
top: 0px; | ||
right: 0px; | ||
bottom: 0px; | ||
left: 0px; | ||
display: block; | ||
|
||
.gi-rich-container-navbar { | ||
position: relative; | ||
height: 54px; | ||
width: 100%; | ||
background: green; | ||
} | ||
.gi-rich-container-toolbar { | ||
position: relative; | ||
height: 44px; | ||
width: 100%; | ||
background: #f3f5f9; | ||
border-bottom: 1px solid #ddd; | ||
} | ||
.gi-rich-container-content { | ||
position: absolute; | ||
bottom: 0px; | ||
top: 98px; | ||
left: 0px; | ||
right: 0px; | ||
display: flex; | ||
.gi-rich-container-side { | ||
width: 400px; | ||
height: 100%; | ||
background: #f3f5f9; | ||
} | ||
.gi-rich-container-canvas { | ||
position: absolute; | ||
top: 0px; | ||
bottom: 0px; | ||
left: 400px; | ||
right: 0px; | ||
} | ||
} | ||
} |
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...c/src/components/ConciseContainer/info.ts → ...asic/src/components/RichContainer/info.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
packages/gi-assets-basic/src/components/RichContainer/registerMeta.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
const registerMeta = context => { | ||
const { GIAC_CONTENT_ITEMS = [], GIAC_ITEMS = [] } = context; | ||
return { | ||
containers: [ | ||
{ | ||
id: 'navbar', | ||
name: '顶部导航', | ||
required: true, | ||
GI_CONTAINER: { | ||
title: '集成组件', | ||
type: 'string', | ||
'x-decorator': 'FormItem', | ||
'x-component': 'Select', | ||
'x-component-props': { | ||
mode: 'multiple', | ||
}, | ||
enum: GIAC_ITEMS, | ||
default: [], | ||
}, | ||
}, | ||
{ | ||
id: 'view-mode', | ||
name: '模式展示', | ||
required: true, | ||
GI_CONTAINER: { | ||
title: '集成组件', | ||
type: 'string', | ||
'x-decorator': 'FormItem', | ||
'x-component': 'Select', | ||
'x-component-props': { | ||
mode: 'multiple', | ||
}, | ||
enum: GIAC_CONTENT_ITEMS, | ||
default: [], | ||
}, | ||
}, | ||
{ | ||
id: 'data-query', | ||
name: '数据查询', | ||
required: true, | ||
GI_CONTAINER: { | ||
title: '集成组件', | ||
type: 'string', | ||
'x-decorator': 'FormItem', | ||
'x-component': 'Select', | ||
'x-component-props': { | ||
mode: 'multiple', | ||
}, | ||
enum: GIAC_CONTENT_ITEMS, | ||
default: [], | ||
}, | ||
}, | ||
{ | ||
id: 'canvas-operator', | ||
name: '画布操作', | ||
required: true, | ||
GI_CONTAINER: { | ||
title: '集成组件', | ||
type: 'string', | ||
'x-decorator': 'FormItem', | ||
'x-component': 'Select', | ||
'x-component-props': { | ||
mode: 'multiple', | ||
}, | ||
enum: GIAC_ITEMS, | ||
default: [], | ||
}, | ||
}, | ||
{ | ||
id: 'styling-setting', | ||
name: '布局样式', | ||
required: true, | ||
GI_CONTAINER: { | ||
title: '集成组件', | ||
type: 'string', | ||
'x-decorator': 'FormItem', | ||
'x-component': 'Select', | ||
'x-component-props': { | ||
mode: 'multiple', | ||
}, | ||
enum: GIAC_CONTENT_ITEMS, | ||
default: [], | ||
}, | ||
}, | ||
], | ||
}; | ||
}; | ||
export default registerMeta; |
48 changes: 48 additions & 0 deletions
48
packages/gi-assets-basic/src/components/SideTabs.bak/CollapseContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Handler } from '@antv/gi-common-components'; | ||
import { utils } from '@antv/gi-sdk'; | ||
import * as React from 'react'; | ||
import type { ContainerProps } from './typing'; | ||
|
||
const CollapseContainer: React.FunctionComponent<ContainerProps> = props => { | ||
const { placement, offset, width, height, defaultVisible } = props; | ||
|
||
const [state, setState] = React.useState({ | ||
visible: typeof defaultVisible === 'boolean' ? defaultVisible : true, | ||
}); | ||
|
||
const handleToggle = () => { | ||
setState(preState => { | ||
return { | ||
visible: !preState.visible, | ||
}; | ||
}); | ||
}; | ||
|
||
const postionStyles = utils.getPositionStyles(placement, offset); | ||
|
||
const baseStyle = { | ||
...postionStyles, | ||
height, | ||
width, | ||
padding: '8px', | ||
transition: 'all 0.3s ease', | ||
overflow: 'visible', | ||
}; | ||
const styles = state.visible ? baseStyle : { ...baseStyle, width: '0px', padding: '0' }; | ||
|
||
const { children } = props; | ||
return ( | ||
<div style={styles}> | ||
<Handler type={placement === 'LB' || placement === 'LT' ? 'left' : 'right'} handleClick={handleToggle} /> | ||
<div | ||
style={{ | ||
overflowY: 'auto', | ||
height: '100%', | ||
}} | ||
> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export default CollapseContainer; |
Oops, something went wrong.