File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change
1
+ [ ---
2
+ '@kubed/components ': patch
3
+ ---
4
+
5
+ 1 . Export Progress component.
6
+ 2 . Omit trigger if visible is set.
Original file line number Diff line number Diff line change 1
1
import React , { useState } from 'react' ;
2
2
import styled from 'styled-components' ;
3
+ import { isUndefined } from 'lodash' ;
3
4
import { Tooltip , TooltipProps } from '../Tooltip/Tooltip' ;
4
5
5
6
const StyledTooltip = styled ( Tooltip ) < TooltipProps > `
@@ -37,11 +38,12 @@ export function Dropdown({
37
38
maxWidth = 210 ,
38
39
animation = 'shift-away' ,
39
40
content,
41
+ visible,
40
42
...rest
41
43
} : DropdownProps ) {
42
44
const [ instance , setInstance ] = useState ( false ) ;
43
45
const onDropdownClick = ( ) => {
44
- if ( hideOnClick && instance ) {
46
+ if ( hideOnClick && instance && ! visible ) {
45
47
// @ts -ignore
46
48
instance . hide ( ) ;
47
49
}
@@ -56,18 +58,19 @@ export function Dropdown({
56
58
} ;
57
59
58
60
const popContent = < DropdownWrapper onClick = { onDropdownClick } > { content } </ DropdownWrapper > ;
61
+ const triggerProps = isUndefined ( visible ) ? { trigger } : { visible } ;
59
62
60
63
return (
61
64
// @ts -ignore
62
65
< StyledTooltip
63
66
placement = { placement }
64
- trigger = { trigger }
65
67
arrow = { arrow }
66
68
interactive = { interactive }
67
69
maxWidth = { maxWidth }
68
70
animation = { animation }
69
71
onMount = { onMount }
70
72
onDestroy = { onDestroy }
73
+ { ...triggerProps }
71
74
{ ...rest }
72
75
content = { popContent }
73
76
>
Original file line number Diff line number Diff line change @@ -38,3 +38,4 @@ export { default as TimePicker } from './TimePicker/TimePicker';
38
38
export { Banner , BannerTip } from './Banner/Banner' ;
39
39
export { Notify , notify } from './Notify/Notify' ;
40
40
export * from './ActionConfirm/ActionConfirm' ;
41
+ export * from './Progress/Progress' ;
You can’t perform that action at this time.
0 commit comments