diff --git a/packages/components/src/components/dropdown/style/index.less b/packages/components/src/components/dropdown/style/index.less index 32f2d91675..bc3de619b9 100644 --- a/packages/components/src/components/dropdown/style/index.less +++ b/packages/components/src/components/dropdown/style/index.less @@ -17,7 +17,6 @@ &-content { position: relative; - padding: 16px 8px 12px; background-color: @color-background-dropdown; border-radius: 4px; box-shadow: @shadow-dropdown; diff --git a/packages/components/src/components/tooltip/Tooltip.tsx b/packages/components/src/components/tooltip/Tooltip.tsx index 2c996c0e39..e8004d2a16 100644 --- a/packages/components/src/components/tooltip/Tooltip.tsx +++ b/packages/components/src/components/tooltip/Tooltip.tsx @@ -8,7 +8,7 @@ import Link from '../link'; import getPlacements from './placements'; import useControlledState from '../../utils/hooks/useControlledState'; -const Tooltip = (props: TooltipProps): React.ReactNode => { +const Tooltip = (props: TooltipProps): JSX.Element => { const { title, tooltipLink, diff --git a/packages/website/src/components/functional/dropdown/demo/assistList.tsx b/packages/website/src/components/functional/dropdown/demo/assistList.tsx new file mode 100644 index 0000000000..36764d5af7 --- /dev/null +++ b/packages/website/src/components/functional/dropdown/demo/assistList.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +import { Button, Dropdown, List } from '@gio-design/components'; + +const options = [ + { value: 'a', label: '功能名称', description: '这里是辅助文字' }, + { value: 'b', label: '功能名称', description: '这里是辅助文字', tooltip: 'test', disabled: true }, + { value: 'c', label: '功能名称', description: '这里是辅助文字' }, + { value: 'd', label: '功能名称', description: '这里是辅助文字', disabled: true }, +]; + +export default () => ( + }> + + +); diff --git a/packages/website/src/components/functional/dropdown/demo/base.tsx b/packages/website/src/components/functional/dropdown/demo/base.tsx index cc012bc342..7245f106a0 100644 --- a/packages/website/src/components/functional/dropdown/demo/base.tsx +++ b/packages/website/src/components/functional/dropdown/demo/base.tsx @@ -3,7 +3,25 @@ import { Dropdown, Button } from '@gio-design/components'; import '@gio-design/components/es/components/dropdown/style/index.css'; export default () => ( - 11111}> - + + 内容区域 + + } + placement="bottomRight" + > + ); diff --git a/packages/website/src/components/functional/dropdown/demo/button.tsx b/packages/website/src/components/functional/dropdown/demo/button.tsx new file mode 100644 index 0000000000..205bf1a89a --- /dev/null +++ b/packages/website/src/components/functional/dropdown/demo/button.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +import { Button, Dropdown, List } from '@gio-design/components'; + +const options = [ + { value: 'a', label: '功能名称' }, + { value: 'b', label: '功能名称', tooltip: 'test', disabled: true }, + { value: 'c', label: '功能名称' }, + { value: 'd', label: '功能名称', disabled: true }, +]; + +export default () => ( + }> + + +); diff --git a/packages/website/src/components/functional/dropdown/demo/content.tsx b/packages/website/src/components/functional/dropdown/demo/content.tsx new file mode 100644 index 0000000000..4e1a3a08e3 --- /dev/null +++ b/packages/website/src/components/functional/dropdown/demo/content.tsx @@ -0,0 +1,34 @@ +import React from 'react'; +import { Dropdown, Avatar, Link } from '@gio-design/components'; +import '@gio-design/components/es/components/dropdown/style/index.css'; +import image from '../../avatar/demo/Avatar.png'; +import './index.less'; + +const renderAvatarContent = () => { + return ( +
+
+ T +

TANGTANG

+

tangtang@growingio.com

+ + 个人设置 + +
+
+

版本信息

+

当前版本:V 2020.6.4

+
+
+
退出登录
+
+ ); +}; + +export default () => { + return ( + + 1111 + + ); +}; diff --git a/packages/website/src/components/functional/dropdown/demo/filter.tsx b/packages/website/src/components/functional/dropdown/demo/filter.tsx new file mode 100644 index 0000000000..41a2e1a09a --- /dev/null +++ b/packages/website/src/components/functional/dropdown/demo/filter.tsx @@ -0,0 +1,68 @@ +/* eslint-disable react/jsx-wrap-multilines */ +import React, { useState } from 'react'; +import { Button, Dropdown, List, SearchBar } from '@gio-design/components'; +import { FilterOutlined } from '@gio-design/icons'; +import { difference, union } from 'lodash'; + +const options = [ + { value: 'a', label: '功能名称' }, + { value: 'b', label: '功能名称' }, + { value: 'c', label: '功能名称' }, + { value: 'd', label: '功能名称' }, + { value: 'e', label: '功能名称' }, + { value: 'f', label: '功能名称' }, + { value: 'g', label: '功能名称' }, + { value: 'h', label: '功能名称' }, +]; + +export default () => { + const [searchvalue, setSearchValue] = useState(''); + const [value, setValue] = useState(['a', 'b']); + return ( + + { + setSearchValue(va); + }} + inputWrapStyle={{ width: 208, margin: '16px 16px 8px' }} + /> + { + if (value.includes(o.value)) { + setValue(difference(value, o.value)); + } else { + setValue(union(value, o.value)); + } + }} + /> +
+ + +
+ + } + > + + + + } + > + +
+ ); +}; diff --git a/packages/website/src/components/functional/dropdown/demo/icons.tsx b/packages/website/src/components/functional/dropdown/demo/icons.tsx new file mode 100644 index 0000000000..68571e4993 --- /dev/null +++ b/packages/website/src/components/functional/dropdown/demo/icons.tsx @@ -0,0 +1,16 @@ +import React from 'react'; +import { Button, Dropdown, List } from '@gio-design/components'; +import { More } from '@gio-design/icons'; + +const options = [ + { value: 'a', label: '功能名称' }, + { value: 'b', label: '功能名称', tooltip: 'test', disabled: true }, + { value: 'c', label: '功能名称' }, + { value: 'd', label: '功能名称', disabled: true }, +]; + +export default () => ( + }> +