import { buttonTypes } from '@element-plus/components/button' import { QuestionFilled } from '@element-plus/icons-vue' import { buildProps, definePropType, iconPropType } from '@element-plus/utils' import { useTooltipContentProps } from '@element-plus/components/tooltip' import type { Component, ExtractPropTypes } from 'vue' import type Popconfirm from './popconfirm.vue' export const popconfirmProps = buildProps({ title: String, confirmButtonText: String, cancelButtonText: String, confirmButtonType: { type: String, values: buttonTypes, default: 'primary', }, cancelButtonType: { type: String, values: buttonTypes, default: 'text', }, icon: { type: iconPropType, default: QuestionFilled as Component, }, iconColor: { type: String, default: '#f90', }, hideIcon: { type: Boolean, default: false, }, hideAfter: { type: Number, default: 200, }, onConfirm: { type: definePropType<(e: Event) => Promise | void>(Function), }, onCancel: { type: definePropType<(e: Event) => Promise | void>(Function), }, teleported: useTooltipContentProps.teleported, persistent: useTooltipContentProps.persistent, } as const) export type PopconfirmProps = ExtractPropTypes export type PopconfirmInstance = InstanceType