parent
e29ad47995
commit
ba971c4f2c
|
@ -1,4 +1,4 @@
|
||||||
import { provide, inject, defineComponent, App, Plugin } from 'vue';
|
import { provide, inject, defineComponent, App, Plugin, ExtractPropTypes } from 'vue';
|
||||||
import omit from 'omit.js';
|
import omit from 'omit.js';
|
||||||
import PropTypes, { withUndefined } from '../_util/vue-types';
|
import PropTypes, { withUndefined } from '../_util/vue-types';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
|
@ -33,6 +33,8 @@ export const ListGridType = {
|
||||||
|
|
||||||
export const ListSize = tuple('small', 'default', 'large');
|
export const ListSize = tuple('small', 'default', 'large');
|
||||||
|
|
||||||
|
const paginationProps = PaginationConfig();
|
||||||
|
|
||||||
export const ListProps = () => ({
|
export const ListProps = () => ({
|
||||||
bordered: PropTypes.looseBool,
|
bordered: PropTypes.looseBool,
|
||||||
dataSource: PropTypes.array,
|
dataSource: PropTypes.array,
|
||||||
|
@ -42,7 +44,10 @@ export const ListProps = () => ({
|
||||||
loading: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
|
loading: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
|
||||||
loadMore: PropTypes.any,
|
loadMore: PropTypes.any,
|
||||||
pagination: withUndefined(
|
pagination: withUndefined(
|
||||||
PropTypes.oneOfType([PropTypes.shape(PaginationConfig()).loose, PropTypes.looseBool]),
|
PropTypes.oneOfType([
|
||||||
|
PropTypes.shape<Partial<ExtractPropTypes<typeof paginationProps>>>(paginationProps).loose,
|
||||||
|
PropTypes.looseBool,
|
||||||
|
]),
|
||||||
),
|
),
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
rowKey: PropTypes.any,
|
rowKey: PropTypes.any,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ExtractPropTypes, PropType } from 'vue';
|
import { ExtractPropTypes, PropType } from 'vue';
|
||||||
import PropTypes, { withUndefined } from '../_util/vue-types';
|
import PropTypes, { withUndefined } from '../_util/vue-types';
|
||||||
import { PaginationProps as getPaginationProps } from '../pagination';
|
import { PaginationProps as getPaginationProps, PaginationConfig } from '../pagination';
|
||||||
import { SpinProps as getSpinProps } from '../spin';
|
import { SpinProps as getSpinProps } from '../spin';
|
||||||
import { Store } from './createStore';
|
import { Store } from './createStore';
|
||||||
import { tuple } from '../_util/type';
|
import { tuple } from '../_util/type';
|
||||||
|
@ -103,16 +103,15 @@ export const tableRowSelection = {
|
||||||
|
|
||||||
export type SortOrder = 'descend' | 'ascend';
|
export type SortOrder = 'descend' | 'ascend';
|
||||||
|
|
||||||
|
const paginationProps = PaginationConfig();
|
||||||
|
|
||||||
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, Object]),
|
rowSelection: PropTypes.oneOfType([PropTypes.shape(tableRowSelection).loose, Object]),
|
||||||
pagination: withUndefined(
|
pagination: withUndefined(
|
||||||
PropTypes.oneOfType([
|
PropTypes.oneOfType([
|
||||||
PropTypes.shape({
|
PropTypes.shape<Partial<ExtractPropTypes<typeof paginationProps>>>(paginationProps).loose,
|
||||||
...PaginationProps,
|
|
||||||
position: PropTypes.oneOf(tuple('top', 'bottom', 'both')),
|
|
||||||
}).loose,
|
|
||||||
PropTypes.looseBool,
|
PropTypes.looseBool,
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue