mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* feat(hooks): add use-aria hooks * feat(components): update * feat(hooks): update * feat(hooks): update
27 lines
605 B
TypeScript
27 lines
605 B
TypeScript
import { pick } from 'lodash-unified'
|
|
import { buildProps } from '@element-plus/utils'
|
|
|
|
export const ariaProps = buildProps({
|
|
/**
|
|
* @description native `aria-label` attribute
|
|
*/
|
|
ariaLabel: String,
|
|
/**
|
|
* @description native `aria-orientation` attribute
|
|
*/
|
|
ariaOrientation: {
|
|
type: String,
|
|
values: ['horizontal', 'vertical', 'undefined'],
|
|
},
|
|
/**
|
|
* @description native `aria-controls` attribute
|
|
*/
|
|
ariaControls: String,
|
|
})
|
|
|
|
export const useAriaProps = <T extends keyof typeof ariaProps>(
|
|
arias: Array<T>
|
|
) => {
|
|
return pick<typeof ariaProps, T>(ariaProps, arias)
|
|
}
|