update to 3.4.0
parent
89bd5afa6e
commit
116cc6a251
|
@ -13,7 +13,7 @@ Search and select options directly.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<template>
|
<template>
|
||||||
<a-cascader :options="options" :showSearch="true" @change="onChange" placeholder="Please select" />
|
<a-cascader :options="options" :showSearch="{filter}" @change="onChange" placeholder="Please select" />
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
@ -51,7 +51,10 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
onChange(value, selectedOptions) {
|
onChange(value, selectedOptions) {
|
||||||
console.log(value, selectedOptions);
|
console.log(value, selectedOptions);
|
||||||
}
|
},
|
||||||
|
filter(inputValue, path) {
|
||||||
|
return (path.some(option => (option.label).toLowerCase().indexOf(inputValue.toLowerCase()) > -1));
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -4,7 +4,7 @@ import RangeCalendar from '../vc-calendar/src/RangeCalendar'
|
||||||
import VcDatePicker from '../vc-calendar/src/Picker'
|
import VcDatePicker from '../vc-calendar/src/Picker'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
import Icon from '../icon'
|
import Icon from '../icon'
|
||||||
import callMoment from '../_util/callMoment'
|
import interopDefault from '../_util/interopDefault'
|
||||||
import { RangePickerProps } from './interface'
|
import { RangePickerProps } from './interface'
|
||||||
import { hasProp, getOptionProps, initDefaultProps, mergeProps } from '../_util/props-util'
|
import { hasProp, getOptionProps, initDefaultProps, mergeProps } from '../_util/props-util'
|
||||||
import BaseMixin from '../_util/BaseMixin'
|
import BaseMixin from '../_util/BaseMixin'
|
||||||
|
@ -67,8 +67,8 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
const value = this.value || this.defaultValue || []
|
const value = this.value || this.defaultValue || []
|
||||||
if (
|
if (
|
||||||
value[0] && !moment.isMoment(value[0]) ||
|
value[0] && !interopDefault(moment).isMoment(value[0]) ||
|
||||||
value[1] && !moment.isMoment(value[1])
|
value[1] && !interopDefault(moment).isMoment(value[1])
|
||||||
) {
|
) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'The value/defaultValue of RangePicker must be a moment object array after `antd@2.0`, ' +
|
'The value/defaultValue of RangePicker must be a moment object array after `antd@2.0`, ' +
|
||||||
|
@ -78,7 +78,7 @@ export default {
|
||||||
const pickerValue = !value || isEmptyArray(value) ? this.defaultPickerValue : value
|
const pickerValue = !value || isEmptyArray(value) ? this.defaultPickerValue : value
|
||||||
return {
|
return {
|
||||||
sValue: value,
|
sValue: value,
|
||||||
sShowDate: pickerValueAdapter(pickerValue || callMoment(moment)),
|
sShowDate: pickerValueAdapter(pickerValue || interopDefault(moment)()),
|
||||||
sOpen: this.open,
|
sOpen: this.open,
|
||||||
sHoverValue: [],
|
sHoverValue: [],
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,8 @@ import VcDatePicker from '../vc-calendar/src/Picker'
|
||||||
import Icon from '../icon'
|
import Icon from '../icon'
|
||||||
import { hasProp, getOptionProps, initDefaultProps } from '../_util/props-util'
|
import { hasProp, getOptionProps, initDefaultProps } from '../_util/props-util'
|
||||||
import BaseMixin from '../_util/BaseMixin'
|
import BaseMixin from '../_util/BaseMixin'
|
||||||
import { WeexPickerProps } from './interface'
|
import { WeekPickerProps } from './interface'
|
||||||
|
import interopDefault from '../_util/interopDefault'
|
||||||
|
|
||||||
function formatValue (value, format) {
|
function formatValue (value, format) {
|
||||||
return (value && value.format(format)) || ''
|
return (value && value.format(format)) || ''
|
||||||
|
@ -19,15 +20,15 @@ export default {
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// private input: any;
|
// private input: any;
|
||||||
props: initDefaultProps(WeexPickerProps(), {
|
props: initDefaultProps(WeekPickerProps(), {
|
||||||
format: 'YYYY-wo',
|
format: 'gggg-wo',
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
}),
|
}),
|
||||||
name: 'WeekPicker',
|
name: 'WeekPicker',
|
||||||
mixins: [BaseMixin],
|
mixins: [BaseMixin],
|
||||||
data () {
|
data () {
|
||||||
const value = this.value || this.defaultValue
|
const value = this.value || this.defaultValue
|
||||||
if (value && !moment.isMoment(value)) {
|
if (value && !interopDefault(moment).isMoment(value)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'The value/defaultValue of DatePicker or MonthPicker must be ' +
|
'The value/defaultValue of DatePicker or MonthPicker must be ' +
|
||||||
'a moment object',
|
'a moment object',
|
||||||
|
|
|
@ -4,7 +4,7 @@ import MonthCalendar from '../vc-calendar/src/MonthCalendar'
|
||||||
import VcDatePicker from '../vc-calendar/src/Picker'
|
import VcDatePicker from '../vc-calendar/src/Picker'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
import Icon from '../icon'
|
import Icon from '../icon'
|
||||||
import callMoment from '../_util/callMoment'
|
import interopDefault from '../_util/interopDefault'
|
||||||
import BaseMixin from '../_util/BaseMixin'
|
import BaseMixin from '../_util/BaseMixin'
|
||||||
import { hasProp, getOptionProps, initDefaultProps, mergeProps } from '../_util/props-util'
|
import { hasProp, getOptionProps, initDefaultProps, mergeProps } from '../_util/props-util'
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ export default function createPicker (TheCalendar, props) {
|
||||||
mixins: [BaseMixin],
|
mixins: [BaseMixin],
|
||||||
data () {
|
data () {
|
||||||
const value = this.value || this.defaultValue
|
const value = this.value || this.defaultValue
|
||||||
if (value && !moment.isMoment(value)) {
|
if (value && !interopDefault(moment).isMoment(value)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'The value/defaultValue of DatePicker or MonthPicker must be ' +
|
'The value/defaultValue of DatePicker or MonthPicker must be ' +
|
||||||
'a moment object',
|
'a moment object',
|
||||||
|
@ -127,7 +127,7 @@ export default function createPicker (TheCalendar, props) {
|
||||||
disabledTime,
|
disabledTime,
|
||||||
locale: locale.lang,
|
locale: locale.lang,
|
||||||
timePicker: props.timePicker,
|
timePicker: props.timePicker,
|
||||||
defaultValue: props.defaultPickerValue || callMoment(moment),
|
defaultValue: props.defaultPickerValue || interopDefault(moment)(),
|
||||||
dateInputPlaceholder: placeholder,
|
dateInputPlaceholder: placeholder,
|
||||||
prefixCls,
|
prefixCls,
|
||||||
dateRender,
|
dateRender,
|
||||||
|
|
|
@ -36,6 +36,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
|
||||||
| open | open state of picker | boolean | - |
|
| open | open state of picker | boolean | - |
|
||||||
| placeholder | placeholder of date input | string\|RangePicker\[] | - |
|
| placeholder | placeholder of date input | string\|RangePicker\[] | - |
|
||||||
| popupStyle | to customize the style of the popup calendar | object | {} |
|
| popupStyle | to customize the style of the popup calendar | object | {} |
|
||||||
|
| dropdownClassName | to customize the className of the popup calendar | string | - |
|
||||||
| 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 | - |
|
| 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 | - |
|
||||||
|
|
||||||
### Common Events
|
### Common Events
|
||||||
|
|
|
@ -4,7 +4,7 @@ import createPicker from './createPicker'
|
||||||
import wrapPicker from './wrapPicker'
|
import wrapPicker from './wrapPicker'
|
||||||
import RangePicker from './RangePicker'
|
import RangePicker from './RangePicker'
|
||||||
import WeekPicker from './WeekPicker'
|
import WeekPicker from './WeekPicker'
|
||||||
import { DatePickerProps, MonthPickerProps, WeexPickerProps, RangePickerProps } from './interface'
|
import { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps } from './interface'
|
||||||
|
|
||||||
const DatePicker = wrapPicker(createPicker(VcCalendar, DatePickerProps()), DatePickerProps())
|
const DatePicker = wrapPicker(createPicker(VcCalendar, DatePickerProps()), DatePickerProps())
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ const MonthPicker = wrapPicker(createPicker(MonthCalendar, MonthPickerProps()),
|
||||||
Object.assign(DatePicker, {
|
Object.assign(DatePicker, {
|
||||||
RangePicker: wrapPicker(RangePicker, RangePickerProps()),
|
RangePicker: wrapPicker(RangePicker, RangePickerProps()),
|
||||||
MonthPicker,
|
MonthPicker,
|
||||||
WeekPicker: wrapPicker(WeekPicker, WeexPickerProps(), 'YYYY-wo'),
|
WeekPicker: wrapPicker(WeekPicker, WeekPickerProps(), 'gggg-wo'),
|
||||||
})
|
})
|
||||||
|
|
||||||
export default DatePicker
|
export default DatePicker
|
||||||
|
|
|
@ -35,7 +35,8 @@
|
||||||
| locale | 国际化配置 | object | [默认配置](https://github.com/vueComponent/ant-design/blob/master/components/date-picker/locale/example.json) |
|
| locale | 国际化配置 | object | [默认配置](https://github.com/vueComponent/ant-design/blob/master/components/date-picker/locale/example.json) |
|
||||||
| open | 控制弹层是否展开 | boolean | - |
|
| open | 控制弹层是否展开 | boolean | - |
|
||||||
| placeholder | 输入框提示文字 | string\|RangePicker\[] | - |
|
| placeholder | 输入框提示文字 | string\|RangePicker\[] | - |
|
||||||
| popupStyle | 格外的弹出日历样式 | object | {} |
|
| popupStyle | 额外的弹出日历样式 | object | {} |
|
||||||
|
| dropdownClassName | 额外的弹出日历 className | string | - |
|
||||||
| size | 输入框大小,`large` 高度为 40px,`small` 为 24px,默认是 32px | string | 无 |
|
| size | 输入框大小,`large` 高度为 40px,`small` 为 24px,默认是 32px | string | 无 |
|
||||||
|
|
||||||
### 共有的事件
|
### 共有的事件
|
||||||
|
|
|
@ -17,6 +17,7 @@ export const PickerProps = () => ({
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
allowClear: PropTypes.bool,
|
allowClear: PropTypes.bool,
|
||||||
popupStyle: PropTypes.object,
|
popupStyle: PropTypes.object,
|
||||||
|
dropdownClassName: PropTypes.string,
|
||||||
locale: PropTypes.any,
|
locale: PropTypes.any,
|
||||||
localeCode: PropTypes.string,
|
localeCode: PropTypes.string,
|
||||||
size: PropTypes.oneOf(['large', 'small', 'default']),
|
size: PropTypes.oneOf(['large', 'small', 'default']),
|
||||||
|
@ -81,7 +82,7 @@ export const RangePickerProps = () => ({
|
||||||
// onPanelChange?: (value?: RangePickerValue, mode?: string | string[]) => void;
|
// onPanelChange?: (value?: RangePickerValue, mode?: string | string[]) => void;
|
||||||
})
|
})
|
||||||
|
|
||||||
export const WeexPickerProps = () => ({
|
export const WeekPickerProps = () => ({
|
||||||
...PickerProps(), ...SinglePickerProps(),
|
...PickerProps(), ...SinglePickerProps(),
|
||||||
placeholder: PropTypes.string,
|
placeholder: PropTypes.string,
|
||||||
})
|
})
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
import TimePickerLocale from '../../time-picker/locale/sl_SI'
|
||||||
|
|
||||||
|
// Merge into a locale object
|
||||||
|
const locale = {
|
||||||
|
lang: {
|
||||||
|
placeholder: 'Izberite datum',
|
||||||
|
rangePlaceholder: ['Začetni datum', 'Končni datum'],
|
||||||
|
today: 'Danes',
|
||||||
|
now: 'Trenutno',
|
||||||
|
backToToday: 'Nazaj na trenutni datum',
|
||||||
|
ok: 'Ok',
|
||||||
|
clear: 'Počisti',
|
||||||
|
month: 'Mesec',
|
||||||
|
year: 'Leto',
|
||||||
|
timeSelect: 'Izberi čas',
|
||||||
|
dateSelect: 'Izberi datum',
|
||||||
|
monthSelect: 'Izberite mesec',
|
||||||
|
yearSelect: 'Izberite leto',
|
||||||
|
decadeSelect: 'Izberite desetletje',
|
||||||
|
yearFormat: 'YYYY',
|
||||||
|
dateFormat: 'D.M.YYYY',
|
||||||
|
dayFormat: 'D',
|
||||||
|
dateTimeFormat: 'D.M.YYYY HH:mm:ss',
|
||||||
|
monthFormat: 'MMMM',
|
||||||
|
monthBeforeYear: true,
|
||||||
|
previousMonth: 'Prejšnji mesec (PageUp)',
|
||||||
|
nextMonth: 'Naslednji mesec (PageDown)',
|
||||||
|
previousYear: 'Lansko leto (Control + left)',
|
||||||
|
nextYear: 'Naslednje leto (Control + right)',
|
||||||
|
previousDecade: 'Prejšnje desetletje',
|
||||||
|
nextDecade: 'Naslednje desetletje',
|
||||||
|
previousCentury: 'Zadnje stoletje',
|
||||||
|
nextCentury: 'Naslednje stoletje',
|
||||||
|
},
|
||||||
|
timePickerLocale: {
|
||||||
|
...TimePickerLocale,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// All settings at:
|
||||||
|
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
||||||
|
|
||||||
|
export default locale
|
|
@ -1,6 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import Horizontal from './horizontal'
|
import Horizontal from './horizontal'
|
||||||
import Vertical from './vertical'
|
import Vertical from './vertical'
|
||||||
|
import Orientation from './orientation'
|
||||||
import CN from '../index.zh-CN.md'
|
import CN from '../index.zh-CN.md'
|
||||||
import US from '../index.en-US.md'
|
import US from '../index.en-US.md'
|
||||||
const md = {
|
const md = {
|
||||||
|
@ -30,6 +31,7 @@ export default {
|
||||||
<md cn={md.cn} us={md.us}/>
|
<md cn={md.cn} us={md.us}/>
|
||||||
<Vertical />
|
<Vertical />
|
||||||
<Horizontal />
|
<Horizontal />
|
||||||
|
<Orientation />
|
||||||
<api>
|
<api>
|
||||||
<CN slot='cn' />
|
<CN slot='cn' />
|
||||||
<US/>
|
<US/>
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<cn>
|
||||||
|
#### 标题位置
|
||||||
|
修改分割线标题的位置。
|
||||||
|
</cn>
|
||||||
|
|
||||||
|
<us>
|
||||||
|
#### Orientation of title
|
||||||
|
Set orientation of divider to left or right.
|
||||||
|
</us>
|
||||||
|
|
||||||
|
```html
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<a-divider orientation="left">Left Text</a-divider>
|
||||||
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||||
|
<a-divider orientation="right">Right Text</a-divider>
|
||||||
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
```
|
|
@ -4,5 +4,6 @@
|
||||||
|
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default |
|
||||||
| -------- | ----------- | ---- | ------- |
|
| -------- | ----------- | ---- | ------- |
|
||||||
| dashed | whether line is dasded | Boolean | false |
|
| dashed | whether line is dashed | Boolean | false |
|
||||||
| type | direction type of divider | enum: `horizontal` `vertical` | `horizontal` |
|
| type | direction type of divider | enum: `horizontal` `vertical` | `horizontal` |
|
||||||
|
| orientation | position of title inside divider | enum: `left` `right` `center` | `center` |
|
||||||
|
|
|
@ -5,13 +5,16 @@ export default {
|
||||||
prefixCls: PropTypes.string.def('ant'),
|
prefixCls: PropTypes.string.def('ant'),
|
||||||
type: PropTypes.oneOf(['horizontal', 'vertical']).def('horizontal'),
|
type: PropTypes.oneOf(['horizontal', 'vertical']).def('horizontal'),
|
||||||
dashed: PropTypes.bool,
|
dashed: PropTypes.bool,
|
||||||
|
orientation: PropTypes.oneOf(['left', 'right']),
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
classString () {
|
classString () {
|
||||||
const { prefixCls, type, $slots, dashed } = this
|
const { prefixCls, type, $slots, dashed, orientation = '' } = this
|
||||||
|
const orientationPrefix = (orientation.length > 0) ? '-' + orientation : orientation
|
||||||
|
|
||||||
return {
|
return {
|
||||||
[`${prefixCls}-divider`]: true, [`${prefixCls}-divider-${type}`]: true,
|
[`${prefixCls}-divider`]: true, [`${prefixCls}-divider-${type}`]: true,
|
||||||
[`${prefixCls}-divider-with-text`]: $slots.default,
|
[`${prefixCls}-divider-with-text${orientationPrefix}`]: $slots.default,
|
||||||
[`${prefixCls}-divider-dashed`]: !!dashed,
|
[`${prefixCls}-divider-dashed`]: !!dashed,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -20,7 +23,7 @@ export default {
|
||||||
const { classString, prefixCls, $slots } = this
|
const { classString, prefixCls, $slots } = this
|
||||||
return (
|
return (
|
||||||
<div class={classString}>
|
<div class={classString}>
|
||||||
{$slots.default && <span className={`${prefixCls}-divider-inner-text`}>{$slots.default}</span>}
|
{$slots.default && <span class={`${prefixCls}-divider-inner-text`}>{$slots.default}</span>}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,3 +4,5 @@
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| dashed | 是否虚线 | Boolean | false |
|
| dashed | 是否虚线 | Boolean | false |
|
||||||
| type | 水平还是垂直类型 | enum: `horizontal` `vertical` | `horizontal` |
|
| type | 水平还是垂直类型 | enum: `horizontal` `vertical` | `horizontal` |
|
||||||
|
| orientation | 分割线标题的位置 | enum: `left` `right` | `center` |
|
||||||
|
|
||||||
|
|
|
@ -44,17 +44,81 @@
|
||||||
transform: translateY(50%);
|
transform: translateY(50%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-inner-text {
|
&-inner-text {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0 24px;
|
padding: 0 24px;
|
||||||
}
|
}
|
||||||
|
&-horizontal&-with-text-left {
|
||||||
|
display: table;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
background: transparent;
|
||||||
|
font-weight: 500;
|
||||||
|
color: @heading-color;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
margin: 16px 0;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
display: table-cell;
|
||||||
|
position: relative;
|
||||||
|
top: 50%;
|
||||||
|
width: 5%;
|
||||||
|
border-top: 1px solid @border-color-split;
|
||||||
|
transform: translateY(50%);
|
||||||
|
}
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
display: table-cell;
|
||||||
|
position: relative;
|
||||||
|
top: 50%;
|
||||||
|
width: 95%;
|
||||||
|
border-top: 1px solid @border-color-split;
|
||||||
|
transform: translateY(50%);
|
||||||
|
}
|
||||||
|
&-inner-text {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-horizontal&-with-text-right {
|
||||||
|
display: table;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
background: transparent;
|
||||||
|
font-weight: 500;
|
||||||
|
color: @heading-color;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
margin: 16px 0;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
display: table-cell;
|
||||||
|
position: relative;
|
||||||
|
top: 50%;
|
||||||
|
width: 95%;
|
||||||
|
border-top: 1px solid @border-color-split;
|
||||||
|
transform: translateY(50%);
|
||||||
|
}
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
display: table-cell;
|
||||||
|
position: relative;
|
||||||
|
top: 50%;
|
||||||
|
width: 5%;
|
||||||
|
border-top: 1px solid @border-color-split;
|
||||||
|
transform: translateY(50%);
|
||||||
|
}
|
||||||
|
&-inner-text {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
&-dashed {
|
&-dashed {
|
||||||
background: none;
|
background: none;
|
||||||
border-top: 1px dashed @border-color-split;
|
border-top: 1px dashed @border-color-split;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-horizontal&-with-text&-dashed {
|
&-horizontal&-with-text&-dashed {
|
||||||
border-top: 0;
|
border-top: 0;
|
||||||
&:before,
|
&:before,
|
||||||
|
|
|
@ -151,6 +151,10 @@ export default {
|
||||||
renderInput () {
|
renderInput () {
|
||||||
const otherProps = omit(this.$props, [
|
const otherProps = omit(this.$props, [
|
||||||
'prefixCls',
|
'prefixCls',
|
||||||
|
'addonBefore',
|
||||||
|
'addonAfter',
|
||||||
|
'prefix',
|
||||||
|
'suffix',
|
||||||
])
|
])
|
||||||
const { stateValue, getInputClassName, handleKeyDown, handleChange, $listeners } = this
|
const { stateValue, getInputClassName, handleKeyDown, handleChange, $listeners } = this
|
||||||
const inputProps = {
|
const inputProps = {
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
|
|
||||||
|
import classNames from 'classnames'
|
||||||
import Input from './Input'
|
import Input from './Input'
|
||||||
import Icon from '../icon'
|
import Icon from '../icon'
|
||||||
import inputProps from './inputProps'
|
import inputProps from './inputProps'
|
||||||
|
import Button from '../button'
|
||||||
|
import { cloneElement } from '../_util/vnode'
|
||||||
|
import { getOptionProps, getComponentFromProp } from '../_util/props-util'
|
||||||
|
import PropsType from '../_util/vue-types'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'InputSearch',
|
name: 'InputSearch',
|
||||||
|
@ -15,6 +20,7 @@ export default {
|
||||||
default: 'ant-input',
|
default: 'ant-input',
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
enterButton: PropsType.oneOfType([PropsType.bool, PropsType.string, PropsType.object]),
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
},
|
},
|
||||||
|
@ -23,29 +29,76 @@ export default {
|
||||||
this.$emit('search', this.$refs.input.stateValue)
|
this.$emit('search', this.$refs.input.stateValue)
|
||||||
this.$refs.input.focus()
|
this.$refs.input.focus()
|
||||||
},
|
},
|
||||||
|
getButtonOrIcon () {
|
||||||
|
const { prefixCls, size } = this
|
||||||
|
const enterButton = getComponentFromProp(this, 'enterButton')
|
||||||
|
if (!enterButton) {
|
||||||
|
return <Icon class={`${prefixCls}-icon`} type='search' key='searchIcon' />
|
||||||
|
}
|
||||||
|
const enterButtonAsElement = Array.isArray(enterButton) ? enterButton[0] : enterButton
|
||||||
|
if (enterButtonAsElement.componentOptions && enterButtonAsElement.componentOptions.Ctor.extendOptions.__ANT_BUTTON) {
|
||||||
|
return cloneElement(enterButtonAsElement, {
|
||||||
|
class: `${prefixCls}-button`,
|
||||||
|
props: { size },
|
||||||
|
on: {
|
||||||
|
click: this.onSearch,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} else if (enterButtonAsElement.tag === 'button') {
|
||||||
|
return cloneElement(enterButtonAsElement[0], {
|
||||||
|
on: {
|
||||||
|
click: this.onSearch,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
class={`${prefixCls}-button`}
|
||||||
|
type='primary'
|
||||||
|
size={size}
|
||||||
|
onClick={this.onSearch}
|
||||||
|
key='enterButton'
|
||||||
|
>
|
||||||
|
{enterButton === true ? <Icon type='search' /> : enterButton}
|
||||||
|
</Button>
|
||||||
|
)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
render () {
|
render () {
|
||||||
const { inputPrefixCls, prefixCls, ...others } = this.$props
|
const { prefixCls, inputPrefixCls, size,
|
||||||
|
suffix, ...others
|
||||||
|
} = getOptionProps(this)
|
||||||
|
const enterButton = getComponentFromProp(this, 'enterButton')
|
||||||
|
const buttonOrIcon = this.getButtonOrIcon()
|
||||||
|
const searchSuffix = suffix ? [suffix, buttonOrIcon] : buttonOrIcon
|
||||||
|
const inputClassName = classNames(prefixCls, {
|
||||||
|
[`${prefixCls}-enter-button`]: !!enterButton,
|
||||||
|
[`${prefixCls}-${size}`]: !!size,
|
||||||
|
})
|
||||||
const inputProps = {
|
const inputProps = {
|
||||||
props: {
|
props: {
|
||||||
...others,
|
...others,
|
||||||
prefixCls: inputPrefixCls,
|
prefixCls: inputPrefixCls,
|
||||||
|
size,
|
||||||
|
suffix: searchSuffix,
|
||||||
},
|
},
|
||||||
attrs: this.$attrs,
|
attrs: this.$attrs,
|
||||||
|
on: {
|
||||||
|
pressEnter: this.onSearch,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Input
|
<Input
|
||||||
{...inputProps}
|
{...inputProps}
|
||||||
onPressEnter={this.onSearch}
|
class={inputClassName}
|
||||||
class={prefixCls}
|
|
||||||
ref='input'
|
ref='input'
|
||||||
>
|
>
|
||||||
<Icon
|
{/* <Icon
|
||||||
slot='suffix'
|
slot='suffix'
|
||||||
class={`${prefixCls}-icon`}
|
class={`${prefixCls}-icon`}
|
||||||
onClick={this.onSearch}
|
onClick={this.onSearch}
|
||||||
type='search'
|
type='search'
|
||||||
/>
|
/> */}
|
||||||
</Input>
|
</Input>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
@ -14,7 +14,7 @@ Note: You don't need `Col` to control the width in the `compact` mode.
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-input-group size="large">
|
<a-input-group size="large">
|
||||||
<a-col :span="4">
|
<a-col :span="5">
|
||||||
<a-input defaultValue="0571" />
|
<a-input defaultValue="0571" />
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
|
|
|
@ -10,11 +10,25 @@ Example of creating a search box by grouping a standard input with a search butt
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
<a-input-search
|
<a-input-search
|
||||||
placeholder="input search text"
|
placeholder="input search text"
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
@search="onSearch"
|
@search="onSearch"
|
||||||
/>
|
/>
|
||||||
|
<br /><br />
|
||||||
|
<a-input-search
|
||||||
|
placeholder="input search text"
|
||||||
|
@search="onSearch"
|
||||||
|
enterButton
|
||||||
|
/>
|
||||||
|
<br /><br />
|
||||||
|
<a-input-search placeholder="input search text" @search="onSearch" enterButton="Search" size="large" />
|
||||||
|
<br /><br />
|
||||||
|
<a-input-search placeholder="input search text" @search="onSearch" size="large">
|
||||||
|
<a-button slot="enterButton">Custom</a-button>
|
||||||
|
</a-input-search>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -327,6 +327,9 @@
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
line-height: 0;
|
line-height: 0;
|
||||||
color: @input-color;
|
color: @input-color;
|
||||||
|
:not(.anticon) {
|
||||||
|
line-height: @line-height-base;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.@{inputClass}-prefix {
|
.@{inputClass}-prefix {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
import PropTypes from '../_util/vue-types'
|
import PropTypes from '../_util/vue-types'
|
||||||
import * as moment from 'moment'
|
import * as moment from 'moment'
|
||||||
|
import interopDefault from '../_util/interopDefault'
|
||||||
import { changeConfirmLocale } from '../modal/locale'
|
import { changeConfirmLocale } from '../modal/locale'
|
||||||
|
|
||||||
// export interface Locale {
|
// export interface Locale {
|
||||||
|
@ -19,9 +20,9 @@ import { changeConfirmLocale } from '../modal/locale'
|
||||||
|
|
||||||
function setMomentLocale (locale) {
|
function setMomentLocale (locale) {
|
||||||
if (locale && locale.locale) {
|
if (locale && locale.locale) {
|
||||||
moment.locale(locale.locale)
|
interopDefault(moment).locale(locale.locale)
|
||||||
} else {
|
} else {
|
||||||
moment.locale('en')
|
interopDefault(moment).locale('en')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
import Pagination from '../vc-pagination/locale/sl_SI'
|
||||||
|
import DatePicker from '../date-picker/locale/sl_SI'
|
||||||
|
import TimePicker from '../time-picker/locale/sl_SI'
|
||||||
|
import Calendar from '../calendar/locale/sl_SI'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
locale: 'sl',
|
||||||
|
Pagination,
|
||||||
|
DatePicker,
|
||||||
|
TimePicker,
|
||||||
|
Calendar,
|
||||||
|
Table: {
|
||||||
|
filterTitle: 'Filter',
|
||||||
|
filterConfirm: 'Filtriraj',
|
||||||
|
filterReset: 'Pobriši filter',
|
||||||
|
emptyText: 'Ni podatkov',
|
||||||
|
selectAll: 'Izberi vse na trenutni strani',
|
||||||
|
selectInvert: 'Obrni izbor na trenutni strani',
|
||||||
|
},
|
||||||
|
Modal: {
|
||||||
|
okText: 'V redu',
|
||||||
|
cancelText: 'Prekliči',
|
||||||
|
justOkText: 'V redu',
|
||||||
|
},
|
||||||
|
Popconfirm: {
|
||||||
|
okText: 'v redu',
|
||||||
|
cancelText: 'Prekliči',
|
||||||
|
},
|
||||||
|
Transfer: {
|
||||||
|
notFoundContent: 'Ni rezultatov iskanja',
|
||||||
|
searchPlaceholder: 'Išči tukaj',
|
||||||
|
itemUnit: 'Objekt',
|
||||||
|
itemsUnit: 'Objektov',
|
||||||
|
},
|
||||||
|
Select: {
|
||||||
|
notFoundContent: 'Ni bilo mogoče najti',
|
||||||
|
},
|
||||||
|
Upload: {
|
||||||
|
uploading: 'Nalaganje...',
|
||||||
|
removeFile: 'Odstrani datoteko',
|
||||||
|
uploadError: 'Napaka pri nalaganju',
|
||||||
|
previewFile: 'Predogled datoteke',
|
||||||
|
},
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
import Pagination from '../vc-pagination/locale/en_US';
|
import Pagination from '../vc-pagination/locale/tr_TR'
|
||||||
import DatePicker from '../date-picker/locale/tr_TR';
|
import DatePicker from '../date-picker/locale/tr_TR'
|
||||||
import TimePicker from '../time-picker/locale/tr_TR';
|
import TimePicker from '../time-picker/locale/tr_TR'
|
||||||
import Calendar from '../calendar/locale/tr_TR';
|
import Calendar from '../calendar/locale/tr_TR'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
locale: 'tr',
|
locale: 'tr',
|
||||||
|
@ -15,30 +15,30 @@ export default {
|
||||||
filterReset: 'Sıfırla',
|
filterReset: 'Sıfırla',
|
||||||
emptyText: 'Veri Yok',
|
emptyText: 'Veri Yok',
|
||||||
selectAll: 'Hepsini Seç',
|
selectAll: 'Hepsini Seç',
|
||||||
selectInvert: 'Tersini Seç'
|
selectInvert: 'Tersini Seç',
|
||||||
},
|
},
|
||||||
Modal: {
|
Modal: {
|
||||||
okText: 'Tamam',
|
okText: 'Tamam',
|
||||||
cancelText: 'İptal',
|
cancelText: 'İptal',
|
||||||
justOkText: 'Tamam'
|
justOkText: 'Tamam',
|
||||||
},
|
},
|
||||||
Popconfirm: {
|
Popconfirm: {
|
||||||
okText: 'Tamam',
|
okText: 'Tamam',
|
||||||
cancelText: 'İptal'
|
cancelText: 'İptal',
|
||||||
},
|
},
|
||||||
Transfer: {
|
Transfer: {
|
||||||
notFoundContent: 'Bulunamadı',
|
notFoundContent: 'Bulunamadı',
|
||||||
searchPlaceholder: 'Arama',
|
searchPlaceholder: 'Arama',
|
||||||
itemUnit: 'Öğe',
|
itemUnit: 'Öğe',
|
||||||
itemsUnit: 'Öğeler'
|
itemsUnit: 'Öğeler',
|
||||||
},
|
},
|
||||||
Select: {
|
Select: {
|
||||||
notFoundContent: 'Bulunamadı'
|
notFoundContent: 'Bulunamadı',
|
||||||
},
|
},
|
||||||
Upload: {
|
Upload: {
|
||||||
uploading: 'Yükleniyor...',
|
uploading: 'Yükleniyor...',
|
||||||
removeFile: `Dosyayı kaldır`,
|
removeFile: `Dosyayı kaldır`,
|
||||||
uploadError: 'Yükleme Hatası',
|
uploadError: 'Yükleme Hatası',
|
||||||
previewFile: `Dosyayı Önizle`
|
previewFile: `Dosyayı Önizle`,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
import omit from 'omit.js'
|
import omit from 'omit.js'
|
||||||
import RcMenu, { Divider, ItemGroup, SubMenu } from '../vc-menu'
|
import VcMenu, { Divider, ItemGroup, SubMenu } from '../vc-menu'
|
||||||
import PropTypes from '../_util/vue-types'
|
import PropTypes from '../_util/vue-types'
|
||||||
import animation from '../_util/openAnimation'
|
import animation from '../_util/openAnimation'
|
||||||
import warning from '../_util/warning'
|
import warning from '../_util/warning'
|
||||||
|
@ -247,7 +247,7 @@ export default {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return <RcMenu {...menuProps} class={menuClassName}>{$slots.default}</RcMenu>
|
return <VcMenu {...menuProps} class={menuClassName}>{$slots.default}</VcMenu>
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,6 @@
|
||||||
&:before {
|
&:before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
@ -286,6 +284,9 @@
|
||||||
&:hover {
|
&:hover {
|
||||||
color: @menu-highlight-color;
|
color: @menu-highlight-color;
|
||||||
}
|
}
|
||||||
|
&:before {
|
||||||
|
bottom: -2px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ This components provides some static methods, with usage and arguments as follow
|
||||||
| Argument | Description | Type | Default |
|
| Argument | Description | Type | Default |
|
||||||
| -------- | ----------- | ---- | ------- |
|
| -------- | ----------- | ---- | ------- |
|
||||||
| content | content of the message | string\|vueNode \|function(h) | - |
|
| content | content of the message | string\|vueNode \|function(h) | - |
|
||||||
| duration | time before auto-dismiss, in seconds | number | 1.5 |
|
| duration | time(seconds) before auto-dismiss, don't dismiss if set to 0 | number | 1.5 |
|
||||||
| onClose | Specify a function that will be called when the message is closed | Function | - |
|
| onClose | Specify a function that will be called when the message is closed | Function | - |
|
||||||
|
|
||||||
Methods for global configuration and destruction are also provided:
|
Methods for global configuration and destruction are also provided:
|
||||||
|
|
|
@ -6,6 +6,7 @@ let defaultTop = null
|
||||||
let messageInstance = null
|
let messageInstance = null
|
||||||
let key = 1
|
let key = 1
|
||||||
let prefixCls = 'ant-message'
|
let prefixCls = 'ant-message'
|
||||||
|
let transitionName = 'move-up'
|
||||||
let getContainer = () => document.body
|
let getContainer = () => document.body
|
||||||
|
|
||||||
function getMessageInstance (callback) {
|
function getMessageInstance (callback) {
|
||||||
|
@ -15,7 +16,7 @@ function getMessageInstance (callback) {
|
||||||
}
|
}
|
||||||
Notification.newInstance({
|
Notification.newInstance({
|
||||||
prefixCls,
|
prefixCls,
|
||||||
transitionName: 'move-up',
|
transitionName,
|
||||||
style: { top: defaultTop }, // 覆盖原来的样式
|
style: { top: defaultTop }, // 覆盖原来的样式
|
||||||
getContainer,
|
getContainer,
|
||||||
}, (instance) => {
|
}, (instance) => {
|
||||||
|
@ -80,6 +81,7 @@ function notice (
|
||||||
// duration?: number;
|
// duration?: number;
|
||||||
// prefixCls?: string;
|
// prefixCls?: string;
|
||||||
// getContainer?: () => HTMLElement;
|
// getContainer?: () => HTMLElement;
|
||||||
|
// transitionName?: string;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -116,6 +118,10 @@ export default {
|
||||||
if (options.getContainer !== undefined) {
|
if (options.getContainer !== undefined) {
|
||||||
getContainer = options.getContainer
|
getContainer = options.getContainer
|
||||||
}
|
}
|
||||||
|
if (options.transitionName !== undefined) {
|
||||||
|
transitionName = options.transitionName
|
||||||
|
messageInstance = null // delete messageInstance for new transitionName
|
||||||
|
}
|
||||||
},
|
},
|
||||||
destroy () {
|
destroy () {
|
||||||
if (messageInstance) {
|
if (messageInstance) {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| content | 提示内容 | string\|vueNode \|function(h) | - |
|
| content | 提示内容 | string\|vueNode \|function(h) | - |
|
||||||
| duration | 自动关闭的延时,单位秒 | number | 3 |
|
| duration | 自动关闭的延时,单位秒。设为 0 时不自动关闭。 | number | 3 |
|
||||||
| onClose | 关闭时触发的回调函数 | Function | - |
|
| onClose | 关闭时触发的回调函数 | Function | - |
|
||||||
|
|
||||||
还提供了全局配置和全局销毁方法:
|
还提供了全局配置和全局销毁方法:
|
||||||
|
|
|
@ -9,7 +9,7 @@ export default {
|
||||||
functional: true,
|
functional: true,
|
||||||
render (h, context) {
|
render (h, context) {
|
||||||
const { props } = context
|
const { props } = context
|
||||||
const { onCancel, onOk, close, zIndex, afterClose, visible } = props
|
const { onCancel, onOk, close, zIndex, afterClose, visible, keyboard } = props
|
||||||
const iconType = props.iconType || 'question-circle'
|
const iconType = props.iconType || 'question-circle'
|
||||||
const okType = props.okType || 'primary'
|
const okType = props.okType || 'primary'
|
||||||
const prefixCls = props.prefixCls || 'ant-confirm'
|
const prefixCls = props.prefixCls || 'ant-confirm'
|
||||||
|
@ -50,6 +50,7 @@ export default {
|
||||||
width={width}
|
width={width}
|
||||||
zIndex={zIndex}
|
zIndex={zIndex}
|
||||||
afterClose={afterClose}
|
afterClose={afterClose}
|
||||||
|
keyboard={keyboard}
|
||||||
>
|
>
|
||||||
<div class={`${prefixCls}-body-wrapper`}>
|
<div class={`${prefixCls}-body-wrapper`}>
|
||||||
<div class={`${prefixCls}-body`}>
|
<div class={`${prefixCls}-body`}>
|
||||||
|
|
|
@ -49,6 +49,7 @@ const modalProps = (defaultProps = {}) => {
|
||||||
bodyStyle: PropTypes.object,
|
bodyStyle: PropTypes.object,
|
||||||
maskStyle: PropTypes.object,
|
maskStyle: PropTypes.object,
|
||||||
mask: PropTypes.bool,
|
mask: PropTypes.bool,
|
||||||
|
keyboard: PropTypes.bool,
|
||||||
}
|
}
|
||||||
return initDefaultProps(props, defaultProps)
|
return initDefaultProps(props, defaultProps)
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,10 @@
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: @font-size-lg;
|
font-size: @font-size-lg;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
|
display: block;
|
||||||
|
// create BFC to avoid
|
||||||
|
// https://user-images.githubusercontent.com/507615/37702510-ba844e06-2d2d-11e8-9b67-8e19be57f445.png
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.@{confirm-prefix-cls}-content {
|
.@{confirm-prefix-cls}-content {
|
||||||
|
@ -38,7 +42,6 @@
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
float: left;
|
float: left;
|
||||||
min-height: 48px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,7 @@
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
font-size: @font-size-base;
|
font-size: @font-size-base;
|
||||||
line-height: @line-height-base;
|
line-height: @line-height-base;
|
||||||
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-footer {
|
&-footer {
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
|
|
||||||
&-active {
|
&-active {
|
||||||
border-color: @primary-color;
|
border-color: @primary-color;
|
||||||
font-weight: 500;
|
font-weight: @pagination-font-weight-active;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: @primary-color;
|
color: @primary-color;
|
||||||
|
|
|
@ -42,12 +42,13 @@ export default {
|
||||||
}),
|
}),
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
const props = getOptionProps(this)
|
||||||
const {
|
const {
|
||||||
prefixCls, percent = 0, status, format, trailColor, size, successPercent,
|
prefixCls, percent = 0, status, format, trailColor, size, successPercent,
|
||||||
type, strokeWidth, width, showInfo, gapDegree = 0, gapPosition,
|
type, strokeWidth, width, showInfo, gapDegree = 0, gapPosition,
|
||||||
} = getOptionProps(this)
|
} = props
|
||||||
const progressStatus = parseInt(percent.toString(), 10) >= 100 && !(status)
|
const progressStatus = parseInt((successPercent ? successPercent.toString() : percent.toString()), 10) >= 100 &&
|
||||||
? 'success' : (status || 'normal')
|
!('status' in props) ? 'success' : (status || 'normal')
|
||||||
let progressInfo
|
let progressInfo
|
||||||
let progress
|
let progress
|
||||||
const textFormatter = format || (percentNumber => `${percentNumber}%`)
|
const textFormatter = format || (percentNumber => `${percentNumber}%`)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
&-disabled &-star {
|
&-disabled &-star {
|
||||||
cursor: not-allowed;
|
cursor: default;
|
||||||
&:hover {
|
&:hover {
|
||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,10 +25,10 @@
|
||||||
| labelInValue | whether to embed label in value, turn the format of value from `string` to `{key: string, label: vNodes}` | boolean | false |
|
| labelInValue | whether to embed label in value, turn the format of value from `string` to `{key: string, label: vNodes}` | boolean | false |
|
||||||
| maxTagCount | Max tag count to show | number | - |
|
| maxTagCount | Max tag count to show | number | - |
|
||||||
| maxTagPlaceholder | Placeholder for not showing tags | slot/function(omittedValues) | - |
|
| maxTagPlaceholder | Placeholder for not showing tags | slot/function(omittedValues) | - |
|
||||||
| mode | Set mode of Select | 'multiple' \| 'tags' \| 'combobox' | - |
|
| mode | Set mode of Select | 'default' \| 'multiple' \| 'tags' \| 'combobox' | 'default' |
|
||||||
| notFoundContent | Specify content to show when no result matches.. | string\|slot | 'Not Found' |
|
| notFoundContent | Specify content to show when no result matches.. | string\|slot | 'Not Found' |
|
||||||
| optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | value |
|
| optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | value |
|
||||||
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` |
|
| optionLabelProp | Which prop value of option will render as content of select. | string | `value` for `combobox`, `children` for other modes |
|
||||||
| placeholder | Placeholder of select | string\|slot | - |
|
| placeholder | Placeholder of select | string\|slot | - |
|
||||||
| showSearch | Whether show search input in single mode. | boolean | false |
|
| showSearch | Whether show search input in single mode. | boolean | false |
|
||||||
| showArrow | Whether to show the drop-down arrow | boolean | true |
|
| showArrow | Whether to show the drop-down arrow | boolean | true |
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
| labelInValue | 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 `string` 变为 `{key: string, label: vNodes}` 的格式 | boolean | false |
|
| labelInValue | 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 `string` 变为 `{key: string, label: vNodes}` 的格式 | boolean | false |
|
||||||
| maxTagCount | 最多显示多少个 tag | number | - |
|
| maxTagCount | 最多显示多少个 tag | number | - |
|
||||||
| maxTagPlaceholder | 隐藏 tag 时显示的内容 | slot/function(omittedValues) | - |
|
| maxTagPlaceholder | 隐藏 tag 时显示的内容 | slot/function(omittedValues) | - |
|
||||||
| mode | 设置 Select 的模式 | 'multiple' \| 'tags' \| 'combobox' | - |
|
| mode | 设置 Select 的模式 | 'default' \| 'multiple' \| 'tags' \| 'combobox' | - |
|
||||||
| notFoundContent | 当下拉列表为空时显示的内容 | string\|slot | 'Not Found' |
|
| notFoundContent | 当下拉列表为空时显示的内容 | string\|slot | 'Not Found' |
|
||||||
| optionFilterProp | 搜索时过滤对应的 option 属性,如设置为 children 表示对内嵌内容进行搜索 | string | value |
|
| optionFilterProp | 搜索时过滤对应的 option 属性,如设置为 children 表示对内嵌内容进行搜索 | string | value |
|
||||||
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` (combobox 模式下为 `value`) |
|
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` (combobox 模式下为 `value`) |
|
||||||
|
|
|
@ -489,6 +489,14 @@
|
||||||
background-color: @item-hover-bg;
|
background-color: @item-hover-bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
border-radius: @border-radius-base @border-radius-base 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-radius: 0 0 @border-radius-base @border-radius-base;
|
||||||
|
}
|
||||||
|
|
||||||
&-disabled {
|
&-disabled {
|
||||||
color: @disabled-color;
|
color: @disabled-color;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
font-family: anticon;
|
font-family: anticon;
|
||||||
animation: loadingCircle 1s infinite linear;
|
animation: loadingCircle 1s infinite linear;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background: transprent;
|
background: transparent;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
display: none;
|
display: none;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
&:before,
|
&:before,
|
||||||
&:after {
|
&:after {
|
||||||
left: 100%;
|
left: 100%;
|
||||||
margin-left: -12.5px;
|
margin-left: @switch-sm-checked-margin-left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.@{switch-prefix-cls}-inner {
|
.@{switch-prefix-cls}-inner {
|
||||||
|
|
|
@ -193,7 +193,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
setSelectedRowKeys (selectedRowKeys, { selectWay, record, checked, changeRowKeys }) {
|
setSelectedRowKeys (selectedRowKeys, { selectWay, record, checked, changeRowKeys, nativeEvent }) {
|
||||||
const { rowSelection = {}} = this
|
const { rowSelection = {}} = this
|
||||||
if (rowSelection && !('selectedRowKeys' in rowSelection)) {
|
if (rowSelection && !('selectedRowKeys' in rowSelection)) {
|
||||||
this.store.setState({ selectedRowKeys })
|
this.store.setState({ selectedRowKeys })
|
||||||
|
@ -209,7 +209,7 @@ export default {
|
||||||
rowSelection.onChange(selectedRowKeys, selectedRows)
|
rowSelection.onChange(selectedRowKeys, selectedRows)
|
||||||
}
|
}
|
||||||
if (selectWay === 'onSelect' && rowSelection.onSelect) {
|
if (selectWay === 'onSelect' && rowSelection.onSelect) {
|
||||||
rowSelection.onSelect(record, checked, selectedRows)
|
rowSelection.onSelect(record, checked, selectedRows, nativeEvent)
|
||||||
} else if (selectWay === 'onSelectAll' && rowSelection.onSelectAll) {
|
} else if (selectWay === 'onSelectAll' && rowSelection.onSelectAll) {
|
||||||
const changeRows = data.filter(
|
const changeRows = data.filter(
|
||||||
(row, i) => changeRowKeys.indexOf(this.getRecordKey(row, i)) >= 0,
|
(row, i) => changeRowKeys.indexOf(this.getRecordKey(row, i)) >= 0,
|
||||||
|
@ -404,6 +404,7 @@ export default {
|
||||||
|
|
||||||
handleSelect (record, rowIndex, e) {
|
handleSelect (record, rowIndex, e) {
|
||||||
const checked = e.target.checked
|
const checked = e.target.checked
|
||||||
|
const nativeEvent = e.nativeEvent
|
||||||
const defaultSelection = this.store.getState().selectionDirty ? [] : this.getDefaultSelection()
|
const defaultSelection = this.store.getState().selectionDirty ? [] : this.getDefaultSelection()
|
||||||
let selectedRowKeys = this.store.getState().selectedRowKeys.concat(defaultSelection)
|
let selectedRowKeys = this.store.getState().selectedRowKeys.concat(defaultSelection)
|
||||||
const key = this.getRecordKey(record, rowIndex)
|
const key = this.getRecordKey(record, rowIndex)
|
||||||
|
@ -419,11 +420,14 @@ export default {
|
||||||
selectWay: 'onSelect',
|
selectWay: 'onSelect',
|
||||||
record,
|
record,
|
||||||
checked,
|
checked,
|
||||||
|
changeRowKeys: void (0),
|
||||||
|
nativeEvent,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
handleRadioSelect (record, rowIndex, e) {
|
handleRadioSelect (record, rowIndex, e) {
|
||||||
const checked = e.target.checked
|
const checked = e.target.checked
|
||||||
|
const nativeEvent = e.nativeEvent
|
||||||
const defaultSelection = this.store.getState().selectionDirty ? [] : this.getDefaultSelection()
|
const defaultSelection = this.store.getState().selectionDirty ? [] : this.getDefaultSelection()
|
||||||
let selectedRowKeys = this.store.getState().selectedRowKeys.concat(defaultSelection)
|
let selectedRowKeys = this.store.getState().selectedRowKeys.concat(defaultSelection)
|
||||||
const key = this.getRecordKey(record, rowIndex)
|
const key = this.getRecordKey(record, rowIndex)
|
||||||
|
@ -435,6 +439,8 @@ export default {
|
||||||
selectWay: 'onSelect',
|
selectWay: 'onSelect',
|
||||||
record,
|
record,
|
||||||
checked,
|
checked,
|
||||||
|
changeRowKeys: void (0),
|
||||||
|
nativeEvent,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -601,6 +607,7 @@ export default {
|
||||||
customRender: this.renderSelectionBox(rowSelection.type),
|
customRender: this.renderSelectionBox(rowSelection.type),
|
||||||
className: selectionColumnClass,
|
className: selectionColumnClass,
|
||||||
fixed: rowSelection.fixed,
|
fixed: rowSelection.fixed,
|
||||||
|
width: rowSelection.columnWidth,
|
||||||
}
|
}
|
||||||
if (rowSelection.type !== 'radio') {
|
if (rowSelection.type !== 'radio') {
|
||||||
const checkboxAllDisabled = data.every((item, index) => this.getCheckboxPropsByItem(item, index).disabled)
|
const checkboxAllDisabled = data.every((item, index) => this.getCheckboxPropsByItem(item, index).disabled)
|
||||||
|
@ -705,7 +712,7 @@ export default {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
column.title = (
|
column.title = (
|
||||||
<span>
|
<span key={key}>
|
||||||
{column.title}
|
{column.title}
|
||||||
{sortButton}
|
{sortButton}
|
||||||
{filterDropdown}
|
{filterDropdown}
|
||||||
|
@ -735,7 +742,7 @@ export default {
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
|
||||||
renderPagination () {
|
renderPagination (paginationPosition) {
|
||||||
// 强制不需要分页
|
// 强制不需要分页
|
||||||
if (!this.hasPagination()) {
|
if (!this.hasPagination()) {
|
||||||
return null
|
return null
|
||||||
|
@ -747,10 +754,11 @@ export default {
|
||||||
} else if (this.size === 'middle' || this.size === 'small') {
|
} else if (this.size === 'middle' || this.size === 'small') {
|
||||||
size = 'small'
|
size = 'small'
|
||||||
}
|
}
|
||||||
|
const position = pagination.position || 'bottom'
|
||||||
const total = pagination.total || this.getLocalData().length
|
const total = pagination.total || this.getLocalData().length
|
||||||
const { class: cls, style, onChange, onShowSizeChange, ...restProps } = pagination // eslint-disable-line
|
const { class: cls, style, onChange, onShowSizeChange, ...restProps } = pagination // eslint-disable-line
|
||||||
const paginationProps = mergeProps({
|
const paginationProps = mergeProps({
|
||||||
key: 'pagination',
|
key: `pagination-${paginationPosition}`,
|
||||||
class: classNames(cls, `${this.prefixCls}-pagination`),
|
class: classNames(cls, `${this.prefixCls}-pagination`),
|
||||||
props: {
|
props: {
|
||||||
...restProps,
|
...restProps,
|
||||||
|
@ -764,7 +772,7 @@ export default {
|
||||||
showSizeChange: this.handleShowSizeChange,
|
showSizeChange: this.handleShowSizeChange,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return (total > 0) ? (
|
return (total > 0 && (position === paginationPosition || position === 'both')) ? (
|
||||||
<Pagination
|
<Pagination
|
||||||
{...paginationProps}
|
{...paginationProps}
|
||||||
/>
|
/>
|
||||||
|
@ -966,8 +974,9 @@ export default {
|
||||||
<Spin
|
<Spin
|
||||||
{...spinProps}
|
{...spinProps}
|
||||||
>
|
>
|
||||||
|
{this.renderPagination('top')}
|
||||||
{table}
|
{table}
|
||||||
{this.renderPagination()}
|
{this.renderPagination('bottom')}
|
||||||
</Spin>
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
<us>
|
<us>
|
||||||
#### Fixed Columns
|
#### Fixed Columns
|
||||||
To fix some columns and scroll inside other columns, and you must set `scoll.x` meanwhile.
|
To fix some columns and scroll inside other columns, and you must set `scroll.x` meanwhile.
|
||||||
> Specify the width of columns if header and cell do not align properly.
|
> Specify the width of columns if header and cell do not align properly.
|
||||||
> A fixed value which is greater than table width for `scroll.x` is recommended. The sum of unfixed columns should not greater than `scroll.x`.
|
> A fixed value which is greater than table width for `scroll.x` is recommended. The sum of unfixed columns should not greater than `scroll.x`.
|
||||||
</us>
|
</us>
|
||||||
|
|
|
@ -48,11 +48,11 @@ const columns = [{
|
||||||
| indentSize | Indent size in pixels of tree data | number | 15 |
|
| indentSize | Indent size in pixels of tree data | number | 15 |
|
||||||
| loading | Loading status of table | boolean\|[object](https://vuecomponent.github.io/ant-design/#/us/components/spin) | `false` |
|
| loading | Loading status of table | boolean\|[object](https://vuecomponent.github.io/ant-design/#/us/components/spin) | `false` |
|
||||||
| locale | i18n text including filter, sort, empty text, etc | object | filterConfirm: 'Ok' <br> filterReset: 'Reset' <br> emptyText: 'No Data' |
|
| locale | i18n text including filter, sort, empty text, etc | object | filterConfirm: 'Ok' <br> filterReset: 'Reset' <br> emptyText: 'No Data' |
|
||||||
| pagination | Pagination [config](https://vuecomponent.github.io/ant-design/#/us/components/pagination), hide it by setting it to `false` | object | |
|
| pagination | Pagination [config](#pagination) or [`Pagination`] (/components/pagination/), hide it by setting it to `false` | object | |
|
||||||
| rowClassName | Row's className | Function(record, index):string | - |
|
| rowClassName | Row's className | Function(record, index):string | - |
|
||||||
| rowKey | Row's unique key, could be a string or function that returns a string | string\|Function(record):string | `key` |
|
| rowKey | Row's unique key, could be a string or function that returns a string | string\|Function(record):string | `key` |
|
||||||
| rowSelection | Row selection [config](#rowSelection) | object | null |
|
| rowSelection | Row selection [config](#rowSelection) | object | null |
|
||||||
| scroll | Whether table can be scrolled in x/y direction, `x` or `y` can be a number that indicates the width and height of table body | object | - |
|
| scroll | Set horizontal or vertical scrolling, can also be used to specify the width and height of the scroll area. It is recommended to set a number for `x`, if you want to set it to `true`, you need to add style `.ant-table td { white-space: nowrap; }`. | { x: number \| true, y: number } | - |
|
||||||
| showHeader | Whether to show table header | boolean | `true` |
|
| showHeader | Whether to show table header | boolean | `true` |
|
||||||
| size | Size of table | `default` \| `middle` \| `small` | `default` |
|
| size | Size of table | `default` \| `middle` \| `small` | `default` |
|
||||||
| title | Table title renderer | Function(currentPageData)\|slot-scope | |
|
| title | Table title renderer | Function(currentPageData)\|slot-scope | |
|
||||||
|
@ -115,6 +115,7 @@ One of the Table `columns` prop for describing the table's columns, Column has t
|
||||||
| fixed | Set column to be fixed: `true`(same as left) `'left'` `'right'` | boolean\|string | `false` |
|
| fixed | Set column to be fixed: `true`(same as left) `'left'` `'right'` | boolean\|string | `false` |
|
||||||
| key | Unique key of this column, you can ignore this prop if you've set a unique `dataIndex` | string | - |
|
| key | Unique key of this column, you can ignore this prop if you've set a unique `dataIndex` | string | - |
|
||||||
| customRender | Renderer of the table cell. The return value should be a VNode, or an object for colSpan/rowSpan config | Function(text, record, index) {}\|slot-scope | - |
|
| customRender | Renderer of the table cell. The return value should be a VNode, or an object for colSpan/rowSpan config | Function(text, record, index) {}\|slot-scope | - |
|
||||||
|
| align | specify how content is aligned | 'left' \| 'right' \| 'center' | 'left' |
|
||||||
| sorter | Sort function for local sort, see [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)'s compareFunction. If you need sort buttons only, set to `true` | Function\|boolean | - |
|
| sorter | Sort function for local sort, see [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)'s compareFunction. If you need sort buttons only, set to `true` | Function\|boolean | - |
|
||||||
| sortOrder | Order of sorted values: `'ascend'` `'descend'` `false` | boolean\|string | - |
|
| sortOrder | Order of sorted values: `'ascend'` `'descend'` `false` | boolean\|string | - |
|
||||||
| title | Title of this column | string\|slot | - |
|
| title | Title of this column | string\|slot | - |
|
||||||
|
@ -134,6 +135,17 @@ One of the Table `columns` prop for describing the table's columns, Column has t
|
||||||
| title | Title of the column group | string\|slot | - |
|
| title | Title of the column group | string\|slot | - |
|
||||||
| slots | When using columns, you can use this property to configure the properties that support the slot, such as `slots: { title: 'XXX'}` | object | - |
|
| slots | When using columns, you can use this property to configure the properties that support the slot, such as `slots: { title: 'XXX'}` | object | - |
|
||||||
|
|
||||||
|
|
||||||
|
### pagination
|
||||||
|
|
||||||
|
Properties for pagination.
|
||||||
|
|
||||||
|
| Property | Description | Type | Default |
|
||||||
|
| -------- | ----------- | ---- | ------- |
|
||||||
|
| position | specify the position of `Pagination` | 'top' \| 'bottom' \| 'both' | 'bottom' |
|
||||||
|
|
||||||
|
More about pagination, please check [`Pagination`](/components/pagination/).
|
||||||
|
|
||||||
### rowSelection
|
### rowSelection
|
||||||
|
|
||||||
Properties for row selection.
|
Properties for row selection.
|
||||||
|
@ -144,10 +156,11 @@ Properties for row selection.
|
||||||
| getCheckboxProps | Get Checkbox or Radio props | Function(record) | - |
|
| getCheckboxProps | Get Checkbox or Radio props | Function(record) | - |
|
||||||
| hideDefaultSelections | Remove the default `Select All` and `Select Invert` selections | boolean | `false` |
|
| hideDefaultSelections | Remove the default `Select All` and `Select Invert` selections | boolean | `false` |
|
||||||
| selectedRowKeys | Controlled selected row keys | string\[] | \[] |
|
| selectedRowKeys | Controlled selected row keys | string\[] | \[] |
|
||||||
|
| columnWidth | Set the width of the selection column | string\|number | - |
|
||||||
| selections | Custom selection [config](#rowSelection), only displays default selections when set to `true` | object\[]\|boolean | - |
|
| selections | Custom selection [config](#rowSelection), only displays default selections when set to `true` | object\[]\|boolean | - |
|
||||||
| type | `checkbox` or `radio` | `checkbox` \| `radio` | `checkbox` |
|
| type | `checkbox` or `radio` | `checkbox` \| `radio` | `checkbox` |
|
||||||
| onChange | Callback executed when selected rows change | Function(selectedRowKeys, selectedRows) | - |
|
| onChange | Callback executed when selected rows change | Function(selectedRowKeys, selectedRows) | - |
|
||||||
| onSelect | Callback executed when select/deselect one row | Function(record, selected, selectedRows) | - |
|
| onSelect | Callback executed when select/deselect one row | Function(record, selected, selectedRows, nativeEvent) | - |
|
||||||
| onSelectAll | Callback executed when select/deselect all rows | Function(selected, selectedRows, changeRows) | - |
|
| onSelectAll | Callback executed when select/deselect all rows | Function(selected, selectedRows, changeRows) | - |
|
||||||
| onSelectInvert | Callback executed when row selection is inverted | Function(selectedRows) | - |
|
| onSelectInvert | Callback executed when row selection is inverted | Function(selectedRows) | - |
|
||||||
|
|
||||||
|
|
|
@ -49,11 +49,11 @@ const columns = [{
|
||||||
| indentSize | 展示树形数据时,每层缩进的宽度,以 px 为单位 | number | 15 |
|
| indentSize | 展示树形数据时,每层缩进的宽度,以 px 为单位 | number | 15 |
|
||||||
| loading | 页面是否加载中 | boolean\|[object](https://vuecomponent.github.io/ant-design/#/cn/components/spin) | false |
|
| loading | 页面是否加载中 | boolean\|[object](https://vuecomponent.github.io/ant-design/#/cn/components/spin) | false |
|
||||||
| locale | 默认文案设置,目前包括排序、过滤、空数据文案 | object | filterConfirm: '确定' <br> filterReset: '重置' <br> emptyText: '暂无数据' |
|
| locale | 默认文案设置,目前包括排序、过滤、空数据文案 | object | filterConfirm: '确定' <br> filterReset: '重置' <br> emptyText: '暂无数据' |
|
||||||
| pagination | 分页器,配置项参考 [pagination](https://vuecomponent.github.io/ant-design/#/cn/components/pagination),设为 false 时不展示和进行分页 | object | |
|
| pagination | 分页器,参考[配置项](#pagination)或 [pagination](/components/pagination/),设为 false 时不展示和进行分页 | object | |
|
||||||
| rowClassName | 表格行的类名 | Function(record, index):string | - |
|
| rowClassName | 表格行的类名 | Function(record, index):string | - |
|
||||||
| rowKey | 表格行 key 的取值,可以是字符串或一个函数 | string\|Function(record):string | 'key' |
|
| rowKey | 表格行 key 的取值,可以是字符串或一个函数 | string\|Function(record):string | 'key' |
|
||||||
| rowSelection | 列表项是否可选择,[配置项](#rowSelection) | object | null |
|
| rowSelection | 列表项是否可选择,[配置项](#rowSelection) | object | null |
|
||||||
| scroll | 横向或纵向支持滚动,也可用于指定滚动区域的宽高度:`{{ x: true, y: 300 }}` | object | - |
|
| scroll | 设置横向或纵向滚动,也可用于指定滚动区域的宽和高,建议为 `x` 设置一个数字,如果要设置为 `true`,需要配合样式 `.ant-table td { white-space: nowrap; }` | { x: number \| true, y: number } | - |
|
||||||
| showHeader | 是否显示表头 | boolean | true |
|
| showHeader | 是否显示表头 | boolean | true |
|
||||||
| size | 正常或迷你类型,`default` or `small` | string | default |
|
| size | 正常或迷你类型,`default` or `small` | string | default |
|
||||||
| title | 表格标题 | Function(currentPageData)\|slot-scope | |
|
| title | 表格标题 | Function(currentPageData)\|slot-scope | |
|
||||||
|
@ -116,6 +116,7 @@ const columns = [{
|
||||||
| fixed | 列是否固定,可选 `true`(等效于 left) `'left'` `'right'` | boolean\|string | false |
|
| fixed | 列是否固定,可选 `true`(等效于 left) `'left'` `'right'` | boolean\|string | false |
|
||||||
| key | Vue 需要的 key,如果已经设置了唯一的 `dataIndex`,可以忽略这个属性 | string | - |
|
| key | Vue 需要的 key,如果已经设置了唯一的 `dataIndex`,可以忽略这个属性 | string | - |
|
||||||
| customRender | 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引,@return里面可以设置表格行/列合并,可参考demo 表格行/列合并 | Function(text, record, index) {}\|slot-scope | - |
|
| customRender | 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引,@return里面可以设置表格行/列合并,可参考demo 表格行/列合并 | Function(text, record, index) {}\|slot-scope | - |
|
||||||
|
| align | 设置列内容的对齐方式 | 'left' \| 'right' \| 'center' | 'left' |
|
||||||
| sorter | 排序函数,本地排序使用一个函数(参考 [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) 的 compareFunction),需要服务端排序可设为 true | Function\|boolean | - |
|
| sorter | 排序函数,本地排序使用一个函数(参考 [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) 的 compareFunction),需要服务端排序可设为 true | Function\|boolean | - |
|
||||||
| sortOrder | 排序的受控属性,外界可用此控制列的排序,可设置为 `'ascend'` `'descend'` `false` | boolean\|string | - |
|
| sortOrder | 排序的受控属性,外界可用此控制列的排序,可设置为 `'ascend'` `'descend'` `false` | boolean\|string | - |
|
||||||
| title | 列头显示文字 | string\|slot | - |
|
| title | 列头显示文字 | string\|slot | - |
|
||||||
|
@ -134,6 +135,16 @@ const columns = [{
|
||||||
| title | 列头显示文字 | string\|slot | - |
|
| title | 列头显示文字 | string\|slot | - |
|
||||||
| slots | 使用columns时,可以通过该属性配置支持slot的属性,如 `slots: { title: 'XXX'}` | object | - |
|
| slots | 使用columns时,可以通过该属性配置支持slot的属性,如 `slots: { title: 'XXX'}` | object | - |
|
||||||
|
|
||||||
|
### pagination
|
||||||
|
|
||||||
|
分页的配置项。
|
||||||
|
|
||||||
|
| 参数 | 说明 | 类型 | 默认值 |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| position | 指定分页显示的位置 | 'top' \| 'bottom' \| 'both' | 'bottom' |
|
||||||
|
|
||||||
|
更多配置项,请查看 [`Pagination`](/components/pagination/)。
|
||||||
|
|
||||||
### rowSelection
|
### rowSelection
|
||||||
|
|
||||||
选择功能的配置。
|
选择功能的配置。
|
||||||
|
@ -144,10 +155,11 @@ const columns = [{
|
||||||
| getCheckboxProps | 选择框的默认属性配置 | Function(record) | - |
|
| getCheckboxProps | 选择框的默认属性配置 | Function(record) | - |
|
||||||
| hideDefaultSelections | 去掉『全选』『反选』两个默认选项 | boolean | false |
|
| hideDefaultSelections | 去掉『全选』『反选』两个默认选项 | boolean | false |
|
||||||
| selectedRowKeys | 指定选中项的 key 数组,需要和 onChange 进行配合 | string\[] | \[] |
|
| selectedRowKeys | 指定选中项的 key 数组,需要和 onChange 进行配合 | string\[] | \[] |
|
||||||
|
| columnWidth | 自定义列表选择框宽度 | string\|number | - |
|
||||||
| selections | 自定义选择项, 设为 `true` 时使用默认选择项 | object\[]\|boolean | true |
|
| selections | 自定义选择项, 设为 `true` 时使用默认选择项 | object\[]\|boolean | true |
|
||||||
| type | 多选/单选,`checkbox` or `radio` | string | `checkbox` |
|
| type | 多选/单选,`checkbox` or `radio` | string | `checkbox` |
|
||||||
| onChange | 选中项发生变化的时的回调 | Function(selectedRowKeys, selectedRows) | - |
|
| onChange | 选中项发生变化的时的回调 | Function(selectedRowKeys, selectedRows) | - |
|
||||||
| onSelect | 用户手动选择/取消选择某列的回调 | Function(record, selected, selectedRows) | - |
|
| onSelect | 用户手动选择/取消选择某列的回调 | Function(record, selected, selectedRows, nativeEvent) | - |
|
||||||
| onSelectAll | 用户手动选择/取消选择所有列的回调 | Function(selected, selectedRows, changeRows) | - |
|
| onSelectAll | 用户手动选择/取消选择所有列的回调 | Function(selected, selectedRows, changeRows) | - |
|
||||||
| onSelectInvert | 用户手动选择反选的回调 | Function(selectedRows) | - |
|
| onSelectInvert | 用户手动选择反选的回调 | Function(selectedRows) | - |
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ export const ColumnProps = {
|
||||||
customRender: PropTypes.func,
|
customRender: PropTypes.func,
|
||||||
customCell: PropTypes.func,
|
customCell: PropTypes.func,
|
||||||
customHeaderCell: PropTypes.func,
|
customHeaderCell: PropTypes.func,
|
||||||
|
align: PropTypes.oneOf(['left', 'right', 'center']),
|
||||||
filters: PropTypes.arrayOf(ColumnFilterItem),
|
filters: PropTypes.arrayOf(ColumnFilterItem),
|
||||||
// onFilter: (value: any, record: T) => PropTypes.bool,
|
// onFilter: (value: any, record: T) => PropTypes.bool,
|
||||||
filterMultiple: PropTypes.bool,
|
filterMultiple: PropTypes.bool,
|
||||||
|
@ -78,13 +79,20 @@ export const TableRowSelection = {
|
||||||
selections: PropTypes.oneOfType([PropTypes.array, PropTypes.bool]),
|
selections: PropTypes.oneOfType([PropTypes.array, PropTypes.bool]),
|
||||||
hideDefaultSelections: PropTypes.bool,
|
hideDefaultSelections: PropTypes.bool,
|
||||||
fixed: PropTypes.bool,
|
fixed: PropTypes.bool,
|
||||||
|
columnWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TableProps = {
|
export const TableProps = {
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
dropdownPrefixCls: PropTypes.string,
|
dropdownPrefixCls: PropTypes.string,
|
||||||
rowSelection: PropTypes.oneOfType([PropTypes.shape(TableRowSelection).loose, null]),
|
rowSelection: PropTypes.oneOfType([PropTypes.shape(TableRowSelection).loose, null]),
|
||||||
pagination: PropTypes.oneOfType([PropTypes.shape(PaginationProps).loose, PropTypes.bool]),
|
pagination: PropTypes.oneOfType([
|
||||||
|
PropTypes.shape({
|
||||||
|
...PaginationProps,
|
||||||
|
position: PropTypes.oneOf(['top', 'bottom', 'both']),
|
||||||
|
}).loose,
|
||||||
|
PropTypes.bool,
|
||||||
|
]),
|
||||||
size: PropTypes.oneOf(['default', 'middle', 'small', 'large']),
|
size: PropTypes.oneOf(['default', 'middle', 'small', 'large']),
|
||||||
dataSource: PropTypes.array,
|
dataSource: PropTypes.array,
|
||||||
components: PropTypes.object,
|
components: PropTypes.object,
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
.@{table-prefix-cls} {
|
.@{table-prefix-cls} {
|
||||||
.reset-component;
|
.reset-component;
|
||||||
position: relative;
|
position: relative;
|
||||||
border-radius: @border-radius-base @border-radius-base 0 0;
|
clear: both;
|
||||||
|
|
||||||
&-body {
|
&-body {
|
||||||
transition: opacity .3s;
|
transition: opacity .3s;
|
||||||
|
@ -69,6 +69,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-thead > tr:first-child > th {
|
||||||
|
&:first-child {
|
||||||
|
border-top-left-radius: @border-radius-base;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-top-right-radius: @border-radius-base;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&-tbody > tr > td {
|
&-tbody > tr > td {
|
||||||
border-bottom: @border-width-base @border-style-base @border-color-split;
|
border-bottom: @border-width-base @border-style-base @border-color-split;
|
||||||
transition: all .3s;
|
transition: all .3s;
|
||||||
|
@ -129,7 +139,8 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
.@{table-prefix-cls}-bordered & {
|
.@{table-prefix-cls}-bordered & {
|
||||||
&,
|
&,
|
||||||
table {
|
table,
|
||||||
|
.@{table-prefix-cls}-thead > tr:first-child > th {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -247,11 +258,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&-up:after {
|
&-up:after {
|
||||||
bottom: -2px;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-down:after {
|
&-down:after {
|
||||||
top: 2px;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.@{iconfont-css-prefix}-caret-up,
|
.@{iconfont-css-prefix}-caret-up,
|
||||||
|
@ -260,6 +271,15 @@
|
||||||
line-height: 4px;
|
line-height: 4px;
|
||||||
height: 4px;
|
height: 4px;
|
||||||
transition: all .3s;
|
transition: all .3s;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-down {
|
||||||
|
margin-top: 1.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{iconfont-css-prefix}-caret-down {
|
||||||
|
top: -1.5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,7 +487,7 @@
|
||||||
tr&-expanded-row {
|
tr&-expanded-row {
|
||||||
&,
|
&,
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #fbfbfb;
|
background: @table-expanded-row-bg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,7 +499,6 @@
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
table {
|
table {
|
||||||
width: auto;
|
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -539,6 +558,9 @@
|
||||||
table {
|
table {
|
||||||
border-radius: @border-radius-base 0 0 0;
|
border-radius: @border-radius-base 0 0 0;
|
||||||
}
|
}
|
||||||
|
.ant-table-thead > tr > th:last-child {
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-fixed-right {
|
&-fixed-right {
|
||||||
|
@ -554,6 +576,9 @@
|
||||||
color: transparent;
|
color: transparent;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
.ant-table-thead > tr > th:first-child {
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&&-scroll-position-left &-fixed-left {
|
&&-scroll-position-left &-fixed-left {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
| getPopupContainer | to set the container of the floating layer, while the default is to create a div element in body | function(trigger) | - |
|
| getPopupContainer | to set the container of the floating layer, while the default is to create a div element in body | function(trigger) | - |
|
||||||
| hideDisabledOptions | hide the options that can not be selected | boolean | false |
|
| hideDisabledOptions | hide the options that can not be selected | boolean | false |
|
||||||
| hourStep | interval between hours in picker | number | 1 |
|
| hourStep | interval between hours in picker | number | 1 |
|
||||||
|
| inputReadOnly | Set the `readonly` attribute of the input tag (avoids virtual keyboard on touch devices) | boolean | false |
|
||||||
| minuteStep | interval between minutes in picker | number | 1 |
|
| minuteStep | interval between minutes in picker | number | 1 |
|
||||||
| open(.sync) | whether to popup panel | boolean | false |
|
| open(.sync) | whether to popup panel | boolean | false |
|
||||||
| placeholder | display when there's no value | string | "Select a time" |
|
| placeholder | display when there's no value | string | "Select a time" |
|
||||||
|
|
|
@ -5,6 +5,7 @@ import LocaleReceiver from '../locale-provider/LocaleReceiver'
|
||||||
import defaultLocale from './locale/en_US'
|
import defaultLocale from './locale/en_US'
|
||||||
import BaseMixin from '../_util/BaseMixin'
|
import BaseMixin from '../_util/BaseMixin'
|
||||||
import PropTypes from '../_util/vue-types'
|
import PropTypes from '../_util/vue-types'
|
||||||
|
import interopDefault from '../_util/interopDefault'
|
||||||
import { initDefaultProps, hasProp, getOptionProps, getComponentFromProp } from '../_util/props-util'
|
import { initDefaultProps, hasProp, getOptionProps, getComponentFromProp } from '../_util/props-util'
|
||||||
|
|
||||||
export function generateShowHourMinuteSecond (format) {
|
export function generateShowHourMinuteSecond (format) {
|
||||||
|
@ -47,6 +48,7 @@ export const TimePickerProps = () => ({
|
||||||
minuteStep: PropTypes.number,
|
minuteStep: PropTypes.number,
|
||||||
secondStep: PropTypes.number,
|
secondStep: PropTypes.number,
|
||||||
allowEmpty: PropTypes.bool,
|
allowEmpty: PropTypes.bool,
|
||||||
|
inputReadOnly: PropTypes.bool,
|
||||||
clearText: PropTypes.string,
|
clearText: PropTypes.string,
|
||||||
defaultOpenValue: PropTypes.object,
|
defaultOpenValue: PropTypes.object,
|
||||||
popupClassName: PropTypes.string,
|
popupClassName: PropTypes.string,
|
||||||
|
@ -77,7 +79,7 @@ export default {
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
const value = this.value || this.defaultValue
|
const value = this.value || this.defaultValue
|
||||||
if (value && !moment.isMoment(value)) {
|
if (value && !interopDefault(moment).isMoment(value)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'The value/defaultValue of TimePicker must be a moment object, ',
|
'The value/defaultValue of TimePicker must be a moment object, ',
|
||||||
)
|
)
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
| getPopupContainer | 定义浮层的容器,默认为 body 上新建 div | function(trigger) | 无 |
|
| getPopupContainer | 定义浮层的容器,默认为 body 上新建 div | function(trigger) | 无 |
|
||||||
| hideDisabledOptions | 隐藏禁止选择的选项 | boolean | false |
|
| hideDisabledOptions | 隐藏禁止选择的选项 | boolean | false |
|
||||||
| hourStep | 小时选项间隔 | number | 1 |
|
| hourStep | 小时选项间隔 | number | 1 |
|
||||||
|
| inputReadOnly | 设置输入框为只读(避免在移动设备上打开虚拟键盘)| boolean | false |
|
||||||
| minuteStep | 分钟选项间隔 | number | 1 |
|
| minuteStep | 分钟选项间隔 | number | 1 |
|
||||||
| open(.sync) | 面板是否打开 | boolean | false |
|
| open(.sync) | 面板是否打开 | boolean | false |
|
||||||
| placeholder | 没有值的时候显示的内容 | string | "请选择时间" |
|
| placeholder | 没有值的时候显示的内容 | string | "请选择时间" |
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
const locale = {
|
||||||
|
placeholder: 'Izberite čas',
|
||||||
|
}
|
||||||
|
|
||||||
|
export default locale
|
|
@ -7,9 +7,9 @@ import Icon from '../icon'
|
||||||
|
|
||||||
export const TimelineProps = {
|
export const TimelineProps = {
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
className: PropTypes.string,
|
|
||||||
/** 指定最后一个幽灵节点是否存在或内容 */
|
/** 指定最后一个幽灵节点是否存在或内容 */
|
||||||
pending: PropTypes.any,
|
pending: PropTypes.any,
|
||||||
|
pendingDot: PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -19,6 +19,7 @@ export default {
|
||||||
}),
|
}),
|
||||||
render () {
|
render () {
|
||||||
const { prefixCls, ...restProps } = getOptionProps(this)
|
const { prefixCls, ...restProps } = getOptionProps(this)
|
||||||
|
const pendingDot = getComponentFromProp(this, 'pendingDot')
|
||||||
const pending = getComponentFromProp(this, 'pending')
|
const pending = getComponentFromProp(this, 'pending')
|
||||||
const pendingNode = typeof pending === 'boolean' ? null : pending
|
const pendingNode = typeof pending === 'boolean' ? null : pending
|
||||||
const classString = classNames(prefixCls, {
|
const classString = classNames(prefixCls, {
|
||||||
|
@ -37,6 +38,9 @@ export default {
|
||||||
<TimelineItem
|
<TimelineItem
|
||||||
pending={!!pending}
|
pending={!!pending}
|
||||||
>
|
>
|
||||||
|
<template slot='dot'>
|
||||||
|
{pendingDot || <Icon type='loading' />}
|
||||||
|
</template>
|
||||||
<Icon slot='dot' type='loading' />
|
<Icon slot='dot' type='loading' />
|
||||||
{pendingNode}
|
{pendingNode}
|
||||||
</TimelineItem>
|
</TimelineItem>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<cn>
|
<cn>
|
||||||
#### 最后一个
|
#### 最后一个
|
||||||
当任务状态正在发生,还在记录过程中,可用幽灵节点来表示当前的时间节点。(用于时间正序排列)
|
当任务状态正在发生,还在记录过程中,可用幽灵节点来表示当前的时间节点(用于时间正序排列)。当 pending 值为 false ,可用定制元件替换默认时间图点。
|
||||||
</cn>
|
</cn>
|
||||||
|
|
||||||
<us>
|
<us>
|
||||||
#### Last node
|
#### Last node
|
||||||
When the timeline is incomplete and ongoing, put a ghost node at last. set `pending={true}` or `pending={a React Element}`. Used in ascend chronological order.
|
When the timeline is incomplete and ongoing, put a ghost node at last. set `pending={true}` or `pending={a VNode Element}` or `slot="pending"`. Used in ascend chronological order. When `pending` is not false, set `pendingDot={a VNode Element}` or `slot="pendingDot"` to replace the default pending dot.
|
||||||
</us>
|
</us>
|
||||||
|
|
||||||
```html
|
```html
|
||||||
|
|
|
@ -16,6 +16,7 @@ Timeline
|
||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default |
|
||||||
| -------- | ----------- | ---- | ------- |
|
| -------- | ----------- | ---- | ------- |
|
||||||
| pending | Set the last ghost node's existence or its content | boolean\|string\|slot | `false` |
|
| pending | Set the last ghost node's existence or its content | boolean\|string\|slot | `false` |
|
||||||
|
| pendingDot | Set the dot of the last ghost node when pending is true | \|string\|slot | `<Icon type="loading" />` |
|
||||||
|
|
||||||
### Timeline.Item
|
### Timeline.Item
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| pending | 指定最后一个幽灵节点是否存在或内容 | boolean\|string\|slot | false |
|
| pending | 指定最后一个幽灵节点是否存在或内容 | boolean\|string\|slot | false |
|
||||||
|
| pendingDot | 当最后一个幽灵节点存在時,指定其时间图点 | \|string\|slot | `<Icon type="loading" />` |
|
||||||
|
|
||||||
### Timeline.Item
|
### Timeline.Item
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
border: 0;
|
border: 0;
|
||||||
height: auto;
|
height: auto;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
padding: 3px 0;
|
padding: 3px 1px;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
top: 5px;
|
top: 5px;
|
||||||
left: 5px;
|
left: 5px;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import PropTypes from '../_util/vue-types'
|
import PropTypes from '../_util/vue-types'
|
||||||
const triggerType = PropTypes.oneOf(['hover', 'focus', 'click'])
|
const triggerType = PropTypes.oneOf(['hover', 'focus', 'click', 'contextmenu'])
|
||||||
export default () => ({
|
export default () => ({
|
||||||
trigger: PropTypes.oneOfType([triggerType, PropTypes.arrayOf(triggerType)]).def('hover'),
|
trigger: PropTypes.oneOfType([triggerType, PropTypes.arrayOf(triggerType)]).def('hover'),
|
||||||
visible: PropTypes.bool,
|
visible: PropTypes.bool,
|
||||||
|
|
|
@ -19,7 +19,7 @@ The following APIs are shared by Tooltip, Popconfirm, Popover.
|
||||||
| overlayClassName | Class name of the tooltip card | string | - |
|
| overlayClassName | Class name of the tooltip card | string | - |
|
||||||
| overlayStyle | Style of the tooltip card | object | - |
|
| overlayStyle | Style of the tooltip card | object | - |
|
||||||
| placement | The position of the tooltip relative to the target, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | `top` |
|
| placement | The position of the tooltip relative to the target, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | `top` |
|
||||||
| trigger | Tooltip trigger mode | `hover` \| `focus` \| `click` | `hover` |
|
| trigger | Tooltip trigger mode | `hover` \| `focus` \| `click` \| `contextmenu` | `hover` |
|
||||||
| visible | Whether the floating tooltip card is visible or not | boolean | `false` |
|
| visible | Whether the floating tooltip card is visible or not | boolean | `false` |
|
||||||
|
|
||||||
### events
|
### events
|
||||||
|
|
|
@ -19,9 +19,8 @@
|
||||||
| overlayClassName | 卡片类名 | string | 无 |
|
| overlayClassName | 卡片类名 | string | 无 |
|
||||||
| overlayStyle | 卡片样式 | object | 无 |
|
| overlayStyle | 卡片样式 | object | 无 |
|
||||||
| placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top |
|
| placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top |
|
||||||
| trigger | 触发行为,可选 `hover/focus/click` | string | hover |
|
| trigger | 触发行为,可选 `hover/focus/click/contextmenu` | string | hover |
|
||||||
| visible | 用于手动控制浮层显隐 | boolean | false |
|
| visible | 用于手动控制浮层显隐 | boolean | false |
|
||||||
| onVisibleChange | 显示隐藏的回调 | (visible) => void | 无 |
|
|
||||||
|
|
||||||
### 事件
|
### 事件
|
||||||
| 事件名称 | 说明 | 回调参数 |
|
| 事件名称 | 说明 | 回调参数 |
|
||||||
|
|
|
@ -53,9 +53,11 @@ export default {
|
||||||
`not have usTitle`,
|
`not have usTitle`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
const id = ['components', name.replace('-cn', ''), 'demo', ...usTitle.split(' ')].join('-').toLowerCase()
|
let id = ['components', name.replace('-cn', ''), 'demo', ...usTitle.split(' ')].join('-').toLowerCase()
|
||||||
|
|
||||||
if (this._store.store) {
|
if (this._store.store) {
|
||||||
const { currentSubMenu } = this._store.store.getState()
|
const { currentSubMenu } = this._store.store.getState()
|
||||||
|
id = `${id}-${currentSubMenu.length + 1}`
|
||||||
this._store.store.setState({ currentSubMenu: [...currentSubMenu, { cnTitle, usTitle, id }] })
|
this._store.store.setState({ currentSubMenu: [...currentSubMenu, { cnTitle, usTitle, id }] })
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue