-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1314 from sheinsight/dev
1.6.6
- Loading branch information
Showing
314 changed files
with
4,040 additions
and
2,085 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/** | ||
* 此文件根据 scripts/components-page.ejs 生成,不要手动修改 | ||
*/ | ||
import React from 'react' | ||
import navable from 'docs/Navable' | ||
import MarkDown from 'docs/MarkDown' | ||
|
||
import locate from 'doc/locate' | ||
|
||
import cn from 'doc/pages/components/Drawer/cn.md' | ||
import en from 'doc/pages/components/Drawer/en.md' | ||
|
||
const source = locate(cn, en) | ||
|
||
const examples = [ | ||
{ | ||
name: '1-base', | ||
title: locate( | ||
'基本用法 \n 最基本的组件用法。 \n Drawer 会在 document.body 中创建一个新的层显示弹出内容。 \n 关闭 Drawer 时默认没有对组件进行销毁, 只是隐藏, 组件的状态会被保留。 如果不需要保留组件之前的状态, 可以设置 destroy 属性。', | ||
'Base \n The basic usage for component.' | ||
), | ||
component: require('doc/pages/components/Drawer/example-1-base.js').default, | ||
rawText: require('!raw-loader!doc/pages/components/Drawer/example-1-base.js'), | ||
}, | ||
{ | ||
name: '2-position', | ||
title: locate( | ||
'位置 \n 通过 position 可设置 Drawer 弹出的位置, 现支持 top、right、bottom 和 left 四个位置配置。', | ||
'Position \n Set position property to specify the pop-up position.' | ||
), | ||
component: require('doc/pages/components/Drawer/example-2-position.js').default, | ||
rawText: require('!raw-loader!doc/pages/components/Drawer/example-2-position.js'), | ||
}, | ||
{ | ||
name: '3-gcontainer', | ||
title: locate( | ||
'指定目标 \n 使用 container 来指定 Drawer 渲染的目标节点', | ||
'Target \n set container to render target node' | ||
), | ||
component: require('doc/pages/components/Drawer/example-3-gcontainer.js').default, | ||
rawText: require('!raw-loader!doc/pages/components/Drawer/example-3-gcontainer.js'), | ||
}, | ||
{ | ||
name: '4-form', | ||
title: locate( | ||
'表单 \n Drawer 支持 Form 表单,并且支持 Form 的所有特性,表单提交可以使用 Drawer.Submit 来代替 Button[type=submit]', | ||
'Form \n The internal form of Drawer can use Drawer.Submit to trigger submit.' | ||
), | ||
component: require('doc/pages/components/Drawer/example-4-form.js').default, | ||
rawText: require('!raw-loader!doc/pages/components/Drawer/example-4-form.js'), | ||
}, | ||
{ | ||
name: '6-close', | ||
title: locate( | ||
'点击空白关闭 \n 默认点击抽屉外部空白页面会关闭抽屉。 \n 设置 maskCloseAble 属性为 false,禁用点击空白关闭,同时右上角的关闭图标也会隐藏。 \n 设置 maskCloseAble 属性为 null,禁用点击空白关闭,右上角的关闭图标会保留。', | ||
'Close \n By default, clicking on the blank page outside the Drawer box will closes the Drawer box. \n Set maskCloseAble to false to disable the function that click mask to close and the close icon in the upper right corner will be hidden at the same time. \n Set maskCloseAbel to null to disable the function that click mask to close and the close icon in the upper right corner will be preserved.' | ||
), | ||
component: require('doc/pages/components/Drawer/example-6-close.js').default, | ||
rawText: require('!raw-loader!doc/pages/components/Drawer/example-6-close.js'), | ||
}, | ||
{ | ||
name: '7-full-screen', | ||
title: locate( | ||
'全屏 \n 使用 fullScreen 属性来使抽屉全屏展示', | ||
'Full Screen \n Use the fullScreen property to display the Drawer in full screen' | ||
), | ||
component: require('doc/pages/components/Drawer/example-7-full-screen.js').default, | ||
rawText: require('!raw-loader!doc/pages/components/Drawer/example-7-full-screen.js'), | ||
}, | ||
{ | ||
name: '8-type', | ||
title: locate( | ||
'附带图标 \n 使用 type 属性来指定标题附带的图标', | ||
'Icon \n use type display type icon' | ||
), | ||
component: require('doc/pages/components/Drawer/example-8-type.js').default, | ||
rawText: require('!raw-loader!doc/pages/components/Drawer/example-8-type.js'), | ||
}, | ||
] | ||
|
||
const codes = undefined | ||
|
||
export default navable(props => ( | ||
<MarkDown {...props} codes={codes} source={source} examples={examples} /> | ||
)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Drawer *抽屉* | ||
屏幕边缘滑出的浮层面板。 | ||
|
||
<example /> | ||
|
||
## API | ||
|
||
### Drawer | ||
|
||
| 属性 | 类型 | 默认值 | 说明 | 可用版本 | | ||
| --- | --- | --- | --- | --- | | ||
| className | string | 无 | 扩展className | | | ||
| bodyStyle | object | - | 扩展 Drawer body 的样式 | | | ||
| footer | ReactNode | 无 | 底部内容 | | | ||
| maskCloseAble | boolean | true | 点击遮罩层是否关闭抽屉 | | | ||
| maskOpacity | number | 0.25 | 遮罩层透明度 | | | ||
| position | string | 'right' | 弹出位置,可选值为 \['top', 'right', 'bottom', 'left'] | | | ||
| style | object | 无 | 最外层扩展样式 | | | ||
| title | ReactNode | 无 | 弹出层的标题 | | | ||
| usePortal | boolean | true | 为 true 时,使用 ReactDOM.createPortal 创建弹出层,为 false 时,使用 ReactDOM.render<br />函数式调用时使用 ReactDOM.render | | | ||
| visible | boolean | false | 是否显示 | | | ||
| width | number \| string | 'auto' | 对话框宽度, 当 position 为 'right' 或 'left' 时生效 | | | ||
| height | number \| string | 'auto' | 对话框高度, 当 position 为 'top' 或 'bottom' 时生效 | | | ||
| zIndex | number | 1050 | 抽屉 z-index 值,注意:如 Drawer 嵌套 Select 组件,并且 Select 组件含有 absolute 字段,需要修改 Select 的 z-index的值 | | | ||
| rootClassName | string | - | Drawer 的根元素类名, 为遮罩层的父元素 | 1.4.2 | | ||
| container | () => HTMLElement \| HTMLElement | document.body | 渲染的目标节点 | | | ||
| maskBackground | string | 无 | 遮罩背景色,设置后透明度将失效 | | | ||
| onClose | () => void | 无 | 模态框关闭回调 | | | ||
| destroy | boolean | false | 关闭时是否销毁元素 | | | ||
| hideClose | boolean | 无 | 是否隐藏关闭按钮 | | | ||
| type | 'info' \| 'success' \| 'warning' \| 'error' \| 'normal' | 无 | Drawer title 显示状态icon | 1.6.1 | | ||
| zoom | boolean | false | 是否开启 zoom 动画效果 | | | ||
| esc | boolean | true | 是否支持 esc 键关闭 | | | ||
| events | object | 无 | 外层元素所接受的事件列表,可用于在 createPortal 场景中阻止冒泡 | | | ||
| fullScreen | boolean | false | 是否全屏展示 | | | ||
| forceMask | boolean | false | 是否强制设置遮罩透明度(多层Drawer中,除第一层外的其他Drawer遮罩透明度会被调整为0.01) | | |
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,36 @@ | ||
# Drawer | ||
A panel which slides in from the edge of the screen. | ||
|
||
<example /> | ||
|
||
## API | ||
|
||
### Drawer | ||
|
||
| Property | Type | Default | Description | version | | ||
| --- | --- | --- | --- | --- | | ||
| className | string | - | Extend className | | | ||
| bodyStyle | object | - | Extend Drawer body style | | | ||
| footer | ReactNode | - | The content at the bottom | | | ||
| maskCloseAble | boolean | true | Whether to close the mask when the mask is clicked | | | ||
| maskOpacity | number | 0.25 | The opacity of the mask | | | ||
| position | string | - | Pop-up position, one of \['top', 'right', 'bottom', 'left'] | | | ||
| style | object | - | Extend style | | | ||
| title | ReactNode | - | the title of the pop-up layer | | | ||
| usePortal | boolean | true | When the usePortal is true, use ReactDOM.createPortal to create the pop-up layer, otherwise use ReactDOM.render.<br /> Use ReactDOM.render while func call. | | | ||
| visible | boolean | false | | | | ||
| width | number \| string | 'auto' | the width of the Drawer | | | ||
| height | number \| string | 'auto' | the height of the Drawer | | | ||
| zIndex | number | 1050 | Drawer z-index | | | ||
| rootClassName | string | - | the root element of Drawer, the mask parent element | 1.4.2 | | ||
| container | () => HTMLElement \| HTMLElement | document.body | target element | | | ||
| maskBackground | string | null | mask background | | | ||
| onClose | () => void | none | Drawer close callback | | | ||
| destroy | boolean | false | Whether to destroy elements when it is closed | | | ||
| hideClose | boolean | none | hide the close button | | | ||
| type | 'info' \| 'success' \| 'warning' \| 'error' \| 'normal' | null | Drawer Title show status icon | 1.6.1 | | ||
| zoom | boolean | false | toggle zoom animation | | | ||
| esc | boolean | true | esc to close | | | ||
| events | object | none | Drawer events list, use stopPropagation at createPortal | | | ||
| fullScreen | boolean | false | display Drawer with full screen | | | ||
| forceMask | boolean | false | Whether to force the mask transparency (in multi-layer Drawer, the transparency of other Drawer masks except the first layer will be adjusted to 0.01) | | |
Oops, something went wrong.