From b6a9b2f2a1d625565ab003975172592f9d232954 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=A2=81=E6=9C=9D=E4=BC=9F?= <2211960668@qq.com>
Date: Mon, 6 Mar 2023 19:15:57 +0800
Subject: [PATCH] =?UTF-8?q?type=20=E5=A2=9E=E5=8A=A0actionBtnPanelProps?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/types/actionBtnPanel.d.ts | 30 ++++++++++++++++++++++++++++++
lib/types/actionBtnPanel.js | 2 ++
src/types/actionBtnPanel.ts | 33 +++++++++++++++++++++++++++++++++
3 files changed, 65 insertions(+)
create mode 100644 lib/types/actionBtnPanel.d.ts
create mode 100644 lib/types/actionBtnPanel.js
create mode 100644 src/types/actionBtnPanel.ts
diff --git a/lib/types/actionBtnPanel.d.ts b/lib/types/actionBtnPanel.d.ts
new file mode 100644
index 000000000..d08eacfb9
--- /dev/null
+++ b/lib/types/actionBtnPanel.d.ts
@@ -0,0 +1,30 @@
+///
+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;
+ afterAction?: (item: Item) => void;
+ onClick?: (item: Item) => void | Promise;
+ buttonProps?: Omit;
+ filter?: () => boolean;
+};
+export declare type ActionBtnPanelProps = {
+ entity: string;
+ actions: string[];
+ items: Item[];
+ spaceProps: SpaceProps;
+ mode: 'cell' | 'table-cell';
+ column: 3;
+};
+export {};
diff --git a/lib/types/actionBtnPanel.js b/lib/types/actionBtnPanel.js
new file mode 100644
index 000000000..c8ad2e549
--- /dev/null
+++ b/lib/types/actionBtnPanel.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/src/types/actionBtnPanel.ts b/src/types/actionBtnPanel.ts
new file mode 100644
index 000000000..b1b9da710
--- /dev/null
+++ b/src/types/actionBtnPanel.ts
@@ -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;
+ afterAction?: (item: Item) => void;
+ onClick?: (item: Item) => void | Promise;
+ buttonProps?: Omit;
+ filter?: () => boolean;
+};
+
+export type ActionBtnPanelProps = {
+ entity: string;
+ actions: string[];
+ items: Item[];
+ spaceProps: SpaceProps;
+ mode: 'cell' | 'table-cell';
+ column: 3;
+}
\ No newline at end of file