Skip to content

Commit 116cc6a

Browse files
committed
update to 3.4.0
1 parent 89bd5af commit 116cc6a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+471
-105
lines changed

components/cascader/demo/search.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Search and select options directly.
1313
1414
```html
1515
<template>
16-
<a-cascader :options="options" :showSearch="true" @change="onChange" placeholder="Please select" />
16+
<a-cascader :options="options" :showSearch="{filter}" @change="onChange" placeholder="Please select" />
1717
</template>
1818
<script>
1919
export default {
@@ -51,7 +51,10 @@ export default {
5151
methods: {
5252
onChange(value, selectedOptions) {
5353
console.log(value, selectedOptions);
54-
}
54+
},
55+
filter(inputValue, path) {
56+
return (path.some(option => (option.label).toLowerCase().indexOf(inputValue.toLowerCase()) > -1));
57+
},
5558
}
5659
}
5760
</script>

components/date-picker/RangePicker.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import RangeCalendar from '../vc-calendar/src/RangeCalendar'
44
import VcDatePicker from '../vc-calendar/src/Picker'
55
import classNames from 'classnames'
66
import Icon from '../icon'
7-
import callMoment from '../_util/callMoment'
7+
import interopDefault from '../_util/interopDefault'
88
import { RangePickerProps } from './interface'
99
import { hasProp, getOptionProps, initDefaultProps, mergeProps } from '../_util/props-util'
1010
import BaseMixin from '../_util/BaseMixin'
@@ -67,8 +67,8 @@ export default {
6767
data () {
6868
const value = this.value || this.defaultValue || []
6969
if (
70-
value[0] && !moment.isMoment(value[0]) ||
71-
value[1] && !moment.isMoment(value[1])
70+
value[0] && !interopDefault(moment).isMoment(value[0]) ||
71+
value[1] && !interopDefault(moment).isMoment(value[1])
7272
) {
7373
throw new Error(
7474
'The value/defaultValue of RangePicker must be a moment object array after `[email protected]`, ' +
@@ -78,7 +78,7 @@ export default {
7878
const pickerValue = !value || isEmptyArray(value) ? this.defaultPickerValue : value
7979
return {
8080
sValue: value,
81-
sShowDate: pickerValueAdapter(pickerValue || callMoment(moment)),
81+
sShowDate: pickerValueAdapter(pickerValue || interopDefault(moment)()),
8282
sOpen: this.open,
8383
sHoverValue: [],
8484
}

components/date-picker/WeekPicker.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import VcDatePicker from '../vc-calendar/src/Picker'
55
import Icon from '../icon'
66
import { hasProp, getOptionProps, initDefaultProps } from '../_util/props-util'
77
import BaseMixin from '../_util/BaseMixin'
8-
import { WeexPickerProps } from './interface'
8+
import { WeekPickerProps } from './interface'
9+
import interopDefault from '../_util/interopDefault'
910

1011
function formatValue (value, format) {
1112
return (value && value.format(format)) || ''
@@ -19,15 +20,15 @@ export default {
1920
// };
2021

2122
// private input: any;
22-
props: initDefaultProps(WeexPickerProps(), {
23-
format: 'YYYY-wo',
23+
props: initDefaultProps(WeekPickerProps(), {
24+
format: 'gggg-wo',
2425
allowClear: true,
2526
}),
2627
name: 'WeekPicker',
2728
mixins: [BaseMixin],
2829
data () {
2930
const value = this.value || this.defaultValue
30-
if (value && !moment.isMoment(value)) {
31+
if (value && !interopDefault(moment).isMoment(value)) {
3132
throw new Error(
3233
'The value/defaultValue of DatePicker or MonthPicker must be ' +
3334
'a moment object',

components/date-picker/createPicker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import MonthCalendar from '../vc-calendar/src/MonthCalendar'
44
import VcDatePicker from '../vc-calendar/src/Picker'
55
import classNames from 'classnames'
66
import Icon from '../icon'
7-
import callMoment from '../_util/callMoment'
7+
import interopDefault from '../_util/interopDefault'
88
import BaseMixin from '../_util/BaseMixin'
99
import { hasProp, getOptionProps, initDefaultProps, mergeProps } from '../_util/props-util'
1010

@@ -30,7 +30,7 @@ export default function createPicker (TheCalendar, props) {
3030
mixins: [BaseMixin],
3131
data () {
3232
const value = this.value || this.defaultValue
33-
if (value && !moment.isMoment(value)) {
33+
if (value && !interopDefault(moment).isMoment(value)) {
3434
throw new Error(
3535
'The value/defaultValue of DatePicker or MonthPicker must be ' +
3636
'a moment object',
@@ -127,7 +127,7 @@ export default function createPicker (TheCalendar, props) {
127127
disabledTime,
128128
locale: locale.lang,
129129
timePicker: props.timePicker,
130-
defaultValue: props.defaultPickerValue || callMoment(moment),
130+
defaultValue: props.defaultPickerValue || interopDefault(moment)(),
131131
dateInputPlaceholder: placeholder,
132132
prefixCls,
133133
dateRender,

components/date-picker/index.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
3636
| open | open state of picker | boolean | - |
3737
| placeholder | placeholder of date input | string\|RangePicker\[] | - |
3838
| popupStyle | to customize the style of the popup calendar | object | {} |
39+
| dropdownClassName | to customize the className of the popup calendar | string | - |
3940
| size | determine the size of the input box, the height of `large` and `small`, are 40px and 24px respectively, while default size is 32px | string | - |
4041

4142
### Common Events

components/date-picker/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import createPicker from './createPicker'
44
import wrapPicker from './wrapPicker'
55
import RangePicker from './RangePicker'
66
import WeekPicker from './WeekPicker'
7-
import { DatePickerProps, MonthPickerProps, WeexPickerProps, RangePickerProps } from './interface'
7+
import { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps } from './interface'
88

99
const DatePicker = wrapPicker(createPicker(VcCalendar, DatePickerProps()), DatePickerProps())
1010

@@ -13,7 +13,7 @@ const MonthPicker = wrapPicker(createPicker(MonthCalendar, MonthPickerProps()),
1313
Object.assign(DatePicker, {
1414
RangePicker: wrapPicker(RangePicker, RangePickerProps()),
1515
MonthPicker,
16-
WeekPicker: wrapPicker(WeekPicker, WeexPickerProps(), 'YYYY-wo'),
16+
WeekPicker: wrapPicker(WeekPicker, WeekPickerProps(), 'gggg-wo'),
1717
})
1818

1919
export default DatePicker

components/date-picker/index.zh-CN.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
| locale | 国际化配置 | object | [默认配置](https://github.com/vueComponent/ant-design/blob/master/components/date-picker/locale/example.json) |
3636
| open | 控制弹层是否展开 | boolean | - |
3737
| placeholder | 输入框提示文字 | string\|RangePicker\[] | - |
38-
| popupStyle | 格外的弹出日历样式 | object | {} |
38+
| popupStyle | 额外的弹出日历样式 | object | {} |
39+
| dropdownClassName | 额外的弹出日历 className | string | - |
3940
| size | 输入框大小,`large` 高度为 40px,`small` 为 24px,默认是 32px | string ||
4041

4142
### 共有的事件

components/date-picker/interface.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const PickerProps = () => ({
1717
disabled: PropTypes.bool,
1818
allowClear: PropTypes.bool,
1919
popupStyle: PropTypes.object,
20+
dropdownClassName: PropTypes.string,
2021
locale: PropTypes.any,
2122
localeCode: PropTypes.string,
2223
size: PropTypes.oneOf(['large', 'small', 'default']),
@@ -81,7 +82,7 @@ export const RangePickerProps = () => ({
8182
// onPanelChange?: (value?: RangePickerValue, mode?: string | string[]) => void;
8283
})
8384

84-
export const WeexPickerProps = () => ({
85+
export const WeekPickerProps = () => ({
8586
...PickerProps(), ...SinglePickerProps(),
8687
placeholder: PropTypes.string,
8788
})
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import TimePickerLocale from '../../time-picker/locale/sl_SI'
2+
3+
// Merge into a locale object
4+
const locale = {
5+
lang: {
6+
placeholder: 'Izberite datum',
7+
rangePlaceholder: ['Začetni datum', 'Končni datum'],
8+
today: 'Danes',
9+
now: 'Trenutno',
10+
backToToday: 'Nazaj na trenutni datum',
11+
ok: 'Ok',
12+
clear: 'Počisti',
13+
month: 'Mesec',
14+
year: 'Leto',
15+
timeSelect: 'Izberi čas',
16+
dateSelect: 'Izberi datum',
17+
monthSelect: 'Izberite mesec',
18+
yearSelect: 'Izberite leto',
19+
decadeSelect: 'Izberite desetletje',
20+
yearFormat: 'YYYY',
21+
dateFormat: 'D.M.YYYY',
22+
dayFormat: 'D',
23+
dateTimeFormat: 'D.M.YYYY HH:mm:ss',
24+
monthFormat: 'MMMM',
25+
monthBeforeYear: true,
26+
previousMonth: 'Prejšnji mesec (PageUp)',
27+
nextMonth: 'Naslednji mesec (PageDown)',
28+
previousYear: 'Lansko leto (Control + left)',
29+
nextYear: 'Naslednje leto (Control + right)',
30+
previousDecade: 'Prejšnje desetletje',
31+
nextDecade: 'Naslednje desetletje',
32+
previousCentury: 'Zadnje stoletje',
33+
nextCentury: 'Naslednje stoletje',
34+
},
35+
timePickerLocale: {
36+
...TimePickerLocale,
37+
},
38+
}
39+
40+
// All settings at:
41+
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
42+
43+
export default locale

components/divider/demo/index.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script>
22
import Horizontal from './horizontal'
33
import Vertical from './vertical'
4+
import Orientation from './orientation'
45
import CN from '../index.zh-CN.md'
56
import US from '../index.en-US.md'
67
const md = {
@@ -30,6 +31,7 @@ export default {
3031
<md cn={md.cn} us={md.us}/>
3132
<Vertical />
3233
<Horizontal />
34+
<Orientation />
3335
<api>
3436
<CN slot='cn' />
3537
<US/>

0 commit comments

Comments
 (0)