diff --git a/docs/balloon/demo/alignment.md b/docs/balloon/demo/alignment.md index 72de466676..69b10fe9c5 100644 --- a/docs/balloon/demo/alignment.md +++ b/docs/balloon/demo/alignment.md @@ -19,9 +19,6 @@ There are 12 options for align ````jsx import { Button, Balloon } from '@alifd/next'; - - - const top = ; const right = ; const bottom = ; diff --git a/docs/balloon/demo/control.md b/docs/balloon/demo/control.md index 0def632503..0751a5206b 100644 --- a/docs/balloon/demo/control.md +++ b/docs/balloon/demo/control.md @@ -18,9 +18,6 @@ Use 'visible' to control whether the popup should be displayed. ````jsx import { Button, Balloon } from '@alifd/next'; - - - class App extends React.Component { constructor(props) { super(props); diff --git a/docs/balloon/demo/onCloseClick.md b/docs/balloon/demo/onCloseClick.md index 8b42591c37..b5f1b6029a 100644 --- a/docs/balloon/demo/onCloseClick.md +++ b/docs/balloon/demo/onCloseClick.md @@ -18,9 +18,6 @@ When popup is nested in another popup, say DatePicker is nested in Balloon, use ````jsx import { Button, Balloon } from '@alifd/next'; - - - class App extends React.Component { constructor(props) { super(props); diff --git a/docs/balloon/demo/tooltip.md b/docs/balloon/demo/tooltip.md index 31c8612308..e4a66f670a 100644 --- a/docs/balloon/demo/tooltip.md +++ b/docs/balloon/demo/tooltip.md @@ -18,8 +18,6 @@ Simplified Balloon, which can only set align, trigger and children, and triggere ````jsx import { Button, Balloon } from '@alifd/next'; - - const Tooltip = Balloon.Tooltip; const top = ; diff --git a/docs/balloon/demo/triggerType.md b/docs/balloon/demo/triggerType.md index 9027ed6880..d594a6a49e 100644 --- a/docs/balloon/demo/triggerType.md +++ b/docs/balloon/demo/triggerType.md @@ -18,7 +18,6 @@ Hover, focus and click. ````jsx import { Button, Balloon, Input } from '@alifd/next'; - const content = (

content

); const MoveTarget = ; const ClickTarget = ; diff --git a/docs/balloon/index.en-us.md b/docs/balloon/index.en-us.md index d326683900..52ec9f2ee3 100644 --- a/docs/balloon/index.en-us.md +++ b/docs/balloon/index.en-us.md @@ -32,7 +32,7 @@ | alignEdge | whether align to the edge | Boolean | false | | closable | whether to show the close button | Boolean | true | | align | position of popup relative to the trigger

**option**:
't'(top)
'r'(right)
'b'(bottom)
'l'(left)
'tl'(top left)
'tr'(top right)
'bl'(bottom left)
'br'(bottom right)
'lt'(left top)
'lb'(left bottom)
'rt'(right top)
'rb'(right bottom) or their combinations | Enum | 'b' | -| offset | offset for fine tuning the popup | Array | [0, 0] | +| offset | extra adjustment for trigger element. e.g. [hoz, ver] means move to right ${hoz}px (to left in RTL mode), to bottom ${ver}px | Array | [0, 0] | | trigger | trigger of the popup | any | <span></span> | | triggerType | how to trigger the popup.

**type unit**:
'hover'
'click'
e.g.['hover', 'click'] 'click' | String/Array | 'hover' | | onClose | callback triggered when visible becomes false

**signature**:
Function() => void | Function | func.noop | diff --git a/docs/balloon/index.md b/docs/balloon/index.md index c3202e954d..280310a45f 100644 --- a/docs/balloon/index.md +++ b/docs/balloon/index.md @@ -35,7 +35,7 @@ | alignEdge | 弹出层对齐方式 | Boolean | false | | closable | 是否显示关闭按钮 | Boolean | true | | align | 弹出层位置

**可选值**:
't'(上)
'r'(右)
'b'(下)
'l'(左)
'tl'(上左)
'tr'(上右)
'bl'(下左)
'br'(下右)
'lt'(左上)
'lb'(左下)
'rt'(右上)
'rb'(右下 及其 两两组合) | Enum | 'b' | -| offset | 弹层相对于trigger的定位的微调 | Array | [0, 0] | +| offset | 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量
e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px | Array | [0, 0] | | trigger | 触发元素 | any | <span /> | | triggerType | 触发行为
鼠标悬浮, 鼠标点击('hover','click')或者它们组成的数组,如 ['hover', 'click'], 强烈不建议使用'focus',若弹窗内容有复杂交互请使用click | String/Array | 'hover' | | onClose | 任何visible为false时会触发的事件

**签名**:
Function() => void | Function | func.noop | diff --git a/docs/dropdown/index.en-us.md b/docs/dropdown/index.en-us.md index 6e4ef25fd7..c9b520878e 100644 --- a/docs/dropdown/index.en-us.md +++ b/docs/dropdown/index.en-us.md @@ -32,7 +32,7 @@ You can storage operation command with dropdown component when there are too muc | triggerType | operation type of trigger overlay toggle visible

**options**:
'hover', 'click' | Enum | 'hover' | | disabled | overlay can not toggle visible if you set disabled attribute | Boolean | false | | align | overlay position relative to trigger element, see details Overlay align | String | 'tl bl' | -| offset | overlay adjust position relative to trigger element | Array | [0, 0] | +| offset | extra adjustment for trigger element. e.g. [hoz, ver] means move to right ${hoz}px (to left in RTL mode), to bottom ${ver}px | Array | [0, 0] | | delay | delay time of toggle overlay visible(unit: ms),if triggerType value is 'hover', delay time will work | Number | 200 | | autoFocus | let element in overlay get focus or not after overlay was opened | Boolean | true | | hasMask | display mask or not | Boolean | false | @@ -48,4 +48,4 @@ You can storage operation command with dropdown component when there are too muc | Right Arrow | in vertical mode, open the submenu, navigate to the first item of the submenu; in horizontal mode, navigate at the same level, navigate to the next one | | Left Arrow | in vertical mode, close the submenu, navigate to the parent menu; in horizontal mode, navigate at the same level, navigate to the previous one | | Enter | open submenu and navigate to the first item of the submenu | -| Esc | close submenu and navigate to the parent menu item | \ No newline at end of file +| Esc | close submenu and navigate to the parent menu item | diff --git a/docs/dropdown/index.md b/docs/dropdown/index.md index a74856525d..06ad3fdafe 100644 --- a/docs/dropdown/index.md +++ b/docs/dropdown/index.md @@ -33,7 +33,7 @@ | triggerType | 触发弹层显示或隐藏的操作类型,可以是 'click','hover',或者它们组成的数组,如 ['hover', 'click'] | String/Array | 'hover' | | disabled | 设置此属性,弹层无法显示或隐藏 | Boolean | false | | align | 弹层相对于触发元素的定位, 详见 Overlay 的定位部分 | String | 'tl bl' | -| offset | 弹层相对于触发元素定位的微调 | Array | [0, 0] | +| offset | 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量
e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px | Array | [0, 0] | | delay | 弹层显示或隐藏的延时时间(以毫秒为单位),在 triggerType 被设置为 hover 时生效 | Number | 200 | | autoFocus | 弹层打开时是否让其中的元素自动获取焦点 | Boolean | - | | hasMask | 是否显示遮罩 | Boolean | false | diff --git a/docs/overlay/index.en-us.md b/docs/overlay/index.en-us.md index 22d10e7613..5340d43817 100644 --- a/docs/overlay/index.en-us.md +++ b/docs/overlay/index.en-us.md @@ -50,7 +50,7 @@ Popup is the wrapper of Overlay. It receives a node as a trigger node and pops u | onRequestClose | callback function that triggers an event when the overlay request closed

**signatures**:
Function(type: String, e: Object) => void
**params**:
_type_: {String} the reason of the overlay closure
_e_: {Object} DOM event | Function | func.noop | | target | reference element for overlay positioning | any | Position.VIEWPORT | | align | alignment of the overlay relative to the reference element, see [Alignment](#Alignment) | String/Boolean | 'tl bl' | -| offset | offset of the overlay relative to the reference element | Array | [0, 0] | +| offset | extra adjustment for trigger element. e.g. [hoz, ver] means move to right ${hoz}px (to left in RTL mode), to bottom ${ver}px | Array | [0, 0] | | container | container of the overlay, if it is a function, it should return ref, if it is a string, it is should be the id of the DOM element, it can also be passed the DOM element directly. | any | - | | hasMask | whether to show the mask | Boolean | false | | canCloseByEsc | whether to support pressing esc to close the overlay | Boolean | true | @@ -97,4 +97,4 @@ Popup is the wrapper of Overlay. It receives a node as a trigger node and pops u ## ARIA and KeyBoard -`Description`: This component needs to be used in conjunction with other components to be prompted. Refer to the above `overlay` \ No newline at end of file +`Description`: This component needs to be used in conjunction with other components to be prompted. Refer to the above `overlay` diff --git a/docs/overlay/index.md b/docs/overlay/index.md index 6add476d3f..d803e552ca 100644 --- a/docs/overlay/index.md +++ b/docs/overlay/index.md @@ -50,7 +50,7 @@ Popup 是对 Overlay 的封装,它接收某个节点作为触发节点,弹 | onRequestClose | 弹层请求关闭时触发事件的回调函数

**签名**:
Function(type: String, e: Object) => void
**参数**:
_type_: {String} 弹层关闭的来源
_e_: {Object} DOM 事件 | Function | func.noop | | target | 弹层定位的参照元素 | any | Position.VIEWPORT | | align | 弹层相对于参照元素的定位, 详见开发指南的[定位部分](#定位) | String/Boolean | 'tl bl' | -| offset | 弹层相对于参照元素定位的微调 | Array | [0, 0] | +| offset | 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量
e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px | Array | [0, 0] | | container | 渲染组件的容器,如果是函数需要返回 ref,如果是字符串则是该 DOM 的 id,也可以直接传入 DOM 节点 | any | - | | hasMask | 是否显示遮罩 | Boolean | false | | canCloseByEsc | 是否支持 esc 按键关闭弹层 | Boolean | true | diff --git a/src/balloon/balloon.jsx b/src/balloon/balloon.jsx index c1ea599b02..4b39f6ae0d 100644 --- a/src/balloon/balloon.jsx +++ b/src/balloon/balloon.jsx @@ -79,7 +79,8 @@ export default class Balloon extends React.Component { */ align: PropTypes.oneOf(alignList), /** - * 弹层相对于trigger的定位的微调 + * 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量 + * e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px */ offset: PropTypes.array, /** diff --git a/src/dropdown/dropdown.jsx b/src/dropdown/dropdown.jsx index f00311a23f..8bbaffc098 100644 --- a/src/dropdown/dropdown.jsx +++ b/src/dropdown/dropdown.jsx @@ -52,7 +52,8 @@ export default class Dropdown extends Component { */ align: PropTypes.string, /** - * 弹层相对于触发元素定位的微调 + * 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量 + * e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px */ offset: PropTypes.array, /** diff --git a/src/overlay/overlay.jsx b/src/overlay/overlay.jsx index 5163a43052..ab931a2ddd 100644 --- a/src/overlay/overlay.jsx +++ b/src/overlay/overlay.jsx @@ -85,7 +85,8 @@ export default class Overlay extends Component { */ align: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]), /** - * 弹层相对于参照元素定位的微调 + * 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量 + * e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px */ offset: PropTypes.array, /**