-
Notifications
You must be signed in to change notification settings - Fork 23
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
yxh01132861
committed
Nov 30, 2023
1 parent
f550584
commit 6bed452
Showing
17 changed files
with
144 additions
and
27 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
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
46 changes: 46 additions & 0 deletions
46
...Attribute/components/ScaleSelector/CustomMappingColors/CustomString/UnknownItem/index.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,46 @@ | ||
import { DeleteOutlined } from '@ant-design/icons'; | ||
import { usePrefixCls } from '@formily/antd-v5/esm/__builtins__'; | ||
import { ColorPicker, Select } from 'antd'; | ||
import type { Color } from 'antd/es/color-picker'; | ||
import classnames from 'classnames'; | ||
import React, { useMemo } from 'react'; | ||
import useStyle from './style'; | ||
|
||
type UnknownItemProps = { | ||
color: string; | ||
onChange: (color: string) => void; | ||
}; | ||
|
||
const UnknownItem = ({ color: defaultColor, onChange }: UnknownItemProps) => { | ||
const prefixCls = usePrefixCls('formily-scale-selector__custom-string-unknown'); | ||
const [wrapSSR, hashId] = useStyle(prefixCls); | ||
|
||
const colorChange = (color: Color) => { | ||
onChange?.(color.toHexString()); | ||
}; | ||
|
||
return wrapSSR( | ||
<div className={classnames(`${prefixCls}`, hashId)}> | ||
<div className={`${prefixCls}__infor`}> | ||
<div | ||
onMouseDown={(e) => { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
}} | ||
> | ||
<ColorPicker value={defaultColor ? defaultColor : '#5B8FF9'} onChange={colorChange}> | ||
<div className={`${prefixCls}__infor__color`} style={{ background: defaultColor }} /> | ||
</ColorPicker> | ||
</div> | ||
|
||
<div className={`${prefixCls}__infor__content`}> | ||
<Select size="small" style={{ width: '100%' }} disabled placeholder="其他" /> | ||
</div> | ||
|
||
<div className={`${prefixCls}__infor__delete-icon`} /> | ||
</div> | ||
</div>, | ||
); | ||
}; | ||
|
||
export default UnknownItem; |
55 changes: 55 additions & 0 deletions
55
...rAttribute/components/ScaleSelector/CustomMappingColors/CustomString/UnknownItem/style.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,55 @@ | ||
import { genStyleHook } from '@formily/antd-v5/esm/__builtins__'; | ||
|
||
export default genStyleHook('scale-selector__custom-string-unknown', (token) => { | ||
const { componentCls, antCls, colorBorder, lineType, borderRadius } = token; | ||
|
||
return { | ||
[componentCls]: { | ||
display: 'flex', | ||
alignItems: 'center', | ||
padding: '5px 0', | ||
borderRadius: '4px', | ||
|
||
[`${componentCls}__infor`]: { | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'space-between', | ||
width: '100%', | ||
cursor: 'pointer', | ||
|
||
'&__color': { | ||
width: '18px', | ||
height: '18px', | ||
border: `1px ${colorBorder} ${lineType}`, | ||
borderRadius: `${borderRadius}px`, | ||
}, | ||
|
||
'&__content': { | ||
flex: 1, | ||
width: '100%', | ||
overflow: 'hidden', | ||
margin: '0 3px', | ||
}, | ||
|
||
'&__delete-icon': { | ||
width: '14px', | ||
}, | ||
}, | ||
}, | ||
|
||
[`${antCls}-select-dropdown`]: { | ||
zIndex: 1, | ||
}, | ||
|
||
'.ant-popover': { | ||
zIndex: '4 !important', | ||
'.ant-color-picker-presets .ant-collapse-item .ant-collapse-header': { | ||
display: 'none', | ||
}, | ||
}, | ||
|
||
'.ant-color-picker .ant-color-picker-panel .ant-color-picker-inner-panel-divider': { | ||
margin: '3px 8px ', | ||
}, | ||
}; | ||
}); |
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