From 718a86d56b75156c7d8f85e75617b6fb66ec1722 Mon Sep 17 00:00:00 2001 From: orzyyyy Date: Sun, 6 Oct 2019 17:39:54 +0800 Subject: [PATCH] chore: rename prop specialTriggerStyle to zeroWidthTriggerStyle --- components/layout/Sider.tsx | 8 ++++---- components/layout/__tests__/index.test.js | 4 ++-- components/layout/index.en-US.md | 2 +- components/layout/index.zh-CN.md | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/layout/Sider.tsx b/components/layout/Sider.tsx index 48b63cf40b08..319a62fe5415 100644 --- a/components/layout/Sider.tsx +++ b/components/layout/Sider.tsx @@ -52,7 +52,7 @@ export interface SiderProps extends React.HTMLAttributes { defaultCollapsed?: boolean; reverseArrow?: boolean; onCollapse?: (collapsed: boolean, type: CollapseType) => void; - specialTriggerStyle?: React.CSSProperties; + zeroWidthTriggerStyle?: React.CSSProperties; trigger?: React.ReactNode; width?: number | string; collapsedWidth?: number | string; @@ -187,7 +187,7 @@ class InternalSider extends React.Component { style, width, collapsedWidth, - specialTriggerStyle, + zeroWidthTriggerStyle, ...others } = this.props; const prefixCls = getPrefixCls('layout-sider', customizePrefixCls); @@ -198,7 +198,7 @@ class InternalSider extends React.Component { 'breakpoint', 'onBreakpoint', 'siderHook', - 'specialTriggerStyle', + 'zeroWidthTriggerStyle', ]); const rawWidth = this.state.collapsed ? collapsedWidth : width; // use "px" as fallback unit for width @@ -211,7 +211,7 @@ class InternalSider extends React.Component { className={`${prefixCls}-zero-width-trigger ${prefixCls}-zero-width-trigger-${ reverseArrow ? 'right' : 'left' }`} - style={specialTriggerStyle} + style={zeroWidthTriggerStyle} > diff --git a/components/layout/__tests__/index.test.js b/components/layout/__tests__/index.test.js index e77b280e13e8..458b8bf7674a 100644 --- a/components/layout/__tests__/index.test.js +++ b/components/layout/__tests__/index.test.js @@ -186,9 +186,9 @@ describe('Sider', () => { ); }); - it('specialTriggerStyle should work', () => { + it('zeroWidthTriggerStyle should work', () => { const wrapper = mount( - + diff --git a/components/layout/index.en-US.md b/components/layout/index.en-US.md index 79d3d2aa702c..d25dd32ea88e 100644 --- a/components/layout/index.en-US.md +++ b/components/layout/index.en-US.md @@ -95,12 +95,12 @@ The sidebar. | defaultCollapsed | to set the initial status | boolean | false | | | reverseArrow | reverse direction of arrow, for a sider that expands from the right | boolean | false | | | style | to customize the styles | object | - | | -| specialTriggerStyle | to customize the styles of the special trigger that appears when collapsedWidth is 0 | object | - | 3.24.0 | | theme | color theme of the sidebar | string: `light` `dark` | `dark` | 3.6.0 | | trigger | specify the customized trigger, set to null to hide the trigger | string\|ReactNode | - | | | width | width of the sidebar | number\|string | 200 | | | onCollapse | the callback function, executed by clicking the trigger or activating the responsive layout | (collapsed, type) => {} | - | | | onBreakpoint | the callback function, executed when [breakpoints](/components/grid#api) changed | (broken) => {} | - | 3.7.0 | +| zeroWidthTriggerStyle | to customize the styles of the special trigger that appears when `collapsedWidth` is 0 | object | - | 3.24.0 | #### breakpoint width diff --git a/components/layout/index.zh-CN.md b/components/layout/index.zh-CN.md index 9921a740455b..d60a94b15017 100644 --- a/components/layout/index.zh-CN.md +++ b/components/layout/index.zh-CN.md @@ -96,12 +96,12 @@ title: Layout | defaultCollapsed | 是否默认收起 | boolean | false | | | reverseArrow | 翻转折叠提示箭头的方向,当 Sider 在右边时可以使用 | boolean | false | | | style | 指定样式 | object | - | | -| specialTriggerStyle | 指定当 `collapsedWidth` 为 0 时出现的特殊 trigger 的样式 | object | - | 3.24.0 | | theme | 主题颜色 | string: `light` `dark` | `dark` | 3.6.0 | | trigger | 自定义 trigger,设置为 null 时隐藏 trigger | string\|ReactNode | - | | | width | 宽度 | number\|string | 200 | | | onCollapse | 展开-收起时的回调函数,有点击 trigger 以及响应式反馈两种方式可以触发 | (collapsed, type) => {} | - | | | onBreakpoint | 触发响应式布局[断点](/components/grid#api)时的回调 | (broken) => {} | - | 3.7.0 | +| zeroWidthTriggerStyle | 指定当 `collapsedWidth` 为 0 时出现的特殊 trigger 的样式 | object | - | 3.24.0 | #### breakpoint width