-
More
{{contentList[key]}}
-
+
-
onTabChange(key, 'noTitleKey')"
>
-
-
+
article content
+
app content
+
project content
+
diff --git a/components/card/index.en-US.md b/components/card/index.en-US.md
index d7271a6c2..1f1c07076 100644
--- a/components/card/index.en-US.md
+++ b/components/card/index.en-US.md
@@ -12,6 +12,8 @@
| hoverable | Lift up when hovering card | boolean | false |
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | false |
| tabList | List of TabPane's head. | Array<{key: string, tab: ReactNode}> | - |
+| activeTabKey | Current TabPane's key | string | - |
+| defaultActiveTabKey | Initial active TabPane's key, if `activeTabKey` is not set. | string | - |
| title | Card title | string\|ReactNode | - |
| type | Card style type, can be set to `inner` or not set | string | - |
| onTabChange | Callback when tab is switched | (key) => void | - |
diff --git a/components/card/index.zh-CN.md b/components/card/index.zh-CN.md
index 35bf37488..058c5f540 100644
--- a/components/card/index.zh-CN.md
+++ b/components/card/index.zh-CN.md
@@ -13,6 +13,8 @@
| hoverable | 鼠标移过时可浮起 | boolean | false |
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false |
| tabList | 页签标题列表 | Array<{key: string, tab: ReactNode}> | - |
+| activeTabKey | 当前激活页签的 key | string | - |
+| defaultActiveTabKey | 初始化选中页签的 key,如果没有设置 activeTabKey | string | 第一个页签 |
| title | 卡片标题 | string\|ReactNode | - |
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - |
| onTabChange | 页签切换的回调 | (key) => void | - |
diff --git a/components/card/style/index.less b/components/card/style/index.less
index 47108f0f7..d87ab7973 100644
--- a/components/card/style/index.less
+++ b/components/card/style/index.less
@@ -3,6 +3,7 @@
@card-prefix-cls: ~"@{ant-prefix}-card";
@card-head-height: 48px;
+@card-hover-border: rgba(0, 0, 0, 0.09);
.@{card-prefix-cls} {
.reset-component;
@@ -15,7 +16,7 @@
cursor: pointer;
&:hover {
box-shadow: @card-shadow;
- border-color: rgba(0, 0, 0, 0.09);
+ border-color: @card-hover-border;
}
}
@@ -134,10 +135,16 @@
& > .anticon {
font-size: 16px;
+ line-height: 22px;
+ display: block;
+ width: 100%;
}
a {
color: @text-color-secondary;
+ line-height: 22px;
+ display: inline-block;
+ width: 100%;
&:hover {
color: @primary-color;
diff --git a/components/index.js b/components/index.js
index 92e252232..08cedeb4c 100644
--- a/components/index.js
+++ b/components/index.js
@@ -84,7 +84,10 @@ const MenuDivider = Menu.Divider
const MenuItemGroup = Menu.ItemGroup
export { Menu, MenuItem, SubMenu, MenuDivider, MenuItemGroup }
-export { default as Card } from './card'
+import Card from './card'
+const CardMeta = Card.Meta
+const CardGrid = Card.Grid
+export { Card, CardMeta, CardGrid }
import Dropdown from './dropdown'
const DropdownButton = Dropdown.Button
diff --git a/components/style/color/bezierEasing.less b/components/style/color/bezierEasing.less
index 78d94d550..eb8ee7a2c 100644
--- a/components/style/color/bezierEasing.less
+++ b/components/style/color/bezierEasing.less
@@ -1,108 +1,111 @@
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */
.bezierEasingMixin() {
-@functions: ~`(function() {
- var NEWTON_ITERATIONS = 4;
- var NEWTON_MIN_SLOPE = 0.001;
- var SUBDIVISION_PRECISION = 0.0000001;
- var SUBDIVISION_MAX_ITERATIONS = 10;
-
- var kSplineTableSize = 11;
- var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
-
- var float32ArraySupported = typeof Float32Array === 'function';
-
- function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
- function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
- function C (aA1) { return 3.0 * aA1; }
-
- // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
- function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }
-
- // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
- function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }
-
- function binarySubdivide (aX, aA, aB, mX1, mX2) {
- var currentX, currentT, i = 0;
- do {
- currentT = aA + (aB - aA) / 2.0;
- currentX = calcBezier(currentT, mX1, mX2) - aX;
- if (currentX > 0.0) {
- aB = currentT;
- } else {
- aA = currentT;
- }
- } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
- return currentT;
- }
-
- function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
- for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
- var currentSlope = getSlope(aGuessT, mX1, mX2);
- if (currentSlope === 0.0) {
- return aGuessT;
+ @functions: ~`(function() {
+ var NEWTON_ITERATIONS = 4;
+ var NEWTON_MIN_SLOPE = 0.001;
+ var SUBDIVISION_PRECISION = 0.0000001;
+ var SUBDIVISION_MAX_ITERATIONS = 10;
+
+ var kSplineTableSize = 11;
+ var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
+
+ var float32ArraySupported = typeof Float32Array === 'function';
+
+ function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
+ function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
+ function C (aA1) { return 3.0 * aA1; }
+
+ // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
+ function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }
+
+ // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
+ function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }
+
+ function binarySubdivide (aX, aA, aB, mX1, mX2) {
+ var currentX, currentT, i = 0;
+ do {
+ currentT = aA + (aB - aA) / 2.0;
+ currentX = calcBezier(currentT, mX1, mX2) - aX;
+ if (currentX > 0.0) {
+ aB = currentT;
+ } else {
+ aA = currentT;
+ }
+ } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
+ return currentT;
+ }
+
+ function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
+ for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
+ var currentSlope = getSlope(aGuessT, mX1, mX2);
+ if (currentSlope === 0.0) {
+ return aGuessT;
+ }
+ var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
+ aGuessT -= currentX / currentSlope;
}
- var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
- aGuessT -= currentX / currentSlope;
- }
- return aGuessT;
- }
-
- var BezierEasing = function (mX1, mY1, mX2, mY2) {
- if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {
- throw new Error('bezier x values must be in [0, 1] range');
+ return aGuessT;
}
-
- // Precompute samples table
- var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
- if (mX1 !== mY1 || mX2 !== mY2) {
- for (var i = 0; i < kSplineTableSize; ++i) {
- sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
+
+ var BezierEasing = function (mX1, mY1, mX2, mY2) {
+ if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {
+ throw new Error('bezier x values must be in [0, 1] range');
}
- }
-
- function getTForX (aX) {
- var intervalStart = 0.0;
- var currentSample = 1;
- var lastSample = kSplineTableSize - 1;
-
- for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
- intervalStart += kSampleStepSize;
+
+ // Precompute samples table
+ var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
+ if (mX1 !== mY1 || mX2 !== mY2) {
+ for (var i = 0; i < kSplineTableSize; ++i) {
+ sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
+ }
}
- --currentSample;
-
- // Interpolate to provide an initial guess for t
- var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
- var guessForT = intervalStart + dist * kSampleStepSize;
-
- var initialSlope = getSlope(guessForT, mX1, mX2);
- if (initialSlope >= NEWTON_MIN_SLOPE) {
- return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
- } else if (initialSlope === 0.0) {
- return guessForT;
- } else {
- return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
+
+ function getTForX (aX) {
+ var intervalStart = 0.0;
+ var currentSample = 1;
+ var lastSample = kSplineTableSize - 1;
+
+ for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
+ intervalStart += kSampleStepSize;
+ }
+ --currentSample;
+
+ // Interpolate to provide an initial guess for t
+ var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
+ var guessForT = intervalStart + dist * kSampleStepSize;
+
+ var initialSlope = getSlope(guessForT, mX1, mX2);
+ if (initialSlope >= NEWTON_MIN_SLOPE) {
+ return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
+ } else if (initialSlope === 0.0) {
+ return guessForT;
+ } else {
+ return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
+ }
}
- }
-
- return function BezierEasing (x) {
- if (mX1 === mY1 && mX2 === mY2) {
- return x; // linear
- }
- // Because JavaScript number are imprecise, we should guarantee the extremes are right.
- if (x === 0) {
- return 0;
- }
- if (x === 1) {
- return 1;
- }
- return calcBezier(getTForX(x), mY1, mY2);
+
+ return function BezierEasing (x) {
+ if (mX1 === mY1 && mX2 === mY2) {
+ return x; // linear
+ }
+ // Because JavaScript number are imprecise, we should guarantee the extremes are right.
+ if (x === 0) {
+ return 0;
+ }
+ if (x === 1) {
+ return 1;
+ }
+ return calcBezier(getTForX(x), mY1, mY2);
+ };
};
- };
-
- this.colorEasing = BezierEasing(0.26, 0.09, 0.37, 0.18);
-})()`;
-}
-// It is hacky way to make this function will be compiled preferentially by less
-// resolve error: `ReferenceError: colorPalette is not defined`
-// https://github.com/ant-design/ant-motion/issues/44
-.bezierEasingMixin();
+
+ this.colorEasing = BezierEasing(0.26, 0.09, 0.37, 0.18);
+ // less 3 requires a return
+ return '';
+ })()`;
+ }
+ // It is hacky way to make this function will be compiled preferentially by less
+ // resolve error: `ReferenceError: colorPalette is not defined`
+ // https://github.com/ant-design/ant-motion/issues/44
+ .bezierEasingMixin();
+
\ No newline at end of file
diff --git a/components/style/core/base.less b/components/style/core/base.less
index c743c7cd0..25f56abee 100644
--- a/components/style/core/base.less
+++ b/components/style/core/base.less
@@ -56,9 +56,7 @@ html {
}
// IE10+ doesn't honor `
` in some cases.
-@at-root {
- @-ms-viewport { width: device-width; }
-}
+@-ms-viewport { width: device-width; }
// Shim for "new" HTML5 structural elements to display correctly (IE10, older browsers)
article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {
diff --git a/components/style/themes/default.less b/components/style/themes/default.less
index 343e374e3..e01b12a7c 100644
--- a/components/style/themes/default.less
+++ b/components/style/themes/default.less
@@ -71,8 +71,8 @@
// LINK
@link-color : @primary-color;
-@link-hover-color : @primary-5;
-@link-active-color : @primary-7;
+@link-hover-color : color(~`colorPalette("@{link-color}", 5)`);
+@link-active-color : color(~`colorPalette("@{link-color}", 7)`);
@link-decoration : none;
@link-hover-decoration : none;
@@ -336,6 +336,7 @@
@table-header-sort-bg: @background-color-base;
@table-row-hover-bg: @primary-1;
@table-selected-row-bg: #fafafa;
+@table-expanded-row-bg: #fbfbfb;
@table-padding-vertical: 16px;
@table-padding-horizontal: 16px;
@@ -387,6 +388,8 @@
@tabs-card-height: 40px;
@tabs-card-active-color: @primary-color;
@tabs-title-font-size: @font-size-base;
+@tabs-title-font-size-lg: @font-size-lg;
+@tabs-title-font-size-sm: @font-size-base;
@tabs-ink-bar-bg-color: @primary-color;
@tab-bar-margin: 0 0 16px 0;
@tab-horizontal-margin: 0 32px 0 0;
@@ -420,6 +423,7 @@
// ---
@switch-height: 22px;
@switch-sm-height: 16px;
+@switch-sm-checked-margin-left: -(@switch-sm-height - 3px);
@switch-disabled-opacity: 0.4;
@switch-color: @primary-color;
@@ -428,6 +432,7 @@
@pagination-item-size: 32px;
@pagination-item-size-sm: 24px;
@pagination-font-family: Arial;
+@pagination-font-weight-active: 500;
// Breadcrumb
// ---
diff --git a/components/tabs/style/index.less b/components/tabs/style/index.less
index 93f23936e..b2f71b26c 100644
--- a/components/tabs/style/index.less
+++ b/components/tabs/style/index.less
@@ -207,7 +207,7 @@
}
&-large &-nav-container {
- font-size: @font-size-lg;
+ font-size: @tabs-title-font-size-lg;
}
&-large &-tab {
@@ -215,7 +215,7 @@
}
&-small &-nav-container {
- font-size: @font-size-base;
+ font-size: @tabs-title-font-size-sm;
}
&-small &-tab {
diff --git a/site/components/demoBox.vue b/site/components/demoBox.vue
index c9f69c039..523adb51c 100644
--- a/site/components/demoBox.vue
+++ b/site/components/demoBox.vue
@@ -48,6 +48,11 @@ export default {
sourceCode = style ? sourceCode + '\