Skip to content

Commit f5a340c

Browse files
committed
cr tabs & tag & time-picker & slider
1 parent c015c8d commit f5a340c

File tree

10 files changed

+36
-24
lines changed

10 files changed

+36
-24
lines changed

components/slider/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ const Slider = {
115115
...restProps
116116
} = getOptionProps(this);
117117
const getPrefixCls = this.configProvider.getPrefixCls;
118-
const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
119-
const tooltipPrefixCls = getPrefixCls('skeleton', customizeTooltipPrefixCls);
118+
const prefixCls = getPrefixCls('slider', customizePrefixCls);
119+
const tooltipPrefixCls = getPrefixCls('tooltip', customizeTooltipPrefixCls);
120120
if (range) {
121121
const vcRangeProps = {
122122
props: {

components/tabs/__tests__/__snapshots__/demo.test.js.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,9 @@ exports[`renders ./components/tabs/demo/icon.md correctly 1`] = `
300300
<div class="ant-tabs-content ant-tabs-content-animated ant-tabs-top-content" style="margin-left: -100%;">
301301
<div role="tabpanel" aria-hidden="true" class="ant-tabs-tabpane ant-tabs-tabpane-inactive"></div>
302302
<div role="tabpanel" aria-hidden="false" class="ant-tabs-tabpane ant-tabs-tabpane-active">
303-
<div tabindex="0" role="presentation" style="width: 0px; height: 0px; overflow: hidden; position: absolute;"></div>
303+
<div tabindex="0" role="presentation" style="width: 0px; height: 0px; overflow: hidden; position: absolute;"></div><span><i aria-label="icon: android" class="anticon anticon-android"><svg viewBox="64 64 896 896" data-icon="android" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M448.3 225.2c-18.6 0-32 13.4-32 31.9s13.5 31.9 32 31.9c18.6 0 32-13.4 32-31.9.1-18.4-13.4-31.9-32-31.9zm393.9 96.4c-13.8-13.8-32.7-21.5-53.2-21.5-3.9 0-7.4.4-10.7 1v-1h-3.6c-5.5-30.6-18.6-60.5-38.1-87.4-18.7-25.7-43-47.9-70.8-64.9l25.1-35.8v-3.3c0-.8.4-2.3.7-3.8.6-2.4 1.4-5.5 1.4-8.9 0-18.5-13.5-31.9-32-31.9-9.8 0-19.5 5.7-25.9 15.4l-29.3 42.1c-30-9.8-62.4-15-93.8-15-31.3 0-63.7 5.2-93.8 15L389 79.4c-6.6-9.6-16.1-15.4-26-15.4-18.6 0-32 13.4-32 31.9 0 6.2 2.5 12.8 6.7 17.4l22.6 32.3c-28.7 17-53.5 39.4-72.2 65.1-19.4 26.9-32 56.8-36.7 87.4h-5.5v1c-3.2-.6-6.7-1-10.7-1-20.3 0-39.2 7.5-53.1 21.3-13.8 13.8-21.5 32.6-21.5 53v235c0 20.3 7.5 39.1 21.4 52.9 13.8 13.8 32.8 21.5 53.2 21.5 3.9 0 7.4-.4 10.7-1v93.5c0 29.2 23.9 53.1 53.2 53.1H331v58.3c0 20.3 7.5 39.1 21.4 52.9 13.8 13.8 32.8 21.5 53.2 21.5 20.3 0 39.2-7.5 53.1-21.3 13.8-13.8 21.5-32.6 21.5-53v-58.2H544v58.1c0 20.3 7.5 39.1 21.4 52.9 13.8 13.8 32.8 21.5 53.2 21.5 20.4 0 39.2-7.5 53.1-21.6 13.8-13.8 21.5-32.6 21.5-53v-58.2h31.9c29.3 0 53.2-23.8 53.2-53.1v-91.4c3.2.6 6.7 1 10.7 1 20.3 0 39.2-7.5 53.1-21.3 13.8-13.8 21.5-32.6 21.5-53v-235c-.1-20.3-7.6-39-21.4-52.9zM246 609.6c0 6.8-3.9 10.6-10.7 10.6-6.8 0-10.7-3.8-10.7-10.6V374.5c0-6.8 3.9-10.6 10.7-10.6 6.8 0 10.7 3.8 10.7 10.6v235.1zm131.1-396.8c37.5-27.3 85.3-42.3 135-42.3s97.5 15.1 135 42.5c32.4 23.7 54.2 54.2 62.7 87.5H314.4c8.5-33.4 30.5-64 62.7-87.7zm39.3 674.7c-.6 5.6-4.4 8.7-10.5 8.7-6.8 0-10.7-3.8-10.7-10.6v-58.2h21.2v60.1zm202.3 8.7c-6.8 0-10.7-3.8-10.7-10.6v-58.2h21.2v60.1c-.6 5.6-4.3 8.7-10.5 8.7zm95.8-132.6H309.9V364h404.6v399.6zm85.2-154c0 6.8-3.9 10.6-10.7 10.6-6.8 0-10.7-3.8-10.7-10.6V374.5c0-6.8 3.9-10.6 10.7-10.6 6.8 0 10.7 3.8 10.7 10.6v235.1zM576.1 225.2c-18.6 0-32 13.4-32 31.9s13.5 31.9 32 31.9c18.6 0 32.1-13.4 32.1-32-.1-18.6-13.4-31.8-32.1-31.8z"></path></svg></i>
304+
Tab 2
305+
</span>
304306
Tab 2
305307
<div tabindex="0" role="presentation" style="width: 0px; height: 0px; overflow: hidden; position: absolute;"></div>
306308
</div>

components/tabs/demo/custom-tab-bar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Customized bar of tab.
1717
<a-tab-pane tab="Tab 2" key="2" forceRender>Content of Tab Pane 2</a-tab-pane>
1818
<a-tab-pane tab="Tab 3" key="3">Content of Tab Pane 3</a-tab-pane>
1919
<template slot="renderTabBar" slot-scope="props, DefaultTabBar">
20-
<component :is="DefaultTabBar" {...props} />
20+
<component :is="DefaultTabBar" v-bind="props" :style="{ zIndex: 1, background: '#fff' }" />
2121
</template>
2222
</a-tabs>
2323
</div>

components/tabs/tabs.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Icon from '../icon';
22
import VcTabs, { TabPane } from '../vc-tabs/src';
33
import TabContent from '../vc-tabs/src/TabContent';
4-
import isFlexSupported from '../_util/isFlexSupported';
4+
import { isFlexSupported } from '../_util/styleChecker';
55
import PropTypes from '../_util/vue-types';
66
import { getComponentFromProp, getOptionProps, filterEmpty } from '../_util/props-util';
77
import { cloneElement } from '../_util/vnode';
@@ -36,7 +36,7 @@ export default {
3636
mounted() {
3737
const NO_FLEX = ' no-flex';
3838
const tabNode = this.$el;
39-
if (tabNode && !isFlexSupported() && tabNode.className.indexOf(NO_FLEX) === -1) {
39+
if (tabNode && !isFlexSupported && tabNode.className.indexOf(NO_FLEX) === -1) {
4040
tabNode.className += NO_FLEX;
4141
}
4242
},

components/tag/CheckableTag.jsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1+
import PropTypes from '../_util/vue-types';
2+
import { ConfigConsumerProps } from '../config-provider';
3+
14
export default {
25
name: 'ACheckableTag',
36
model: {
47
prop: 'checked',
58
},
69
props: {
7-
prefixCls: {
8-
default: 'ant-tag',
9-
type: String,
10-
},
10+
prefixCls: PropTypes.string,
1111
checked: Boolean,
1212
},
13+
inject: {
14+
configProvider: { default: () => ConfigConsumerProps },
15+
},
1316
computed: {
1417
classes() {
15-
const { prefixCls, checked } = this;
18+
const { checked, prefixCls: customizePrefixCls } = this;
19+
const getPrefixCls = this.configProvider.getPrefixCls;
20+
const prefixCls = getPrefixCls('tag', customizePrefixCls);
1621
return {
1722
[`${prefixCls}`]: true,
1823
[`${prefixCls}-checkable`]: true,

components/tag/Tag.jsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import omit from 'omit.js';
55
import Wave from '../_util/wave';
66
import { hasProp } from '../_util/props-util';
77
import BaseMixin from '../_util/BaseMixin';
8+
import { ConfigConsumerProps } from '../config-provider';
89

910
export default {
1011
name: 'ATag',
@@ -14,12 +15,15 @@ export default {
1415
event: 'close.visible',
1516
},
1617
props: {
17-
prefixCls: PropTypes.string.def('ant-tag'),
18+
prefixCls: PropTypes.string,
1819
color: PropTypes.string,
1920
closable: PropTypes.bool.def(false),
2021
visible: PropTypes.bool,
2122
afterClose: PropTypes.func,
2223
},
24+
inject: {
25+
configProvider: { default: () => ConfigConsumerProps },
26+
},
2327
data() {
2428
let _visible = true;
2529
if (hasProp(this, 'visible')) {
@@ -75,8 +79,8 @@ export default {
7579
};
7680
},
7781

78-
getTagClassName() {
79-
const { prefixCls, color } = this.$props;
82+
getTagClassName(prefixCls) {
83+
const { color } = this.$props;
8084
const isPresetColor = this.isPresetColor(color);
8185
return {
8286
[prefixCls]: true,
@@ -92,13 +96,15 @@ export default {
9296
},
9397

9498
render() {
95-
const { prefixCls } = this.$props;
99+
const { prefixCls: customizePrefixCls } = this.$props;
100+
const getPrefixCls = this.configProvider.getPrefixCls;
101+
const prefixCls = getPrefixCls('tag', customizePrefixCls);
96102
const { _visible: visible } = this.$data;
97103
const tag = (
98104
<div
99105
v-show={visible}
100106
{...{ on: omit(this.$listeners, ['close']) }}
101-
class={this.getTagClassName()}
107+
class={this.getTagClassName(prefixCls)}
102108
style={this.getTagStyle()}
103109
>
104110
{this.$slots.default}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`TimePicker not render clean icon when allowClear is false 1`] = `
4-
<span class="ant-time-picker"><input type="text" placeholder="Select time" id="" class="ant-time-picker-input"><span class="ant-time-picker-icon"><i aria-label="icon: clock-circle" class="ant-time-picker-clock-icon anticon anticon-clock-circle"><svg viewBox="64 64 896 896" data-icon="clock-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"></path></svg></i></span><i aria-label="icon: close-circle" class="ant-time-picker-clear anticon anticon-close-circle"><svg viewBox="64 64 896 896" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
5-
<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"></path>
6-
</svg></i></span>
7-
`;
3+
exports[`TimePicker not render clean icon when allowClear is false 1`] = `<span class="ant-time-picker"><input type="text" placeholder="Select time" id="" class="ant-time-picker-input"><span class="ant-time-picker-icon"><i aria-label="icon: clock-circle" class="ant-time-picker-clock-icon anticon anticon-clock-circle"><svg viewBox="64 64 896 896" data-icon="clock-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"></path></svg></i></span></span>`;
84
95
exports[`TimePicker renders addon correctly 1`] = `<div class="ant-time-picker-panel-addon"><button type="button">Ok</button></div>`;

components/time-picker/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const TimePicker = {
154154

155155
getAllowClear() {
156156
const { allowClear, allowEmpty } = this.$props;
157-
if ('allowClear' in this.$props) {
157+
if (hasProp(this, 'allowClear')) {
158158
return allowClear;
159159
}
160160
return allowEmpty;
@@ -207,6 +207,7 @@ const TimePicker = {
207207
props: {
208208
...generateShowHourMinuteSecond(format),
209209
...props,
210+
allowEmpty: this.getAllowClear(),
210211
prefixCls,
211212
getPopupContainer: getPopupContainer || getContextPopupContainer,
212213
format,

components/tree/demo/customized-icon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You can customize icons for different nodes.
1616
defaultExpandAll
1717
:defaultSelectedKeys="['0-0-0']"
1818
>
19-
<a-icon type="down" slot="switcherIcon" class="test" />
19+
<a-icon type="down" slot="switcherIcon" />
2020
<a-icon slot="smile" type="smile-o" />
2121
<a-icon slot="meh" type="smile-o" />
2222
<template slot="custom" slot-scope="{selected}">

types/time-picker.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export declare class TimePicker extends AntdComponent {
1717
* @default true
1818
* @type boolean
1919
*/
20-
allowEmpty: boolean;
20+
allowClear: boolean;
2121

2222
/**
2323
* get focus when component mounted
@@ -132,6 +132,8 @@ export declare class TimePicker extends AntdComponent {
132132
*/
133133
popupClassName: string;
134134

135+
popupStyle: object;
136+
135137
/**
136138
* interval between seconds in picker
137139
* @default 1

0 commit comments

Comments
 (0)