type 增加actionBtnPanelProps类型定义

This commit is contained in:
梁朝伟 2023-03-06 19:15:57 +08:00
parent 3415e5c7db
commit b6a9b2f2a1
3 changed files with 65 additions and 0 deletions

30
lib/types/actionBtnPanel.d.ts vendored Normal file
View File

@ -0,0 +1,30 @@
/// <reference types="react" />
import { ButtonProps, SpaceProps } from 'antd';
declare type Item = {
icon?: string | React.ReactNode;
label?: string;
action?: string;
auth: boolean;
type?: 'a' | 'button';
index?: number;
alerted?: boolean;
alertTitle?: string;
alertContent?: string;
confirmText?: string;
cancelText?: string;
render?: React.ReactNode;
beforeAction?: (item: Item) => boolean | Promise<boolean>;
afterAction?: (item: Item) => void;
onClick?: (item: Item) => void | Promise<void>;
buttonProps?: Omit<ButtonProps, 'onClick'>;
filter?: () => boolean;
};
export declare type ActionBtnPanelProps = {
entity: string;
actions: string[];
items: Item[];
spaceProps: SpaceProps;
mode: 'cell' | 'table-cell';
column: 3;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,33 @@
import {
ButtonProps,
SpaceProps,
} from 'antd';
type Item = {
icon?: string | React.ReactNode;
label?: string;
action?: string;
auth: boolean;
type?: 'a' | 'button';
index?: number;
alerted?: boolean;
alertTitle?: string;
alertContent?: string;
confirmText?: string;
cancelText?: string;
render?: React.ReactNode;
beforeAction?: (item: Item) => boolean | Promise<boolean>;
afterAction?: (item: Item) => void;
onClick?: (item: Item) => void | Promise<void>;
buttonProps?: Omit<ButtonProps, 'onClick'>;
filter?: () => boolean;
};
export type ActionBtnPanelProps = {
entity: string;
actions: string[];
items: Item[];
spaceProps: SpaceProps;
mode: 'cell' | 'table-cell';
column: 3;
}