Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/anchor/Anchor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import addEventListener from '../_util/Dom/addEventListener'
import Affix from '../affix'
import getScroll from '../_util/getScroll'
import getRequestAnimationFrame from '../_util/getRequestAnimationFrame'
import { initDefaultProps, getClass, getStyle } from '../_util/props-util'
import { initDefaultProps, getClass } from '../_util/props-util'
import BaseMixin from '../_util/BaseMixin'

function getDefaultContainer () {
Expand Down
1 change: 0 additions & 1 deletion components/form/demo/advanced-search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Because the width of label is not fixed, you may need to adjust it by customizin

<script>
import { Form } from 'vue-antd-ui'
import { setTimeout } from 'timers'

const AdvancedSearchForm = {
data () {
Expand Down
1 change: 0 additions & 1 deletion components/list/__tests__/loading.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { mount } from '@vue/test-utils'
import { asyncExpect } from '@/tests/utils'
import List from '..'
import Icon from '../../icon'

Expand Down
1 change: 0 additions & 1 deletion components/list/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import PropTypes from '../_util/vue-types'
import classNames from 'classnames'
import omit from 'omit.js'
import { SpinProps } from '../spin'
import LocaleReceiver from '../locale-provider/LocaleReceiver'
import defaultLocale from '../locale-provider/default'

Expand Down
6 changes: 3 additions & 3 deletions components/menu/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Menu', () => {
// })

it('should accept defaultOpenKeys in mode horizontal', async () => {
const wrapper = mount({
mount({
render () {
return (
<Menu defaultOpenKeys={['1']} mode='horizontal'>
Expand All @@ -37,7 +37,7 @@ describe('Menu', () => {
})

it('should accept defaultOpenKeys in mode inline', async () => {
const wrapper = mount({
mount({
render () {
return (
<Menu defaultOpenKeys={['1']} mode='inline'>
Expand All @@ -56,7 +56,7 @@ describe('Menu', () => {
})

it('should accept defaultOpenKeys in mode vertical', async () => {
const wrapper = mount({
mount({
render () {
return (
<Menu defaultOpenKeys={['1']} mode='vertical'>
Expand Down
1 change: 0 additions & 1 deletion components/spin/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { mount } from '@vue/test-utils'
import { asyncExpect } from '@/tests/utils'
import Spin from '..'

describe('Spin', () => {
Expand Down
1 change: 0 additions & 1 deletion components/tabs/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { mount } from '@vue/test-utils'
import { asyncExpect } from '@/tests/utils'
import Tabs from '..'

const { TabPane } = Tabs
Expand Down
1 change: 0 additions & 1 deletion components/tag/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { mount } from '@vue/test-utils'
import { asyncExpect } from '@/tests/utils'
import Tag from '..'

describe('Tag', () => {
Expand Down
1 change: 0 additions & 1 deletion components/time-picker/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { mount } from '@vue/test-utils'
import { asyncExpect } from '@/tests/utils'
import VcTimePicker from '../../vc-time-picker/TimePicker'
import TimePicker from '..'
import focusTest from '../../../tests/shared/focusTest'
Expand Down
2 changes: 1 addition & 1 deletion components/tooltip/__tests__/tooltip.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { asyncExpect } from '@/tests/utils'
import { mount } from '@vue/test-utils'
import Tooltip from '..'
import Button from '../../button'
// import Button from '../../button'

describe('Tooltip', () => {
it('check `onVisibleChange` arguments', async () => {
Expand Down
1 change: 0 additions & 1 deletion components/vc-slick/src/arrows.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import classnames from 'classnames'
import { cloneElement } from '../../_util/vnode'
import { canGoNext } from './utils/innerSliderUtils'

Expand Down
100 changes: 50 additions & 50 deletions components/vc-tree-select/src/PropTypes.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
import PropTypes from '../../_util/vue-types'
import { SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from './strategies'

function nonEmptyStringType (props, propsName) {
const value = props[propsName]
if (typeof value !== 'string' || !value) {
return new Error() // Just a flag, so don't need message.
}
}
// function nonEmptyStringType (props, propsName) {
// const value = props[propsName]
// if (typeof value !== 'string' || !value) {
// return new Error() // Just a flag, so don't need message.
// }
// }

function valueType (props, propName, componentName) {
const labelInValueShape = PropTypes.shape({
value: nonEmptyStringType,
label: PropTypes.node,
})
if (props.labelInValue) {
const validate = PropTypes.oneOfType([
PropTypes.arrayOf(labelInValueShape),
labelInValueShape,
])
const error = validate(...arguments)
if (error) {
return new Error(
`Invalid prop \`${propName}\` supplied to \`${componentName}\`, ` +
`when \`labelInValue\` is \`true\`, \`${propName}\` should in ` +
`shape of \`{ value: string, label?: string }\`.`
)
}
} else if (props.treeCheckable && props.treeCheckStrictly) {
const validate = PropTypes.oneOfType([
PropTypes.arrayOf(labelInValueShape),
labelInValueShape,
])
const error = validate(...arguments)
if (error) {
return new Error(
`Invalid prop \`${propName}\` supplied to \`${componentName}\`, ` +
`when \`treeCheckable\` and \`treeCheckStrictly\` are \`true\`, ` +
`\`${propName}\` should in shape of \`{ value: string, label?: string }\`.`
)
}
} else if (props.multiple && props[propName] === '') {
return new Error(
`Invalid prop \`${propName}\` of type \`string\` supplied to \`${componentName}\`, ` +
`expected \`array\` when \`multiple\` is \`true\`.`
)
} else {
const validate = PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.string),
PropTypes.string,
])
return validate(...arguments)
}
}
// function valueType (props, propName, componentName) {
// const labelInValueShape = PropTypes.shape({
// value: nonEmptyStringType,
// label: PropTypes.node,
// })
// if (props.labelInValue) {
// const validate = PropTypes.oneOfType([
// PropTypes.arrayOf(labelInValueShape),
// labelInValueShape,
// ])
// const error = validate(...arguments)
// if (error) {
// return new Error(
// `Invalid prop \`${propName}\` supplied to \`${componentName}\`, ` +
// `when \`labelInValue\` is \`true\`, \`${propName}\` should in ` +
// `shape of \`{ value: string, label?: string }\`.`
// )
// }
// } else if (props.treeCheckable && props.treeCheckStrictly) {
// const validate = PropTypes.oneOfType([
// PropTypes.arrayOf(labelInValueShape),
// labelInValueShape,
// ])
// const error = validate(...arguments)
// if (error) {
// return new Error(
// `Invalid prop \`${propName}\` supplied to \`${componentName}\`, ` +
// `when \`treeCheckable\` and \`treeCheckStrictly\` are \`true\`, ` +
// `\`${propName}\` should in shape of \`{ value: string, label?: string }\`.`
// )
// }
// } else if (props.multiple && props[propName] === '') {
// return new Error(
// `Invalid prop \`${propName}\` of type \`string\` supplied to \`${componentName}\`, ` +
// `expected \`array\` when \`multiple\` is \`true\`.`
// )
// } else {
// const validate = PropTypes.oneOfType([
// PropTypes.arrayOf(PropTypes.string),
// PropTypes.string,
// ])
// return validate(...arguments)
// }
// }

export const SelectPropTypes = {
// className: PropTypes.string,
Expand Down
4 changes: 2 additions & 2 deletions components/vc-tree-select/src/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import { initDefaultProps, getOptionProps, hasProp, getAllProps, getComponentFro
import BaseMixin from '../../_util/BaseMixin'
import getTransitionProps from '../../_util/getTransitionProps'

function noop () {
}
// function noop () {
// }

function filterFn (input, child) {
return String(getPropValue(child, labelCompatible(this.$props.treeNodeFilterProp)))
Expand Down
8 changes: 4 additions & 4 deletions components/vc-tree-select/src/SelectTrigger.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from '../../_util/vue-types'
import classnames from 'classnames'
import omit from 'omit.js'
// import omit from 'omit.js'
import Trigger from '../../trigger'
import Tree, { TreeNode } from '../../vc-tree'
import { SelectPropTypes } from './PropTypes'
Expand All @@ -10,12 +10,12 @@ import {
flatToHierarchy,
getValuePropValue,
labelCompatible,
saveRef,
// saveRef,
} from './util'

import { cloneElement } from '../../_util/vnode'
import { isEmptyElement, getSlotOptions, getKey, getAllProps, getComponentFromProp } from '../../_util/props-util'
import { noop } from '../../_util/vue-types/utils'
import { getSlotOptions, getKey, getAllProps, getComponentFromProp } from '../../_util/props-util'
// import { noop } from '../../_util/vue-types/utils'

const BUILT_IN_PLACEMENTS = {
bottomLeft: {
Expand Down
2 changes: 1 addition & 1 deletion components/vc-tree-select/src/util.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getPropsData, getAllProps, getKey, getAttrs, getSlotOptions, filterEmpty, getSlots } from '../../_util/props-util'
import { getPropsData, getAllProps, getKey, getAttrs, getSlotOptions, getSlots } from '../../_util/props-util'
import { cloneVNodes, cloneElement } from '../../_util/vnode'
export function toTitle (title) {
if (typeof title === 'string') {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"es"
],
"scripts": {
"dev": "NODE_ENV=development ENTRY_INDEX=dev ./node_modules/.bin/webpack-dev-server --open --hot --port 3001",
"start": "NODE_ENV=development ./node_modules/.bin/webpack-dev-server --open --hot",
"dev": "cross-env NODE_ENV=development ENTRY_INDEX=dev ./node_modules/.bin/webpack-dev-server --open --hot --port 3001",
"start": "cross-env NODE_ENV=development ./node_modules/.bin/webpack-dev-server --open --hot",
"test": "jest --config .jest.js",
"site": "node scripts/run.js site-dist",
"copy": "node scripts/run.js copy-html",
Expand Down