-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: yxh01132861 <[email protected]>
- Loading branch information
1 parent
98d9074
commit 53d9853
Showing
16 changed files
with
140 additions
and
31 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
14 changes: 14 additions & 0 deletions
14
src/components/LayerAttribute/components/Offset/AntdOffset.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,14 @@ | ||
@root-entry-name: 'default'; | ||
@import (reference) '~antd/es/style/themes/index.less'; | ||
|
||
@slider-range-prefix-cls: ~'@{ant-prefix}-formily-offset-range'; | ||
|
||
.@{slider-range-prefix-cls} { | ||
display: flex; | ||
justify-content: space-between; | ||
margin-top: 5px; | ||
|
||
.@{ant-prefix}-input-number { | ||
width: 70px; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/components/LayerAttribute/components/Offset/AntdOffset.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,49 @@ | ||
import { usePrefixCls } from '@formily/antd/esm/__builtins__/hooks/usePrefixCls'; | ||
import { InputNumber } from 'antd'; | ||
import React, { useEffect, useState } from 'react'; | ||
import './AntdOffset.less'; | ||
|
||
export interface AntdOffsetProps { | ||
/** | ||
* 偏移量 | ||
*/ | ||
value?: [number, number]; | ||
/** | ||
* 选择发生改变时 | ||
*/ | ||
onChange?: (value: [number, number]) => void; | ||
} | ||
|
||
const AntdOffset: React.FC<AntdOffsetProps> = (props) => { | ||
const prefixCls = usePrefixCls('formily-offset-range'); | ||
const [sliderVal, setSliderVal] = useState<[number, number]>(props.value ?? [0, 0]); | ||
|
||
useEffect(() => { | ||
props.onChange(sliderVal); | ||
}, [sliderVal]); | ||
|
||
return ( | ||
<div className={prefixCls}> | ||
<InputNumber | ||
{...props} | ||
size="small" | ||
value={sliderVal[0]} | ||
onChange={(val) => { | ||
const value: [number, number] = [val, Number(sliderVal[1])]; | ||
setSliderVal(value); | ||
}} | ||
/> | ||
<InputNumber | ||
{...props} | ||
size="small" | ||
value={sliderVal[1]} | ||
onChange={(val) => { | ||
const value: [number, number] = [sliderVal[0], Number(val)]; | ||
setSliderVal(value); | ||
}} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AntdOffset; |
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,7 @@ | ||
import { connect } from '@formily/react'; | ||
import type { AntdOffsetProps } from './AntdOffset'; | ||
import AntdOffset from './AntdOffset'; | ||
|
||
const Offset: React.FC<AntdOffsetProps> = connect(AntdOffset); | ||
|
||
export default Offset; |
4 changes: 2 additions & 2 deletions
4
src/components/LayerAttribute/components/SliderRange/AntdSliderRange.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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export { ColorPicker, FieldSelect, RibbonSelect } from '@antv/insight-component'; | ||
export { default as FormCollapse } from './FormCollapse'; | ||
export { default as Offset } from './Offset'; | ||
export { default as Slider } from './Slider'; | ||
export { default as SliderRange } from './SliderRange'; |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
--- | ||
toc: content | ||
order: 8 | ||
order: 3 | ||
group: | ||
title: 基础图层 | ||
title: 复合图层 | ||
order: 1 | ||
nav: | ||
title: 组件 | ||
|
4 changes: 2 additions & 2 deletions
4
src/components/Layers/CompositeLayers/IconImageLayer/index.md
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
--- | ||
toc: content | ||
order: 9 | ||
order: 4 | ||
group: | ||
title: 基础图层 | ||
title: 复合图层 | ||
order: 1 | ||
nav: | ||
title: 组件 | ||
|