Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jinli.lyy committed Jan 28, 2019
2 parents 406c198 + 8e0b1ff commit 796a57e
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 64 deletions.
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
# Change Log
# Change Log

<a name="1.12.2"></a>
## [1.12.2](https://github.com/alibaba-fusion/next/compare/1.12.1...1.12.2) (2019-01-28)


### Bug Fixes

* **Util:** DO NOT process any non-string type value ([2a3280f](https://github.com/alibaba-fusion/next/commit/2a3280f))




<a name="1.12.1"></a>
## [1.12.1](https://github.com/alibaba-fusion/next/compare/1.12.0...1.12.1) (2019-01-27)


### Bug Fixes

* **Upload:** import method from wrong path ([7c1a6b6](https://github.com/alibaba-fusion/next/commit/7c1a6b6))




<a name="1.12.0"></a>
# [1.12.0](https://github.com/alibaba-fusion/next/compare/1.11.11...1.12.0) (2019-01-25)
Expand Down
59 changes: 3 additions & 56 deletions LATESTLOG.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,10 @@
# Latest Log
# Latest Log

# [1.12.0](https://github.com/alibaba-fusion/next/compare/1.11.11...1.12.0) (2019-01-25)
## [1.12.2](https://github.com/alibaba-fusion/next/compare/1.12.1...1.12.2) (2019-01-28)


### Bug Fixes

* **Card:** not compute card footer in height ([45da06d](https://github.com/alibaba-fusion/next/commit/45da06d))
* **Cascader:** array will reverse ([24e2a0d](https://github.com/alibaba-fusion/next/commit/24e2a0d))
* **Dialog:** add aria-label for close icon ([4a1d8ea](https://github.com/alibaba-fusion/next/commit/4a1d8ea))
* **Form:** add role=grid to form ([b2f3cad](https://github.com/alibaba-fusion/next/commit/b2f3cad))
* **Menu:** keycode.space trigger click ([531492e](https://github.com/alibaba-fusion/next/commit/531492e))
* **NumberPicker:** no onBlur while click btn ([6e70f1e](https://github.com/alibaba-fusion/next/commit/6e70f1e))
* **Pagination:** pageSizeSelector is overlay ([9b7464a](https://github.com/alibaba-fusion/next/commit/9b7464a))
* **Search:** disable not work ([1bedb19](https://github.com/alibaba-fusion/next/commit/1bedb19))
* **Select:** Option value can be array ([fe350f2](https://github.com/alibaba-fusion/next/commit/fe350f2))
* **Select:** display text should not change while under controlled ([b962954](https://github.com/alibaba-fusion/next/commit/b962954))
* **Select:** text should updated with dataSource changed ([16588fe](https://github.com/alibaba-fusion/next/commit/16588fe))
* **Switch:** add focus state, close [#177](https://github.com/alibaba-fusion/next/issues/177) ([479206d](https://github.com/alibaba-fusion/next/commit/479206d))
* **Tab:** also update doc ([d7d0ab5](https://github.com/alibaba-fusion/next/commit/d7d0ab5))
* **Tab:** pure/text/capsule extra align center ([3f3282b](https://github.com/alibaba-fusion/next/commit/3f3282b))
* **Tab:** TabItem no 'disabled' prop in API document ([28ed342](https://github.com/alibaba-fusion/next/commit/28ed342))
* **Tree:** expandKeys will reset on async load data ([b1818d1](https://github.com/alibaba-fusion/next/commit/b1818d1))
* **TreeSelect:** support defaultValue/value is null string ([ab04292](https://github.com/alibaba-fusion/next/commit/ab04292))
* **Upload:** expose error to OnError in beforeUpload, Close [#128](https://github.com/alibaba-fusion/next/issues/128) ([1981db5](https://github.com/alibaba-fusion/next/commit/1981db5))


### Features

* **Badge:** support aria ([d890f47](https://github.com/alibaba-fusion/next/commit/d890f47))
* **Breadcrumb:** support a11y ([bd93737](https://github.com/alibaba-fusion/next/commit/bd93737))
* **CascaderSelect:** support a11y ([4a40b2a](https://github.com/alibaba-fusion/next/commit/4a40b2a))
* **CascaderSelect:** support itemRender ([9afffaa](https://github.com/alibaba-fusion/next/commit/9afffaa))
* **Collapse:** accessibility support ([48bee98](https://github.com/alibaba-fusion/next/commit/48bee98))
* **ConfigProvider:** support set rtl when setting locale ([72f3b0f](https://github.com/alibaba-fusion/next/commit/72f3b0f))
* **DatePicker:** add dateCellRender monthCellRender prop ([ca549f9](https://github.com/alibaba-fusion/next/commit/ca549f9))
* **DatePicker:** add inputProps prop ([3d92b8a](https://github.com/alibaba-fusion/next/commit/3d92b8a))
* **Dialog:** throw Error when occur in onOk ([35e1a9a](https://github.com/alibaba-fusion/next/commit/35e1a9a))
* **Dropdown:** support aria ([df2a05d](https://github.com/alibaba-fusion/next/commit/df2a05d))
* **Nav:** support aria ([bf4de51](https://github.com/alibaba-fusion/next/commit/bf4de51))
* **NumberPicker:** a11y support ([8eacabf](https://github.com/alibaba-fusion/next/commit/8eacabf))
* **Pagination:** add a11y support ([b922a06](https://github.com/alibaba-fusion/next/commit/b922a06))
* **Progress:** progress accessibility support ([524e97f](https://github.com/alibaba-fusion/next/commit/524e97f))
* **Radio:** support name props for Radio & customer tagName for Group ([3e4e971](https://github.com/alibaba-fusion/next/commit/3e4e971))
* **Range:** a11y ([4d2b69c](https://github.com/alibaba-fusion/next/commit/4d2b69c))
* **Rating:** accessibility support ([f68a23c](https://github.com/alibaba-fusion/next/commit/f68a23c))
* **Slider:** support aria ([c9bf1d2](https://github.com/alibaba-fusion/next/commit/c9bf1d2))
* **SplitButton:** add leftButtonProps ([4d854e0](https://github.com/alibaba-fusion/next/commit/4d854e0))
* **Step:** support aria ([3b55daa](https://github.com/alibaba-fusion/next/commit/3b55daa))
* **Switch:** switch a11y ([2c2645c](https://github.com/alibaba-fusion/next/commit/2c2645c))
* **Tab:** tab a11y ([7a47360](https://github.com/alibaba-fusion/next/commit/7a47360))
* **Table:** add alignHeader & remove locale ([7f99ed0](https://github.com/alibaba-fusion/next/commit/7f99ed0))
* **TimePicker:** support a11y ([590dae6](https://github.com/alibaba-fusion/next/commit/590dae6))
* **Tree:** support a11y ([e7ec789](https://github.com/alibaba-fusion/next/commit/e7ec789))
* **Upload:** add error text for text list ([32149af](https://github.com/alibaba-fusion/next/commit/32149af))
* **Upload:** add progress props ([f2d460c](https://github.com/alibaba-fusion/next/commit/f2d460c))
* **Upload:** disallow remove when disabled, Close [#132](https://github.com/alibaba-fusion/next/issues/132) ([e535cde](https://github.com/alibaba-fusion/next/commit/e535cde))
* **Upload:** image list error text display ([69bbc64](https://github.com/alibaba-fusion/next/commit/69bbc64))
* **Upload:** mod upload config ability ([432ef76](https://github.com/alibaba-fusion/next/commit/432ef76))
* **Upload:** support custom request method ([1a9a7b6](https://github.com/alibaba-fusion/next/commit/1a9a7b6))
* **Upload:** trigger error when exceed limit ([cf71c2a](https://github.com/alibaba-fusion/next/commit/cf71c2a))
* **Util:** DO NOT process any non-string type value ([2a3280f](https://github.com/alibaba-fusion/next/commit/2a3280f))


2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var next = require('./lib/index.js');

next.version = '1.12.0';
next.version = '1.12.2';

module.exports = next;
17 changes: 16 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alifd/next",
"version": "1.12.0",
"version": "1.12.2",
"description": "A configurable component library for web built on React.",
"keywords": [
"fusion",
Expand Down
6 changes: 3 additions & 3 deletions src/tab/tabs/nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { events } from '../../util';
import { triggerEvents, getOffsetLT, getOffsetWH, isTransformSupported } from './utils';

const noop = () => { };
const floatRight = { float: 'right' };
const floatLeft = { float: 'left' };
const floatRight = { float: 'right', zIndex: 1 };
const floatLeft = { float: 'left', zIndex: 1 };
const { Popup } = Overlay;

class Nav extends React.Component {
Expand Down Expand Up @@ -64,7 +64,7 @@ class Nav extends React.Component {
ctx.slideTimer = setTimeout(() => {
ctx.setSlideBtn();
}, 200);
if (this.activeTab) {
if (this.activeTab && findDOMNode(this).contains(document.activeElement)) {
this.activeTab.focus();
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/upload/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import ConfigProvider from '../config-provider';
import { log, errorCode } from '../util';
import { log } from '../util';
import { errorCode } from './util';
import Upload from './upload';
import List from './list';
import Card from './card';
Expand Down
22 changes: 22 additions & 0 deletions src/util/string.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { warning } from './log';
import { typeOf } from './object';

/**
* 将字符串转化为驼峰式写法
* @param {String} str 例:-webkit-transition
Expand All @@ -16,6 +19,15 @@ export function camelcase (str) {
* @return {String} 例:-webkit-transition
*/
export function hyphenate (str) {
const strType = typeOf(str);
if (strType !== 'String') {
warning(
'[ hyphenate(str: string): string ] ' +
`Expected arguments[0] to be a string but get a ${strType}.` +
'It will return an empty string without any processing.'
);
return '';
}
return str.replace(/([A-Z])/g, $0 => `-${$0.toLowerCase()}`);
}

Expand All @@ -26,6 +38,16 @@ export function hyphenate (str) {
* @return {String} 例:
*/
export function template (tpl, object = {}) {
const tplType = typeOf(tpl);
if (tplType !== 'String') {
warning(
'[ template(tpl: string, object: object): string ] ' +
`Expected arguments[0] to be a string but get a ${tplType}.` +
'It will return an empty string without any processing.'
);
return '';
}

return tpl.replace(/\{[a-z]*\}/g, (str) => {
const key = str.substring(1, str.length - 1);
return object[key] || '';
Expand Down
16 changes: 16 additions & 0 deletions test/util/string-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,27 @@ describe('src/string.js', function() {
assert(string.hyphenate('transitionDelay') === 'transition-delay');
});

it('string.hyphenate(str) should return empty string if arg[0] is not a string', function () {
assert(string.hyphenate() === '');
assert(string.hyphenate(null) === '');
assert(string.hyphenate([]) === '');
assert(string.hyphenate({}) === '');
assert(string.hyphenate(function() {}) === '');
})

it('camelcase can restore the result of hyphenate', function () {
assert(string.camelcase(string.hyphenate('WebkitTransition')) === 'WebkitTransition');
});

it('string.template(tpl, obj) should return correct string', function () {
assert(string.template('当前{current}, 共{total}页', { total: 3, current: 1}) === '当前1, 共3页');
});

it('string.template(tpl, obj) should return empty string if arg[0] is not a string', function () {
assert(string.template() === '');
assert(string.template(null) === '');
assert(string.template([]) === '');
assert(string.template({}) === '');
assert(string.template(function() {}) === '');
})
});

0 comments on commit 796a57e

Please sign in to comment.