-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v3.3.0-dev' into hetao-deploy
- Loading branch information
Showing
81 changed files
with
4,760 additions
and
869 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@import '@app/common.less'; | ||
|
||
svg.btn-icon { | ||
fill: #262626; | ||
cursor: pointer; | ||
} | ||
|
||
svg.btn-actived { | ||
fill: @blue; | ||
} | ||
|
||
svg.btn-disabled { | ||
cursor: not-allowed; | ||
} | ||
|
||
svg.rotate-btn { | ||
transform: rotate(180deg); | ||
} |
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,59 @@ | ||
import classnames from 'classnames'; | ||
import React from 'react'; | ||
|
||
import Icon from '@app/components/Icon'; | ||
import './index.less'; | ||
interface IBtnProps { | ||
disabled?: boolean; | ||
action?: () => void; | ||
mouseDownAction?: () => void; | ||
mouseUpAction?: () => void; | ||
icon?: string; | ||
title?: string; | ||
className?: string; | ||
actived?: boolean; | ||
component?: any; | ||
trackCategory?: string; | ||
trackAction?: string; | ||
trackLabel?: string; | ||
} | ||
|
||
interface IMenuButton extends IBtnProps { | ||
tips?: string; | ||
id?:string; | ||
} | ||
const MenuButton: React.FC<IMenuButton> = (props: IMenuButton) => { | ||
const { icon, action, disabled, title, actived, component, className, trackCategory, trackAction, trackLabel } = | ||
props; | ||
return <div | ||
className={classnames( | ||
{ | ||
'btn-disabled': disabled, | ||
'btn-actived': actived, | ||
}, | ||
className, | ||
)} | ||
onClick={e => { | ||
e.preventDefault(); | ||
if (!disabled && action) { | ||
action(); | ||
} | ||
}} | ||
data-track-category={trackCategory} | ||
data-track-action={trackAction} | ||
data-track-label={trackLabel} | ||
> | ||
{icon && ( | ||
<Icon | ||
type={icon} | ||
data-track-category={trackCategory} | ||
data-track-action={trackAction} | ||
data-track-label={trackLabel} | ||
className="btn-icon" | ||
/> | ||
)} | ||
{component} | ||
{title && <span>{title}</span>} | ||
</div>; | ||
}; | ||
export default MenuButton; |
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 @@ | ||
.custom-picker { | ||
border: none !important; | ||
box-shadow: initial !important; | ||
border-radius: 0 !important; | ||
|
||
> div { | ||
padding: 0 !important; | ||
|
||
> span > div { | ||
width: 24px !important; | ||
height: 24px !important; | ||
} | ||
} | ||
} |
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,39 @@ | ||
import React from 'react'; | ||
import { TwitterPicker } from 'react-color'; | ||
|
||
import { COLOR_PICK_LIST } from '@app/config/explore'; | ||
|
||
import './index.less'; | ||
|
||
interface IProps { | ||
onChangeComplete?: (color: string) => void; | ||
onChange?: (color: string) => void; | ||
} | ||
|
||
const ColorPicker: React.FC<IProps> = (props: IProps) => { | ||
const { onChange, onChangeComplete } = props; | ||
const handleChange = color => { | ||
if (onChange) { | ||
onChange(color); | ||
} | ||
}; | ||
|
||
const handleChangeComplete = (color, _event) => { | ||
if (onChangeComplete) { | ||
onChangeComplete(color); | ||
} | ||
}; | ||
|
||
return ( | ||
<TwitterPicker | ||
width="240px" | ||
className="custom-picker" | ||
onChange={handleChange} | ||
onChangeComplete={handleChangeComplete} | ||
colors={COLOR_PICK_LIST} | ||
triangle="hide" | ||
/> | ||
); | ||
}; | ||
|
||
export default ColorPicker; |
Oops, something went wrong.