style: format

pull/4671/head
tangjinzhou 3 years ago
parent 16f8d43a1a
commit cc86cbf7bc

@ -231,7 +231,7 @@ export default defineComponent({
return () => { return () => {
const subMenuPrefixClsValue = subMenuPrefixCls.value; const subMenuPrefixClsValue = subMenuPrefixCls.value;
let baseTitleNode = () => { const baseTitleNode = () => {
const icon = getPropsSlot(slots, props, 'icon'); const icon = getPropsSlot(slots, props, 'icon');
const expandIcon = props.expandIcon || slots.expandIcon || menuExpandIcon.value; const expandIcon = props.expandIcon || slots.expandIcon || menuExpandIcon.value;
const title = renderTitle(getPropsSlot(slots, props, 'title'), icon); const title = renderTitle(getPropsSlot(slots, props, 'title'), icon);

@ -58,13 +58,11 @@ export interface MenuContextProps {
// // Motion // // Motion
motion?: ComputedRef<CSSMotionProps | null>; motion?: ComputedRef<CSSMotionProps | null>;
defaultMotions?: ComputedRef<Partial< defaultMotions?: ComputedRef<Partial<{
{ [key in MenuMode | 'other']:
[key in MenuMode | 'other']: | CSSMotionProps
| CSSMotionProps | ((style: Ref<CSSProperties>, className: Ref<string>) => CSSMotionProps);
| ((style: Ref<CSSProperties>, className: Ref<string>) => CSSMotionProps); }> | null>;
}
> | null>;
// // Popup // // Popup
subMenuOpenDelay: ComputedRef<number>; subMenuOpenDelay: ComputedRef<number>;

@ -3,7 +3,7 @@ import type { ModalFuncProps } from './Modal';
import Dialog from './Modal'; import Dialog from './Modal';
import ActionButton from './ActionButton'; import ActionButton from './ActionButton';
import { getConfirmLocale } from './locale'; import { getConfirmLocale } from './locale';
import { FunctionalComponent } from 'vue'; import type { FunctionalComponent } from 'vue';
interface ConfirmDialogProps extends ModalFuncProps { interface ConfirmDialogProps extends ModalFuncProps {
afterClose?: () => void; afterClose?: () => void;

@ -132,10 +132,13 @@ export const tableProps = () => {
type: Number as PropType<TableProps['expandColumnWidth']>, type: Number as PropType<TableProps['expandColumnWidth']>,
default: undefined, default: undefined,
}, },
expandedRowKeys: { type: Array as PropType<TableProps['expandedRowKeys']>, default: undefined }, expandedRowKeys: {
type: Array as PropType<TableProps['expandedRowKeys']>,
default: undefined as TableProps['expandedRowKeys'],
},
defaultExpandedRowKeys: { defaultExpandedRowKeys: {
type: Array as PropType<TableProps['defaultExpandedRowKeys']>, type: Array as PropType<TableProps['defaultExpandedRowKeys']>,
default: undefined, default: undefined as TableProps['defaultExpandedRowKeys'],
}, },
expandedRowRender: { expandedRowRender: {
type: Function as PropType<TableProps['expandedRowRender']>, type: Function as PropType<TableProps['expandedRowRender']>,
@ -605,6 +608,8 @@ const InteralTable = defineComponent<
<RcTable <RcTable
{...attrs} {...attrs}
{...tableProps} {...tableProps}
expandedRowKeys={props.expandedRowKeys as any}
defaultExpandedRowKeys={props.defaultExpandedRowKeys as any}
expandIconColumnIndex={expandIconColumnIndex.value} expandIconColumnIndex={expandIconColumnIndex.value}
indentSize={indentSize.value} indentSize={indentSize.value}
expandIcon={expandIcon} expandIcon={expandIcon}
@ -649,7 +654,7 @@ const Table = defineComponent<TableProps>({
table, table,
}); });
return () => { return () => {
const columns = (attrs.columns || convertChildrenToColumns(slots.default?.())) as ColumnsType; const columns = attrs.columns || convertChildrenToColumns(slots.default?.());
return ( return (
<InteralTable <InteralTable
ref={table} ref={table}

@ -1,6 +1,6 @@
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import { flattenChildren, isValidElement, parseStyleText } from '../../_util/props-util'; import { flattenChildren, isValidElement, parseStyleText } from '../../_util/props-util';
import { CSSProperties, HTMLAttributes } from 'vue'; import type { CSSProperties, HTMLAttributes } from 'vue';
import { defineComponent, isVNode } from 'vue'; import { defineComponent, isVNode } from 'vue';
import type { import type {

@ -16,6 +16,7 @@ import type {
ExpandedRowRender, ExpandedRowRender,
RenderExpandIcon, RenderExpandIcon,
TransformCellText, TransformCellText,
DefaultRecordType,
} from './interface'; } from './interface';
import Body from './Body'; import Body from './Body';
import useColumns from './hooks/useColumns'; import useColumns from './hooks/useColumns';
@ -65,7 +66,7 @@ const EMPTY_SCROLL_TARGET = {};
export const INTERNAL_HOOKS = 'rc-table-internal-hook'; export const INTERNAL_HOOKS = 'rc-table-internal-hook';
export interface TableProps<RecordType = unknown> { export interface TableProps<RecordType = DefaultRecordType> {
prefixCls?: string; prefixCls?: string;
data?: RecordType[]; data?: RecordType[];
columns?: ColumnsType<RecordType>; columns?: ColumnsType<RecordType>;
@ -143,7 +144,7 @@ export interface TableProps<RecordType = unknown> {
transformCellText?: TransformCellText<RecordType>; transformCellText?: TransformCellText<RecordType>;
} }
export default defineComponent<TableProps>({ export default defineComponent<TableProps<DefaultRecordType>>({
name: 'Table', name: 'Table',
inheritAttrs: false, inheritAttrs: false,
props: [ props: [
@ -190,7 +191,6 @@ export default defineComponent<TableProps>({
setup(props, { attrs, slots, emit }) { setup(props, { attrs, slots, emit }) {
const mergedData = computed(() => props.data || EMPTY_DATA); const mergedData = computed(() => props.data || EMPTY_DATA);
const hasData = computed(() => !!mergedData.value.length); const hasData = computed(() => !!mergedData.value.length);
// ==================== Customize ===================== // ==================== Customize =====================
const mergedComponents = computed(() => const mergedComponents = computed(() =>
mergeObject<TableComponents<any>>(props.components, {}), mergeObject<TableComponents<any>>(props.components, {}),

@ -141,9 +141,9 @@
"eslint-config-prettier": "^8.0.0", "eslint-config-prettier": "^8.0.0",
"eslint-plugin-html": "^6.0.0", "eslint-plugin-html": "^6.0.0",
"eslint-plugin-jest": "^24.3.6", "eslint-plugin-jest": "^24.3.6",
"eslint-plugin-markdown": "^2.0.0-alpha.0", "eslint-plugin-markdown": "^2.0.0",
"eslint-plugin-no-explicit-type-exports": "^0.11.10", "eslint-plugin-no-explicit-type-exports": "^0.11.10",
"eslint-plugin-prettier": "^3.1.4", "eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-vue": "^7.1.0", "eslint-plugin-vue": "^7.1.0",
"fetch-jsonp": "^1.1.3", "fetch-jsonp": "^1.1.3",
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",

Loading…
Cancel
Save