fix: popper content type check (#17040)

* fix: popper content type check

* fix: code lint

* fix: effect type

* fix: all popper effect type

* fix: replace all EffectType

---------

Co-authored-by: Tong Siyuan <jiuran@jiurandeMacBook-Pro.local>
This commit is contained in:
久染 | JiuRan
2024-07-22 17:33:02 +08:00
committed by GitHub
parent 92204e97f1
commit 122b2fda82
5 changed files with 20 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ import { placements } from '@popperjs/core'
import { buildProps, definePropType } from '@element-plus/utils'
import { useAriaProps } from '@element-plus/hooks'
import type { PopperEffect } from './popper'
import type { ExtractPropTypes, StyleValue } from 'vue'
import type { Options, Placement } from '@popperjs/core'
import type { Measurable } from './constants'
@@ -73,7 +74,7 @@ export const popperContentProps = buildProps({
type: definePropType<ClassType>([String, Array, Object]),
},
effect: {
type: String,
type: definePropType<PopperEffect>(String),
default: 'dark',
},
visible: Boolean,

View File

@@ -12,7 +12,11 @@ import { defaultProps } from './useProps'
import type { Option, OptionType } from './select.types'
import type { Props } from './useProps'
import type { Options, Placement } from '@element-plus/components/popper'
import type {
Options,
Placement,
PopperEffect,
} from '@element-plus/components/popper'
export const SelectProps = buildProps({
/**
@@ -45,7 +49,7 @@ export const SelectProps = buildProps({
* @description tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
type: definePropType<'light' | 'dark' | string>(String),
type: definePropType<PopperEffect>(String),
default: 'light',
},
/**

View File

@@ -8,7 +8,11 @@ import { buildProps, definePropType, iconPropType } from '@element-plus/utils'
import { useTooltipContentProps } from '@element-plus/components/tooltip'
import { ArrowDown, CircleClose } from '@element-plus/icons-vue'
import { tagProps } from '@element-plus/components/tag'
import type { Options, Placement } from '@element-plus/components/popper'
import type {
Options,
Placement,
PopperEffect,
} from '@element-plus/components/popper'
export const SelectProps = buildProps({
/**
@@ -45,7 +49,7 @@ export const SelectProps = buildProps({
* @description tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
type: definePropType<'light' | 'dark' | string>(String),
type: definePropType<PopperEffect>(String),
default: 'light',
},
/**

View File

@@ -1,8 +1,9 @@
import { buildProps, definePropType } from '@element-plus/utils'
import { CircleClose, Clock } from '@element-plus/icons-vue'
import { useEmptyValuesProps, useSizeProp } from '@element-plus/hooks'
import type { PopperEffect } from '@element-plus/components/popper'
import type TimeSelect from './time-select.vue'
import type { Component, ExtractPropTypes, PropType } from 'vue'
import type { Component, ExtractPropTypes } from 'vue'
export const timeSelectProps = buildProps({
/**
@@ -31,7 +32,7 @@ export const timeSelectProps = buildProps({
* @description Tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
type: String as PropType<'light' | 'dark' | string>,
type: definePropType<PopperEffect>(String),
default: 'light',
},
/**

View File

@@ -1,6 +1,7 @@
import { buildProps, definePropType } from '@element-plus/utils'
import { useAriaProps } from '@element-plus/hooks'
import type { PopperEffect } from '@element-plus/components/popper'
import type { ExtractPropTypes } from 'vue'
import type { Placement, Strategy, VirtualElement } from '@floating-ui/dom'
@@ -27,8 +28,8 @@ export const tooltipV2ContentProps = buildProps({
default: 5,
},
effect: {
type: String,
default: '',
type: definePropType<PopperEffect>(String),
default: 'light',
},
contentClass: String,
/**