Skip to content

Commit d4c388f

Browse files
committed
feat: update vc-tabs to 9.5.7
1 parent c8ae767 commit d4c388f

19 files changed

+450
-293
lines changed

components/_util/antDirective.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { antInput } from './antInputDirective'
2-
import { antRef } from './antRefDirective'
32
import { antDecorator } from './FormDecoratorDirective'
43

54
export default {
65
install: (Vue, options) => {
76
antInput(Vue)
8-
antRef(Vue)
97
antDecorator(Vue)
108
},
119
}

components/_util/antRefDirective.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

components/tabs/TabBar.jsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Icon from '../icon'
22
import ScrollableInkTabBar from '../vc-tabs/src/ScrollableInkTabBar'
33
import { cloneElement } from '../_util/vnode'
4-
54
const TabBar = {
65
functional: true,
76
render (h, context) {
@@ -12,6 +11,8 @@ const TabBar = {
1211
tabBarExtraContent,
1312
tabPosition,
1413
prefixCls,
14+
type = 'line',
15+
size,
1516
} = context.props
1617
const inkBarAnimated = typeof animated === 'object' ? animated.inkBar : animated
1718

@@ -29,6 +30,13 @@ const TabBar = {
2930
</span>
3031
)
3132

33+
// Additional className for style usage
34+
const cls = {
35+
[`${prefixCls}-${tabPosition}-bar`]: true,
36+
[`${prefixCls}-${size}-bar`]: !!size,
37+
[`${prefixCls}-card-bar`]: type && type.indexOf('card') >= 0,
38+
}
39+
3240
const renderProps = {
3341
props: {
3442
...context.props,
@@ -39,6 +47,7 @@ const TabBar = {
3947
},
4048
style: tabBarStyle,
4149
on: context.listeners,
50+
class: cls,
4251
}
4352

4453
let RenderTabBar

components/tabs/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import ref from 'vue-ref'
2+
import Vue from 'vue'
13
import Tabs from './tabs'
24
import TabPane from '../vc-tabs/src/TabPane'
35
import TabContent from '../vc-tabs/src/TabContent'
46
Tabs.TabPane = { ...TabPane, name: 'ATabPane', __ANT_TAB_PANE: true }
57
Tabs.TabContent = { ...TabContent, name: 'ATabContent' }
8+
Vue.use(ref, { name: 'ant-ref' })
69

710
/* istanbul ignore next */
811
Tabs.install = function (Vue) {

components/tabs/style/card-style.less

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
@import "../../style/themes/default";
2-
@import "../../style/mixins/index";
1+
@import '../../style/themes/default';
2+
@import '../../style/mixins/index';
33

4-
@tab-prefix-cls: ~"@{ant-prefix}-tabs";
4+
@tab-prefix-cls: ~'@{ant-prefix}-tabs';
55

66
// card style
77
.@{tab-prefix-cls} {
8-
&&-card > &-bar &-nav-container {
8+
&&-card &-card-bar &-nav-container {
99
height: @tabs-card-height;
1010
}
11-
&&-card > &-bar &-ink-bar {
11+
&&-card &-card-bar &-ink-bar {
1212
visibility: hidden;
1313
}
14-
&&-card > &-bar &-tab {
14+
&&-card &-card-bar &-tab {
1515
margin: 0;
1616
border: @border-width-base @border-style-base @border-color-split;
1717
border-bottom: 0;
@@ -22,21 +22,21 @@
2222
transition: all 0.3s @ease-in-out;
2323
line-height: @tabs-card-height - 2px;
2424
}
25-
&&-card > &-bar &-tab-active {
25+
&&-card &-card-bar &-tab-active {
2626
background: @component-background;
2727
border-color: @border-color-split;
2828
color: @tabs-card-active-color;
2929
padding-bottom: 1px;
3030
}
31-
&&-card > &-bar &-tab-inactive {
31+
&&-card &-card-bar &-tab-inactive {
3232
padding: 0;
3333
}
34-
&&-card > &-bar &-nav-wrap {
34+
&&-card &-card-bar &-nav-wrap {
3535
margin-bottom: 0;
3636
}
37-
&&-card > &-bar &-tab &-close-x {
37+
&&-card &-card-bar &-tab &-close-x {
3838
color: @text-color-secondary;
39-
transition: all .3s;
39+
transition: all 0.3s;
4040
font-size: @font-size-sm;
4141
margin-left: 3px;
4242
margin-right: -5px;
@@ -50,15 +50,15 @@
5050
}
5151
}
5252

53-
&&-card &-content > &-tabpane,
54-
&&-editable-card &-content > &-tabpane {
53+
&&-card &-card-content > &-tabpane,
54+
&&-editable-card &-card-content > &-tabpane {
5555
transition: none !important;
5656
&-inactive {
5757
overflow: hidden;
5858
}
5959
}
6060

61-
&&-card > &-bar &-tab:hover .@{iconfont-css-prefix}-close {
61+
&&-card &-card-bar &-tab:hover .@{iconfont-css-prefix}-close {
6262
opacity: 1;
6363
}
6464

@@ -76,7 +76,7 @@
7676
border: @border-width-base @border-style-base @border-color-split;
7777
font-size: 12px;
7878
color: @text-color;
79-
transition: all .3s;
79+
transition: all 0.3s;
8080
&:hover {
8181
color: @tabs-card-active-color;
8282
border-color: @tabs-card-active-color;
@@ -93,7 +93,8 @@
9393
}
9494

9595
// https://github.com/ant-design/ant-design/issues/4669
96-
&-vertical&-card > .@{tab-prefix-cls}-bar {
96+
&-vertical&-card &-card-bar&-left-bar,
97+
&-vertical&-card &-card-bar&-right-bar {
9798
.@{tab-prefix-cls}-nav-container {
9899
height: auto;
99100
}
@@ -112,7 +113,7 @@
112113
}
113114
}
114115

115-
&-vertical&-card&-left > .@{tab-prefix-cls}-bar {
116+
&-vertical&-card&-left &-card-bar&-left-bar {
116117
.@{tab-prefix-cls}-nav-wrap {
117118
margin-right: 0;
118119
}
@@ -127,7 +128,7 @@
127128
}
128129
}
129130

130-
&-vertical&-card&-right > .@{tab-prefix-cls}-bar {
131+
&-vertical&-card&-right &-card-bar&-right-bar {
131132
.@{tab-prefix-cls}-nav-wrap {
132133
margin-left: 0;
133134
}
@@ -143,15 +144,15 @@
143144
}
144145

145146
// https://github.com/ant-design/ant-design/issues/9104
146-
&&-card&-bottom > &-bar &-tab {
147+
& &-card-bar&-bottom-bar &-tab {
147148
border-bottom: @border-width-base @border-style-base @border-color-split;
148149
border-top: 0;
149150
border-radius: 0 0 @border-radius-base @border-radius-base;
150151
}
151152

152-
&&-card&-bottom > &-bar &-tab-active {
153+
& &-card-bar&-bottom-bar &-tab-active {
153154
color: @primary-color;
154155
padding-bottom: 0;
155156
padding-top: 1px;
156157
}
157-
}
158+
}

0 commit comments

Comments
 (0)