Merge branch 'master' into feature

This commit is contained in:
Wei Zhu 2018-10-29 19:40:08 +08:00
commit af54f500eb
35 changed files with 129 additions and 138 deletions

View File

@ -15,6 +15,22 @@ timeline: true
---
## 3.10.3
`2018-10-27`
- 🌟 Improve util function `getScroll` TypeScript definition. [#12784](https://github.com/ant-design/ant-design/pull/12784) [@ztplz](https://github.com/ztplz)
- 🐞 Fixed that Checkbox inside CheckboxGroup do not trigger `onChange`. [#12642](https://github.com/ant-design/ant-design/issues/12642)
- 🐞 Fixed Calendar month picker not correct when set with `validRange`. [#12675](https://github.com/ant-design/ant-design/issues/12675)
- 🐞 Fixed multiple Select drop-down bug when set `dropdownMatchSelectWidth`. [#12816](https://github.com/ant-design/ant-design/pull/12816) [@hengkx](https://github.com/hengkx)
- 🐞 Fixed Card title overflow bug. [#12680](https://github.com/ant-design/ant-design/issues/12680)
- 🐞 Fixed Form[inline] help and extra overlapped. [#12725](https://github.com/ant-design/ant-design/issues/12725)
- Table
- 🌟 Support custom Table filter backgrounds. [#12775](https://github.com/ant-design/ant-design/pull/12775) [@ivankravets](https://github.com/ivankravets)
- 🐞 Adjust small table placeholder style. [#12682](https://github.com/ant-design/ant-design/issues/12682)
- 🐞 Fixed small size table header border missing in Firefox. [#12840](https://github.com/ant-design/ant-design/issues/12840)
- 🐞 Fixed checkbox align of small/middle size table. [#12723](https://github.com/ant-design/ant-design/issues/12723)
## 3.10.2
`2018-10-23`

View File

@ -15,6 +15,22 @@ timeline: true
---
## 3.10.3
`2018-10-27`
- 🌟 完善工具方法 `getScroll` 的 TypeScript 定义。[#12784](https://github.com/ant-design/ant-design/pull/12784) [@ztplz](https://github.com/ztplz)
- 🐞 修复 CheckboxGroup 内 Checkbox 没有触发 `onChange` 的问题。[#12642](https://github.com/ant-design/ant-design/issues/12642)
- 🐞 修复 Calendar 组件设置 `validRange` 后选择月份时的问题。[#12675](https://github.com/ant-design/ant-design/issues/12675)
- 🐞 修复 Select 组件设置了 `dropdownMatchSelectWidth` 后多选下拉框的问题。[#12816](https://github.com/ant-design/ant-design/pull/12816) [@hengkx](https://github.com/hengkx)
- 🐞 修复 Card 标题可能会被覆盖的问题。[#12680](https://github.com/ant-design/ant-design/issues/12680)
- 🐞 修复 Form[inline] 提示信息和错误文案被覆盖的问题。[#12725](https://github.com/ant-design/ant-design/issues/12725)
- Table
- 🌟 支持自定义 Table 组件的筛选按钮的背景色。[#12775](https://github.com/ant-design/ant-design/pull/12775) [@ivankravets](https://github.com/ivankravets)
- 🐞 调整 Table 组件的样式细节。[#12682](https://github.com/ant-design/ant-design/issues/12682)
- 🐞 修复在火狐下,当 size="small" 未排序时下边框不显示。[#12840](https://github.com/ant-design/ant-design/issues/12840)
- 🐞 修复大小为 small/middle 时复选框不能对齐的问题。[#12723](https://github.com/ant-design/ant-design/issues/12723)
## 3.10.2
`2018-10-23`

View File

@ -1,4 +1,4 @@
const isNumeric = (value: any): boolean => {
const isNumeric = <T extends number>(value: any): value is T => {
return !isNaN(parseFloat(value)) && isFinite(value);
};

View File

@ -22,7 +22,7 @@ describe('Avatar Render', () => {
expect(children.length).toBe(1);
expect(children.text()).toBe('Fallback');
expect(wrapper.instance().setScale).toBeCalled();
expect(div.querySelector('.ant-avatar-string').style.transform).toBe('scale(0.5)');
expect(div.querySelector('.ant-avatar-string').style.transform).toContain('scale(0.5)');
wrapper.detach();
global.document.body.removeChild(div);

View File

@ -128,13 +128,11 @@ export default class Avatar extends React.Component<AvatarProps, AvatarState> {
} else {
const childrenNode = this.avatarChildren;
if (childrenNode || scale !== 1) {
const transformString = `scale(${scale}) translateX(-50%)`;
const childrenStyle: React.CSSProperties = {
msTransform: `scale(${scale})`,
WebkitTransform: `scale(${scale})`,
transform: `scale(${scale})`,
position: 'absolute',
display: 'inline-block',
left: `calc(50% - ${Math.round(childrenNode.offsetWidth / 2)}px)`,
msTransform: transformString,
WebkitTransform: transformString,
transform: transformString,
};
const sizeChildrenStyle: React.CSSProperties =
typeof size === 'number' ? {

View File

@ -49,6 +49,12 @@
line-height: @size;
}
&-string {
position: absolute;
left: 50%;
transform-origin: 0 center;
}
&.@{avatar-prefix-cls}-icon {
font-size: @font-size;
}

View File

@ -26,9 +26,11 @@ To get a customized button, just set `type`/`shape`/`size`/`loading`/`disabled`.
| size | can be set to `small` `large` or omitted | string | `default` |
| target | same as target attribute of a, works when href is specified | string | - |
| type | can be set to `primary` `ghost` `dashed` `danger`(added in 2.7) or omitted (meaning `default`) | string | `default` |
| onClick | set the handler to handle `click` event | function | - |
| onClick | set the handler to handle `click` event | (event) => void | - |
| block | option to fit button width to its parent width | boolean | `false` |
It accepts all props which native button support.
`<Button>Hello world!</Button>` will be rendered into `<button><span>Hello world!</span></button>`, and all the properties which are not listed above will be transferred to the `<button>` tag.
`<Button href="http://example.com">Hello world!</Button>` will be rendered into `<a href="http://example.com"><span>Hello world!</span></a>`.

View File

@ -29,10 +29,12 @@ subtitle: 按钮
| size | 设置按钮大小,可选值为 `small` `large` 或者不设 | string | `default` |
| target | 相当于 a 链接的 target 属性href 存在时生效 | string | - |
| type | 设置按钮类型,可选值为 `primary` `dashed` `danger`(版本 2.7 中增加) 或者不设 | string | - |
| onClick | `click` 事件的 handler | function | - |
| onClick | 点击按钮时的回调 | (event) => void | - |
| block | 将按钮宽度调整为其父宽度的选项 | boolean | `false` |
`<Button>Hello world!</Button>` 最终会被渲染为 `<button><span>Hello world!</span></button>`,并且除了上表中的属性,其它属性都会直接传到 `<button></button>`
支持原生 button 的其他所有属性。
`<Button>Hello world!</Button>` 最终会被渲染为 `<button><span>Hello world!</span></button>`,并且除了上表中的属性,其它属性都会直接传到原生 button 上。
`<Button href="http://example.com">Hello world!</Button>` 则会渲染为 `<a href="http://example.com"><span>Hello world!</span></a>`

View File

@ -39,6 +39,7 @@
&-wrapper {
display: flex;
align-items: center;
}
&-title {
@ -46,9 +47,8 @@
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
display: flex;
align-items: center;
flex: 1;
display: inline-block;
}
.@{ant-prefix}-tabs {

View File

@ -50,6 +50,9 @@
border-radius: @border-radius-sm;
background-color: @checkbox-check-color;
transition: all .3s;
// Fix IE checked style
// https://github.com/ant-design/ant-design/issues/12597
border-collapse: separate;
&:after {
@check-width: (@checkbox-size / 14) * 5px;

View File

@ -116,7 +116,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
| defaultValue | to set default date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - |
| disabledTime | to specify the time that cannot be selected | function(dates: [moment, moment], partial: `'start'|'end'`) | - |
| format | to set the date format | string | "YYYY-MM-DD HH:mm:ss" |
| ranges | preseted ranges for quick selection | { \[range: string]: [moment](http://momentjs.com/)\[] } \| () => { \[range: string]: [moment](http://momentjs.com/)\[] } | - |
| ranges | preseted ranges for quick selection | { \[range: string]: [moment](http://momentjs.com/)\[] } \| { \[range: string]: () => [moment](http://momentjs.com/)\[] } | - |
| renderExtraFooter | render extra footer in panel | () => React.ReactNode | - |
| showTime | to provide an additional time selection | object\|boolean | [TimePicker Options](/components/time-picker/#API) |
| showTime.defaultValue | to set default time of selected date, [demo](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)\[] | [moment(), moment()] |

View File

@ -117,7 +117,7 @@ moment.locale('zh-cn');
| defaultValue | 默认日期 | [moment](http://momentjs.com/)\[] | 无 |
| disabledTime | 不可选择的时间 | function(dates: [moment, moment], partial: `'start'|'end'`) | 无 |
| format | 展示的日期格式 | string | "YYYY-MM-DD HH:mm:ss" |
| ranges       | 预设时间范围快捷选择 | { \[range: string]: [moment](http://momentjs.com/)\[] } \| () => { \[range: string]: [moment](http://momentjs.com/)\[] } | 无 |
| ranges       | 预设时间范围快捷选择 | { \[range: string]: [moment](http://momentjs.com/)\[] } \| { \[range: string]: () => [moment](http://momentjs.com/)\[] } | 无 |
| renderExtraFooter | 在面板中添加额外的页脚 | () => React.ReactNode | - |
| showTime | 增加时间选择功能 | Object\|boolean | [TimePicker Options](/components/time-picker/#API) |
| showTime.defaultValue | 设置用户选择日期时默认的时分秒,[例子](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)\[] | [moment(), moment()] |

View File

@ -21,6 +21,7 @@
display: block;
height: 1px;
width: 100%;
min-width: 100%; // Fix https://github.com/ant-design/ant-design/issues/10914
margin: 24px 0;
clear: both;
}

View File

@ -131,7 +131,9 @@ input[type="checkbox"] {
.@{form-prefix-cls}-explain,
.@{form-prefix-cls}-extra {
color: @text-color-secondary;
line-height: @line-height-base;
// Magic tweak pixel number to float line-height diff in windows
// Fix https://github.com/ant-design/ant-design/issues/12803
line-height: @line-height-base + 0.024;
transition: color .3s @ease-out; // sync input color transition
margin-top: @form-help-margin-top;
clear: both;
@ -381,9 +383,10 @@ form {
margin-bottom: 24px;
}
> .@{form-prefix-cls}-item-control-wrapper, > .@{form-prefix-cls}-item-label {
> .@{form-prefix-cls}-item-control-wrapper,
> .@{form-prefix-cls}-item-label {
display: inline-block;
vertical-align: middle;
vertical-align: top;
}
}
@ -394,11 +397,6 @@ form {
.has-feedback {
display: inline-block;
}
// Fix https://github.com/ant-design/ant-design/issues/1040
.@{form-prefix-cls}-explain {
position: absolute;
}
}
// Validation state

View File

@ -20,10 +20,10 @@ The first level navigation is inclined left near a logo, and the secondary menu
### Interaction rules
- The first level navigation and the last level navigation should be distincted by visualization;
- The first level navigation and the last level navigation should be distinguishable by visualization;
- The current item should have the highest priority of visualization;
- When the current navigation item is collapsed, the stlye of the current navigation item will be applied to its parent level;
- The left side navigation bar has support for both the accordion and expanding styles, you can choose the one that fits your case best.
- When the current navigation item is collapsed, the style of the current navigation item is applied to its parent level;
- The left side navigation bar has support for both the accordion and expanding styles; you can choose the one that fits your case the best.
## Visualization rules
@ -31,27 +31,27 @@ The first level navigation is inclined left near a logo, and the secondary menu
- **Emphasis by colorblock**
When background color is a deep color, you can use this pattern for the parent level navigation item of current page.
When background color is a deep color, you can use this pattern for the parent level navigation item of the current page.
- **The highlight match stick**
When background color is a light color, you can use this pattern for the current page navigation item, we recommed using it for the last item of the navigation path.
When background color is a light color, you can use this pattern for the current page navigation item; we recommend using it for the last item of the navigation path.
- **Hightlighted font**
- **Highlighted font**
From the visualization aspect, hightlighted font is stronger than colorblock, this pattern is often used for the parent level of the current item.
From the visualization aspect, a highlighted font is stronger than colorblock; this pattern is often used for the parent level of the current item.
- **Enlarge the size of the font**
`12px`、`14px` is a standard font size of navigations`14px` is used for the first and the second level of the navigation. You can choose a appropriate font size in terms of the level of your navigation.
`12px`、`14px` is a standard font size of navigations`14px` is used for the first and the second level of the navigation. You can choose an appropriate font size regarding the level of your navigation.
## Component Overview
- `Layout`: The layout wrapper, in which `Header` `Sider` `Content` `Footer` or `Layout` itself can be nested, and can be placed in any parent container.
- `Header`: The top layout with default style, in which any element can be nested, and must be placed in `Layout`.
- `Header`: The top layout with the default style, in which any element can be nested, and must be placed in `Layout`.
- `Sider`: The sidebar with default style and basic functions, in which any element can be nested, and must be placed in `Layout`.
- `Content`: The content layout with default style, in which any element can be nested, and must be placed in `Layout`.
- `Footer`: The bottom layout with default style, in which any element can be nested, and must be placed in `Layout`.
- `Content`: The content layout with the default style, in which any element can be nested, and must be placed in `Layout`.
- `Footer`: The bottom layout with the default style, in which any element can be nested, and must be placed in `Layout`.
> Based on `flex layout`, please pay attention to the [compatibility](http://caniuse.com/#search=flex).

View File

@ -79,6 +79,7 @@ export interface ModalFuncProps {
zIndex?: number;
okCancel?: boolean;
style?: React.CSSProperties;
maskStyle?: React.CSSProperties;
type?: string;
keyboard?: boolean;
getContainer?: (instance: React.ReactInstance) => HTMLElement;

View File

@ -15,7 +15,7 @@ interface ConfirmDialogProps extends ModalFuncProps {
const IS_REACT_16 = !!ReactDOM.createPortal;
const ConfirmDialog = (props: ConfirmDialogProps) => {
const { onCancel, onOk, close, zIndex, afterClose, visible, keyboard, centered, getContainer, okButtonProps, cancelButtonProps } = props;
const { onCancel, onOk, close, zIndex, afterClose, visible, keyboard, centered, getContainer, maskStyle, okButtonProps, cancelButtonProps } = props;
const iconType = props.iconType || 'question-circle';
const okType = props.okType || 'primary';
const prefixCls = props.prefixCls || 'ant-modal';
@ -56,6 +56,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
footer=""
maskTransitionName="fade"
maskClosable={maskClosable}
maskStyle={maskStyle}
style={style}
width={width}
zIndex={zIndex}

View File

@ -27,7 +27,7 @@ export interface PaginationProps {
className?: string;
prefixCls?: string;
selectPrefixCls?: string;
itemRender?: (page: number, type: 'page' | 'prev' | 'next' | 'jump-prev' | 'jump-next') => React.ReactNode;
itemRender?: (page: number, type: 'page' | 'prev' | 'next' | 'jump-prev' | 'jump-next', originalElement: HTMLElement) => React.ReactNode;
role?: string;
}

View File

@ -288,8 +288,9 @@
}
&-thead > tr > th.@{table-prefix-cls}-selection-column-custom {
padding-left: 16px;
padding-right: 0;
.@{table-prefix-cls}-selection {
margin-right: -15px;
}
}
&-thead > tr > th.@{table-prefix-cls}-selection-column,

View File

@ -53,11 +53,11 @@
padding: @table-padding-vertical/2 @table-padding-horizontal/2;
}
> .@{table-prefix-cls}-thead > tr > th {
background: @component-background;
background-color: @component-background;
border-bottom: @border-width-base @border-style-base @border-color-split;
}
> .@{table-prefix-cls}-thead > tr > th.@{table-prefix-cls}-column-sort {
background: @table-body-sort-bg;
background-color: @table-body-sort-bg;
}
}
@ -71,7 +71,7 @@
}
.@{table-prefix-cls}-header {
background: @component-background;
background-color: @component-background;
}
.@{table-prefix-cls}-placeholder,

View File

@ -15,7 +15,7 @@ No, but [the LICENSE of ant-design](https://github.com/ant-design/ant-design/blo
No, actually, you can convert Less to Sass/Stylus(etc...) with tools (which you can Google).
### `Select Dropdown DatePicker TimePicker Popover Popconfirm` will disappear when I click another popup component inside it, How to resolve it?
### `Select Dropdown DatePicker TimePicker Popover Popconfirm` disappear when I click another popup component inside it, How to resolve it?
Use `<Select getPopupContainer={trigger => trigger.parentNode}>` to render component inside Popover. (Or other getXxxxContainer props)
@ -23,7 +23,7 @@ https://ant.design/components/select/#Select-props
related issue: [#3487](https://github.com/ant-design/ant-design/issues/3487) [#3438](https://github.com/ant-design/ant-design/issues/3438)
### `Select Dropdown DatePicker TimePicker Popover Popconfirm` will scroll with page?
### `Select Dropdown DatePicker TimePicker Popover Popconfirm` scroll with the page?
Use `<Select getPopupContainer={trigger => trigger.parentNode}>` to render component inside the scroll area. (Or other getXxxxContainer props).
@ -31,7 +31,7 @@ https://ant.design/components/select/#Select-props
related issue: [#3487](https://github.com/ant-design/ant-design/issues/3487) [#3438](https://github.com/ant-design/ant-design/issues/3438)
### How to modify default theme of Ant Design?
### How to modify the default theme of Ant Design?
See: https://ant.design/docs/react/customize-theme .
@ -41,7 +41,7 @@ No, we follow Ant Design specification. https://github.com/ant-design/ant-design
### How to modify `Menu`/`Button`(etc...)'s style?
You can override its style. But we don't recommend to do so. antd is not only a set of React components but also a design specification.
You can override its style, but we don't recommend doing so. antd is not only a set of React components but also a design specification.
### I just want to use `Menu`/`Button`(etc...), but it seems that I have to import the whole antd and its style.
@ -64,7 +64,7 @@ See: https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
### It doesn't work when I change `defaultValue` dynamically.
The `defaultXxxx` (like `defaultValue`) of `Input`/`Select`(etc...) only works in first render. It is a specification of React, please read [React's documentation](https://facebook.github.io/react/docs/forms.html#controlled-components).
The `defaultXxxx` (like `defaultValue`) of `Input`/`Select`(etc...) only works in first render. It is a specification of React; please read [React's documentation](https://facebook.github.io/react/docs/forms.html#controlled-components).
### I set the `value` of `Input`/`Select`(etc...), and then, it cannot be changed by user's action.
@ -72,9 +72,9 @@ Try `defaultValue` or `onChange` to change `value`, and please read [React's doc
### antd override my global styles!
Yes, antd is designed to develop a complete background application, we override some global styles for styling convenience and it can't be removed now. More info trace https://github.com/ant-design/ant-design/issues/4331 .
Yes, antd is designed to develop a complete background application, we override some global styles for styling convenience, and it can't be removed now. More info trace https://github.com/ant-design/ant-design/issues/4331 .
Or follow instruction in [How to avoid modifying global styles?](docs/react/customize-theme#How-to-avoid-modifying-global-styles-?)
Or, follow the instructions in [How to avoid modifying global styles?](docs/react/customize-theme#How-to-avoid-modifying-global-styles-?)
### I cannot install `antd` and `antd`'s dependencies(etc...). FYI, I live in China mainland.
@ -94,13 +94,13 @@ Please check [And Design Mobile](http://mobile.ant.design) for details. `antd` h
### Does `antd` supply standalone files like 'react' do?
Yep, you can [import `antd` with script tag](https://ant.design/docs/react/install?locale=en-US#Import-in-Browser). But we recommend use `npm` to import `antd`, it is simple and easy to maintain.
Yep, you can [import `antd` with script tag](https://ant.design/docs/react/install?locale=en-US#Import-in-Browser). But we recommend using `npm` to import `antd`, it is simple and easy to maintain.
### I can't visit `icon` in my network environment.
You should deploy the iconfont files to your network by following this [example](https://github.com/ant-design/antd-init/tree/7c1a33cadb98f2fd8688fe527dd7f98215b9bced/examples/local-iconfont). [#1070](https://github.com/ant-design/ant-design/issues/1070)
After 3.9.x [we are using svg icon](/components/icon#svg-icons) so you don't need to deploy iconfont locally any more!
After 3.9.x [we are using svg icon](/components/icon#svg-icons), so you don't need to deploy iconfont locally anymore!
### How to extend antd's components?
@ -121,13 +121,13 @@ Here are some typical wrong examples:
- ❌ antdesign
- ❌ Antdesign
### Do you guys have any channel for donation? like PayPal or Alipay.
### Do you guys have any channel for donation, like PayPal or Alipay?
No yet.
Not yet.
### Why not?
Alibaba will pay us.
Alibaba pays us.
---
@ -141,7 +141,7 @@ An [answer from StackOverflow](http://stackoverflow.com/questions/25034994/how-t
### React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components)
Please make sure that you import `antd`'s components correctly. Read the corresponding documentation of the `antd`'s version which you use. And pay attention to typo.
Please make sure that you import `antd`'s components correctly. Read the corresponding documentation of the `antd`'s version which you use, and pay attention to typos.
### rm is not recognized as an internal or external command
@ -149,7 +149,7 @@ Please read this [issue](https://github.com/ant-design/ant-design/issues/650#iss
### Failed propType: Invalid prop `AAA` of type `BBB` supplied to `CCC`, expected `DDD`. Check the render method of `EEE`.
Please read the corresponding documentation of the `antd`'s version which you use, and make sure that you pass value with correct type to `antd`'s components,
Please read the corresponding documentation of the `antd`'s version which you use, and make sure that you pass values with correct type to `antd`'s components,
### Unknown option: xxx/package.json.presets
@ -157,4 +157,4 @@ An [answer from Stack Overflow](http://stackoverflow.com/questions/33685365/unkn
### Invariant Violation: findComponentRoot(...): Unable to find element.
You may import React twice. Set React & ReactDOM as external, if you are using webpack, See: [#525](https://github.com/ant-design/ant-design/issues/525). If you are using others(browserify, etc...), please read its documentation and find options which can set React & ReactDOM as external.
You may import React twice. Set React & ReactDOM as external, if you are using webpack, See [#525](https://github.com/ant-design/ant-design/issues/525). If you are using others (browserify, etc...), please read its documentation and find options which can set React & ReactDOM as external.

View File

@ -1,5 +1,5 @@
---
order: 3
order: 2
title: Real project with umi and dva
---

View File

@ -1,5 +1,5 @@
---
order: 3
order: 2
title: 项目实战
---

View File

@ -1,5 +1,5 @@
---
order: 5
order: 4
title: Use in TypeScript
---
@ -224,4 +224,3 @@ $ create-react-app my-project --scripts-version=react-scripts-ts-antd
### error TS2605: JSX element type Xxx is not a constructor function for JSX elements.
Before antd 3, You need setting `allowSyntheticDefaultImports` to `true` in tsconfig.json.

View File

@ -1,5 +1,5 @@
---
order: 5
order: 4
title: 在 TypeScript 中使用
---

View File

@ -1,5 +1,5 @@
---
order: 4
order: 3
title: Use in create-react-app
---

View File

@ -1,5 +1,5 @@
---
order: 4
order: 3
title: 在 create-react-app 中使用
---

View File

@ -1,6 +1,6 @@
---
category: Principles
order: 6
order: 7
title: Keep it Lightweight
---

View File

@ -1,6 +1,6 @@
---
category: 原则
order: 6
order: 7
title: 简化交互
---

View File

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "3.10.2",
"version": "3.10.3",
"title": "Ant Design",
"description": "An enterprise-class UI design language and React-based implementation",
"homepage": "http://ant.design/",
@ -110,7 +110,7 @@
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"bezier-easing": "^2.1.0",
"bisheng": "^0.28.0",
"bisheng": "^0.28.4",
"bisheng-plugin-antd": "^0.16.5",
"bisheng-plugin-description": "^0.1.4",
"bisheng-plugin-react": "^0.6.3",
@ -175,7 +175,7 @@
"reqwest": "^2.0.5",
"rimraf": "^2.6.2",
"scrollama": "^1.4.4",
"stylelint": "^9.6.0",
"stylelint": "~9.6.0",
"stylelint-config-standard": "^18.2.0",
"typescript": "~3.1.1",
"unified": "^7.0.0",
@ -185,7 +185,7 @@
"xhr2": "^0.1.4"
},
"scripts": {
"test": "jest --config .jest.js",
"test": "jest --config .jest.js --verbose=false",
"test-node": "jest --config .jest.node.js",
"test-all": "./scripts/test-all.sh",
"lint": "npm run lint:ts && npm run lint:es && npm run lint:demo && npm run lint:style",

View File

@ -130,3 +130,7 @@ a {
.drawer {
z-index: 1029;
}
#_hj_feedback_container .path1:before {
color: @primary-color !important;
}

View File

@ -20,3 +20,4 @@
@import './responsive';
@import './theme';
@import './docsearch';
@import './nprogress';

View File

@ -325,7 +325,7 @@
top: -14px;
> h2 {
margin-top: 0;
padding-top: 2px;
padding-top: 4px;
}
}
}

View File

@ -1,62 +1,14 @@
/* Make clicks pass-through */
#nprogress {
pointer-events: none;
}
.bar {
background: @primary-color;
}
#nprogress .bar {
background: @primary-color;
position: fixed;
z-index: 1031;
top: 0;
left: 0;
width: 100%;
height: 2px;
border-radius: 10px;
}
.peg {
box-shadow: 0 0 10px @primary-color, 0 0 5px @primary-color;
}
/* Fancy blur effect */
#nprogress .peg {
display: block;
position: absolute;
right: 0;
width: 100px;
height: 100%;
box-shadow: 0 0 10px @primary-color, 0 0 5px @primary-color;
opacity: 1;
transform: rotate(3deg) translate(0, -4px);
}
/* Remove these to get rid of the spinner */
#nprogress .spinner {
display: block;
position: fixed;
z-index: 1031;
top: 15px;
right: 15px;
}
#nprogress .spinner-icon {
width: 18px;
height: 18px;
box-sizing: border-box;
border: solid 2px transparent;
border-top-color: @primary-color;
border-left-color: @primary-color;
border-radius: 50%;
animation: nprogress-spinner 400ms linear infinite;
}
.nprogress-custom-parent {
overflow: hidden;
position: relative;
}
.nprogress-custom-parent #nprogress .spinner,
.nprogress-custom-parent #nprogress .bar {
position: absolute;
}
@keyframes nprogress-spinner {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
.spinner-icon {
border-top-color: @primary-color;
border-left-color: @primary-color;
}
}

View File

@ -65,20 +65,10 @@ export default class MainContent extends React.Component {
if (!window.location.hash && prevProps && prevProps.location.pathname !== location.pathname) {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
return;
}
if (this.timer) {
clearTimeout(this.timer);
}
this.timer = setTimeout(() => {
if (window.location.hash) {
document.querySelector(window.location.hash).scrollIntoView();
}
}, 50);
}
componentWillUnmount() {
clearTimeout(this.timer);
this.scroller.disable();
}