Skip to content

Commit

Permalink
Merge branch 'upstream-master' into feat/1.12
Browse files Browse the repository at this point in the history
* upstream-master:
  test(*): ignore compatible with 0.x
  fix(Slider): can swipe vertical & width 100% invertical
  fix(Nav): overflow when icon-only without icon
  test(Table): edit test cases
  fix(Tab): extra align middle by default
  fix(Loading): fix fullscreen in demo - add button as safe node to disable document event handler
  chore(*): resest version of webpack-dev-server
  chore(*): Release-1.11.8
  docs(ConfigProvider): add docs
  fix(Nav): icon-only overflow bug fix
  fix(Radio): button shape hover border covers checked border
  fix(Form): remove warning while message write in jsx
  fix(Form): switch aligin while size=large
  fix(Select): fix Select with useVirtual when empty dataSource (alibaba-fusion#164)
  fix(Validate): value can be false
  fix(Nav): can't config nav group label font size/height
  Update License
  fix(CascaderSelect): value type not equal dataSource value
  fix(Timeline): timline-item warning  has function type prop

# Conflicts:
#	src/nav/main.scss
  • Loading branch information
tao1991123 committed Jan 16, 2019
2 parents 6dea053 + 63990c0 commit f87d5fc
Show file tree
Hide file tree
Showing 27 changed files with 170 additions and 36 deletions.
4 changes: 2 additions & 2 deletions src/balloon/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Tooltip from './tooltip';
import Inner from './inner';

Balloon.Tooltip = ConfigProvider.config(Tooltip, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('text' in props) {
deprecated('text', 'children', 'Tooltip');
const { text, ...others } = props;
Expand All @@ -17,7 +17,7 @@ Balloon.Tooltip = ConfigProvider.config(Tooltip, {
Balloon.Inner = Inner;

export default ConfigProvider.config(Balloon, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if (props.alignment) {
deprecated('alignment', 'alignEdge', 'Balloon');
const { alignment, ...others } = props;
Expand Down
2 changes: 1 addition & 1 deletion src/button/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ButtonGroup from './view/group';
Button.Group = ButtonGroup;

export default ConfigProvider.config(Button, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('shape' in props) {
deprecated('shape', 'text | warning | ghost', 'Button');

Expand Down
2 changes: 1 addition & 1 deletion src/card/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ConfigProvider from '../config-provider';
import Card from './card';

export default ConfigProvider.config(Card, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('titlePrefixLine' in props) {
deprecated('titlePrefixLine', 'showTitleBullet', 'Card');
const { titlePrefixLine, ...others } = props;
Expand Down
2 changes: 1 addition & 1 deletion src/cascader-select/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ConfigProvider from '../config-provider';
import CascaderSelect from './cascader-select';

export default ConfigProvider.config(CascaderSelect, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('shape' in props) {
deprecated('shape', 'hasBorder', 'CascaderSelect');
const { shape, ...others } = props;
Expand Down
2 changes: 1 addition & 1 deletion src/cascader/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ConfigProvider from '../config-provider';
import Cascader from './cascader';

export default ConfigProvider.config(Cascader, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('expandTrigger' in props) {
deprecated('expandTrigger', 'expandTriggerType', 'Cascader');
const { expandTrigger, ...others } = props;
Expand Down
1 change: 1 addition & 0 deletions src/dialog/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Dialog.confirm = config => {
return confirm(config);
};

/* istanbul ignore next */
function processProps(props, deprecated) {
if ('closable' in props) {
deprecated('closable', 'closeable', 'Dialog');
Expand Down
4 changes: 2 additions & 2 deletions src/form/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Reset from './reset';
import Error from './error';

Form.Item = ConfigProvider.config(Item, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('validateStatus' in props) {
deprecated('validateStatus', 'validateState', 'Form.Item');

Expand All @@ -22,7 +22,7 @@ Form.Reset = Reset;
Form.Error = Error;

export default ConfigProvider.config(Form, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('direction' in props) {
deprecated('direction', 'inline', 'Form');
const { direction, ...others } = props;
Expand Down
2 changes: 1 addition & 1 deletion src/grid/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Col from './col';

const Grid = {
Row: ConfigProvider.config(Row, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('type' in props) {
deprecated('type', 'fixed | wrap | gutter', 'Row');

Expand Down
37 changes: 27 additions & 10 deletions src/nav/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@import "scss/mixin";
@import "scss/variable";

$nav-icononly-width: $s-15;

#{$nav-prefix} {
@include box-sizing;
min-width: auto;
Expand All @@ -18,8 +20,10 @@

&-icon-placeholder {
display: inline-block;
width: $nav-icon-self-size;
height: $nav-icon-self-size;
width: $nav-icon-only-font-size;
height: $nav-icon-only-font-size;
margin-left: ($nav-icononly-width - $nav-icon-only-font-size) / 2 - $nav-ver-item-padding-lr - $nav-primary-border-width;
margin-right: ($nav-icononly-width - $nav-icon-only-font-size) / 2 - $nav-ver-item-padding-lr - $nav-primary-border-width;
}

&-group-label {
Expand Down Expand Up @@ -318,19 +322,32 @@
#{$nav-prefix}-icon.#{$css-prefix}icon {
@include icon-size(
$size: $nav-icon-only-font-size,
$marginLeft: (18px - $nav-icon-only-font-size) / 2,
$marginRight: (18px - $nav-icon-only-font-size) / 2
$marginLeft: ($nav-icononly-width - $nav-icon-only-font-size) / 2 - $nav-ver-item-padding-lr - $popup-local-border-width,
$marginRight: ($nav-icononly-width - $nav-icon-only-font-size) / 2 - $nav-ver-item-padding-lr - $popup-local-border-width
);
}
}
#{$nav-prefix}-icon.#{$css-prefix}icon {
@include icon-size(
$size: $nav-icon-only-font-size,
$marginLeft: (20px - $nav-icon-only-font-size) / 2,
$marginRight: (20px - $nav-icon-only-font-size) / 2
);

&.#{$css-prefix}primary {
#{$nav-prefix}-icon.#{$css-prefix}icon {
@include icon-size(
$size: $nav-icon-only-font-size,
$marginLeft: ($nav-icononly-width - $nav-icon-only-font-size) / 2 - $nav-ver-item-padding-lr - $nav-primary-border-width,
$marginRight: ($nav-icononly-width - $nav-icon-only-font-size) / 2 - $nav-ver-item-padding-lr - $nav-primary-border-width
);
}
}
&.#{$css-prefix}secondary {
#{$nav-prefix}-icon.#{$css-prefix}icon {
@include icon-size(
$size: $nav-icon-only-font-size,
$marginLeft: ($nav-icononly-width - $nav-ver-item-padding-lr * 2 - $nav-secondary-border-width * 2 - $nav-icon-only-font-size) / 2,
$marginRight: ($nav-icononly-width - $nav-ver-item-padding-lr * 2 - $nav-secondary-border-width * 2 - $nav-icon-only-font-size) / 2
);
}
}


#{$nav-prefix}-icon-only-arrow.#{$css-prefix}icon {
@include icon-size(
$size: $nav-icon-only-font-size,
Expand Down
2 changes: 1 addition & 1 deletion src/progress/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ConfigProvider from '../config-provider';
import Progress from './view/progress';

export default ConfigProvider.config(Progress, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('type' in props) {
deprecated('type', 'progressive', 'Progress');

Expand Down
2 changes: 1 addition & 1 deletion src/range/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ConfigProvider from '../config-provider';
import Range from './view/range';

export default ConfigProvider.config(Range, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('hasTips' in props) {
deprecated('hasTips', 'hasTip', 'Range');

Expand Down
2 changes: 1 addition & 1 deletion src/rating/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ConfigProvider from '../config-provider';
import Rating from './rating';

export default ConfigProvider.config(Rating, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('type' in props) {
deprecated('type', 'showGrade', 'Rating');

Expand Down
2 changes: 1 addition & 1 deletion src/search/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ConfigProvider from '../config-provider';
import Search from './Search';

export default ConfigProvider.config(Search, {
transfrom: (props, deprecated) => {
transfrom: /* istanbul ignore next */(props, deprecated) => {
const {onInputFocus, overlayVisible, combox, ...others} = this.props;

const newprops = others;
Expand Down
3 changes: 2 additions & 1 deletion src/select/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Select.Option = Option;
Select.OptionGroup = OptionGroup;

// compatible with 0.x version
/* istanbul ignore next */
function transform(props, deprecated) {
const { shape, container, multiple, filterBy, overlay, safeNode, noFoundContent, ...others } = props;

Expand Down Expand Up @@ -55,7 +56,7 @@ function transform(props, deprecated) {

// compatible with 0.x version: Select.Combobox
Select.Combobox = ConfigProvider.config(Select, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
deprecated('Select.Combobox', '<Select showSearch={true}/>', 'Select');

const newprops = transform(props, deprecated);
Expand Down
2 changes: 1 addition & 1 deletion src/slider/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Slider from './slider';

export default ConfigProvider.config(Slider, {
exportNames: ['resize'],
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('fade' in props) {
deprecated('fade', 'animation', 'Slider');

Expand Down
1 change: 0 additions & 1 deletion src/slider/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
&-dots {
display: block;
position: absolute;
z-index: 100;
margin: 0;
padding: 0;

Expand Down
4 changes: 3 additions & 1 deletion src/slider/slick/inner-slider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class InnerSlider extends React.Component {
slidesToScroll: PropTypes.number,
variableWidth: PropTypes.bool,
vertical: PropTypes.bool,
verticalSwiping: PropTypes.bool,
prevArrow: PropTypes.element,
nextArrow: PropTypes.element,
dotsRender: PropTypes.func,
Expand Down Expand Up @@ -212,7 +213,7 @@ class InnerSlider extends React.Component {
prefix, animation, arrows, arrowSize, arrowPosition, arrowDirection,
dots, dotsClass, cssEase, speed, infinite, centerMode, centerPadding,
lazyLoad, dotsDirection, rtl, slidesToShow, slidesToScroll,
variableWidth, vertical, focusOnSelect, children, dotsRender, triggerType
variableWidth, vertical, verticalSwiping, focusOnSelect, children, dotsRender, triggerType
} = this.props;

const {
Expand Down Expand Up @@ -242,6 +243,7 @@ class InnerSlider extends React.Component {
trackStyle,
variableWidth,
vertical,
verticalSwiping,
triggerType
// clickHandler: this.changeSlide, unused
};
Expand Down
7 changes: 6 additions & 1 deletion src/slider/slick/mixins/event-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ const EventHandlers = {
touchObject.curY = (e.touches) ? e.touches[0].pageY : e.clientY;
touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(touchObject.curX - touchObject.startX, 2)));

const positionOffset = (this.props.rtl === false ? 1 : -1) * (touchObject.curX > touchObject.startX ? 1 : -1);
let positionOffset = (this.props.rtl === false ? 1 : -1) * (touchObject.curX > touchObject.startX ? 1 : -1);

if (this.props.verticalSwiping === true) {
touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(touchObject.curY - touchObject.startY, 2)));
positionOffset = touchObject.curY > touchObject.startY ? 1 : -1;
}

const currentSlide = this.state.currentSlide;
const dotCount = Math.ceil(this.state.slideCount / this.props.slidesToScroll);
Expand Down
4 changes: 4 additions & 0 deletions src/slider/slick/track.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ const getSlideStyle = function(specProps) {
}
}

if (specProps.vertical) {
style.width = '100%';
}

return style;
};

Expand Down
2 changes: 2 additions & 0 deletions src/slider/slider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export default class Slider extends Component {
arrowSize: 'medium',
arrowPosition: 'inner',
vertical: false,
verticalSwiping: true,
dots: true,
dotsDirection: 'hoz',
arrows: true,
Expand Down Expand Up @@ -225,6 +226,7 @@ export default class Slider extends Component {
if (slideDirection === 'ver') {
// 向下传递时使用 vertical 属性
sliderProps.vertical = true;
sliderProps.verticalSwiping = true;
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/step/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import StepItem from './view/step-item';
Step.Item = StepItem;

export default ConfigProvider.config(Step, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('type' in props) {
deprecated('type', 'shape', 'Step');

Expand Down
2 changes: 1 addition & 1 deletion src/tab/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ConfigProvider from '../config-provider';
import Tab from './tab';

export default ConfigProvider.config(Tab, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('type' in props) {
deprecated('type', 'shape', 'Tab');
const { type, ...others } = props;
Expand Down
3 changes: 1 addition & 2 deletions src/tag/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import Group from './tag-group';
import Selectable from './selectable';
import Closable from './closeable';

/* istanbul ignore next */
const ConfigTag = ConfigProvider.config(Tag, {
transfrom: (props, deprecated) => {
transfrom: /* istanbul ignore next */(props, deprecated) => {
const {shape, type} = props;
if (shape === 'selectable') {
deprecated('shape=selectable', 'Tag.Selectable', 'Tag');
Expand Down
2 changes: 1 addition & 1 deletion src/time-picker/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ConfigProvider from '../config-provider';
import TimePicker from './time-picker';

export default ConfigProvider.config(TimePicker, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('defaultOpen' in props) {
deprecated('defaultOpen', 'defaultVisible', 'TimePicker');
const { defaultOpen, ...others } = props;
Expand Down
2 changes: 1 addition & 1 deletion src/tree-select/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ConfigProvider from '../config-provider';
import TreeSelect from './tree-select';

export default ConfigProvider.config(TreeSelect, {
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
if ('shape' in props) {
deprecated('shape', 'hasBorder', 'TreeSelect');
const { shape, ...others } = props;
Expand Down
7 changes: 5 additions & 2 deletions src/upload/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Upload.Selecter = Selecter;
Upload.Uploader = Uploader;
Upload.ErrorCode = errorCode;
// compatible with 0.x version
/* istanbul ignore next */
function transform(props, deprecated) {
const { listType, defaultFileList, fileList, ...others } = props;
const newprops = others;
Expand Down Expand Up @@ -44,7 +45,7 @@ function transform(props, deprecated) {
// compatible with 0.x version
Upload.ImageUpload = ConfigProvider.config(Card, {
componentName: 'Upload',
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
deprecated('Upload.ImageUpload', 'Upload.Card', 'Upload');
const newprops = transform(props, () => { });
if (newprops.locale && newprops.locale.image) {
Expand All @@ -58,7 +59,7 @@ Upload.ImageUpload = ConfigProvider.config(Card, {
// compatible with 0.x version
Upload.DragUpload = ConfigProvider.config(Dragger, {
componentName: 'Upload',
transform: (props, deprecated) => {
transform: /* istanbul ignore next */(props, deprecated) => {
deprecated('Upload.DragUpload', 'Upload.Dragger', 'Upload');
const newprops = transform(props, () => { });
if (!newprops.listType) {
Expand All @@ -70,6 +71,7 @@ Upload.DragUpload = ConfigProvider.config(Dragger, {
});

// compatible with 0.x version
/* istanbul ignore next */
Upload.Core = class Core extends React.Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -117,6 +119,7 @@ Upload.List = ConfigProvider.config(List, {
});

// compatible with 0.x version
/* istanbul ignore next */
Upload.CropUpload = function() {
log.deprecated('Upload.CropUpload', '@alife/bc-next-crop-upload', 'Upload');
return null;
Expand Down
Loading

0 comments on commit f87d5fc

Please sign in to comment.