mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* refactor(style): Update Eslint to V9 and Prettier to V3 * fix: vscode color * fix: vscode color * chore: remove Useless dependence and old config file * chore: format * Merge branch 'dev' into eslintV9 * fix: fix * fix: ssr test * fix: ssr test * fix: use defineConfig * fix: prettier format and ignore docs dist * fix: index.mjs => index.js * fix: Vscode color * fix: prettier ignore global.d.ts * fix: format --------- Co-authored-by: 2586740555 <15972343+CYJ090915@user.noreply.gitee.com>
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
|
|
import { buildProps } from '@element-plus/utils'
|
|
|
|
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'
|
|
import type Popper from './popper.vue'
|
|
|
|
const effects = ['light', 'dark'] as const
|
|
const triggers = ['click', 'contextmenu', 'hover', 'focus'] as const
|
|
|
|
export const Effect = {
|
|
LIGHT: 'light',
|
|
DARK: 'dark',
|
|
} as const
|
|
|
|
export const roleTypes = [
|
|
'dialog',
|
|
'grid',
|
|
'group',
|
|
'listbox',
|
|
'menu',
|
|
'navigation',
|
|
'tooltip',
|
|
'tree',
|
|
] as const
|
|
|
|
export type PopperEffect =
|
|
| (typeof effects)[number]
|
|
| (string & NonNullable<unknown>)
|
|
export type PopperTrigger = (typeof triggers)[number]
|
|
|
|
export const popperProps = buildProps({
|
|
role: {
|
|
type: String,
|
|
values: roleTypes,
|
|
default: 'tooltip',
|
|
},
|
|
} as const)
|
|
|
|
export type PopperProps = ExtractPropTypes<typeof popperProps>
|
|
export type PopperPropsPublic = __ExtractPublicPropTypes<typeof popperProps>
|
|
|
|
export type PopperInstance = InstanceType<typeof Popper> & unknown
|
|
|
|
/** @deprecated use `popperProps` instead, and it will be deprecated in the next major version */
|
|
export const usePopperProps = popperProps
|
|
|
|
/** @deprecated use `PopperProps` instead, and it will be deprecated in the next major version */
|
|
export type UsePopperProps = PopperProps
|