UNPKG

drip-table

Version:

A tiny and powerful enterprise-class solution for building tables.

102 lines (101 loc) 3.19 kB
/** * This file is part of the drip-table project. * @link : https://drip-table.jd.com/ * @author : qianjing29 (qianjing29@jd.com) * @modifier : qianjing29 (qianjing29@jd.com) * @copyright: Copyright (c) 2020 JD Network Technology Co., Ltd. */ import React from 'react'; import { DripTableColumnSchema, DripTableRecordTypeBase, SchemaObject } from "../../../types"; import { DripTableComponentProps } from '../component'; export declare type DTCButtonColumnSchema = DripTableColumnSchema<'button', { /** * 自定义样式 */ style?: string | Record<string, string>; /** * 展示模式:单按钮、多按钮 */ mode?: 'single' | 'multiple'; label?: string; buttonType?: 'primary' | 'dashed' | 'text' | 'link'; shape?: 'circle' | 'round'; size?: 'large' | 'middle' | 'small'; danger?: boolean; ghost?: boolean; icon?: string; iconPosition?: 'left' | 'right'; event?: string; closePopover?: string; margin?: number; popconfirm?: { /** * 弹出层自定义样式 */ overlayStyle?: string | Record<string, string>; /** * 弹出层内部自定义样式 */ overlayInnerStyle?: string | Record<string, string>; title: string; titleIcon?: string; /** * 标题图标自定义样式 */ titleIconStyle?: string | Record<string, string>; content: string; contentIcon?: string; /** * 正文图标自定义样式 */ contentIconStyle?: string | Record<string, string>; placement?: string; cancelText?: string; /** * 取消按钮自定义样式 */ cancelStyle?: string | Record<string, string>; confirmText?: string; /** * 确认按钮自定义样式 */ confirmStyle?: string | Record<string, string>; }; disableFunc?: string; visibleFunc?: string; buttons?: { label?: string; event?: string; closePopover?: string; buttonType?: 'primary' | 'dashed' | 'text' | 'link'; shape?: 'circle' | 'round'; size?: 'large' | 'middle' | 'small'; danger?: boolean; ghost?: boolean; icon?: string; disableFunc?: string; visibleFunc?: string; }[]; }>; export interface DTCButtonEvent { type: 'drip-button-click'; payload: string; } interface DTCButtonProps<RecordType extends DripTableRecordTypeBase> extends DripTableComponentProps<RecordType, DTCButtonColumnSchema> { } interface DTCButtonState { showPopconfirm: boolean; } export default class DTCButton<RecordType extends DripTableRecordTypeBase> extends React.PureComponent<DTCButtonProps<RecordType>, DTCButtonState> { static componentName: DTCButtonColumnSchema['component']; static schema: SchemaObject; state: DTCButtonState; private get configured(); private get label(); private getIcon; private getVisible; private getDisabled; private parseReactCSS; render(): React.JSX.Element | (false | React.JSX.Element)[] | null | undefined; } export {};