diff --git a/packages/components/arrow/src/arrow.ts b/packages/components/arrow/src/arrow.ts index cdc881f91..747603b93 100644 --- a/packages/components/arrow/src/arrow.ts +++ b/packages/components/arrow/src/arrow.ts @@ -1,10 +1,10 @@ import type { PropType } from 'vue' import { cloneVNode, defineComponent, h, toRefs } from 'vue' -import type { ElementType, PrimitiveProps } from '@oku-ui/primitive' +import type { OkuElement, PrimitiveProps } from '@oku-ui/primitive' import { Primitive, primitiveProps } from '@oku-ui/primitive' import { useForwardRef } from '@oku-ui/use-composable' -export type ArrowIntrinsicElement = ElementType<'svg'> +export type ArrowNaviteElement = OkuElement<'svg'> export type ArrowElement = Omit & { width: number height: number @@ -77,5 +77,5 @@ const arrow = defineComponent({ // TODO: https://github.com/vuejs/core/pull/7444 after delete export const OkuArrow = arrow as typeof arrow & (new () => { - $props: Partial + $props: ArrowNaviteElement }) diff --git a/packages/components/arrow/src/index.ts b/packages/components/arrow/src/index.ts index ea44a0a3b..60a914ff9 100644 --- a/packages/components/arrow/src/index.ts +++ b/packages/components/arrow/src/index.ts @@ -6,5 +6,5 @@ export { export type { ArrowProps, ArrowElement, - ArrowIntrinsicElement, + ArrowNaviteElement, } from './arrow' diff --git a/packages/components/aspect-ratio/src/aspect-ratio.ts b/packages/components/aspect-ratio/src/aspect-ratio.ts index e475ba012..fd761d3ee 100644 --- a/packages/components/aspect-ratio/src/aspect-ratio.ts +++ b/packages/components/aspect-ratio/src/aspect-ratio.ts @@ -1,10 +1,10 @@ -import type { CSSProperties, PropType } from 'vue' +import type { PropType } from 'vue' import { defineComponent, h, toRef } from 'vue' -import type { ElementType, PrimitiveProps } from '@oku-ui/primitive' +import type { OkuElement, PrimitiveProps } from '@oku-ui/primitive' import { Primitive, primitiveProps } from '@oku-ui/primitive' import { useForwardRef } from '@oku-ui/use-composable' -export type AspectRatioIntrinsicElement = ElementType<'div'> +export type AspectRatioNaviteElement = OkuElement<'div'> export type AspectRatioElement = HTMLDivElement const NAME = 'OkuAspectRatio' @@ -23,7 +23,7 @@ export const aspectRatioProps = { emits: {}, } -const AspectRatio = defineComponent({ +const aspectRatio = defineComponent({ name: NAME, inheritAttrs: false, props: { @@ -32,7 +32,6 @@ const AspectRatio = defineComponent({ }, setup(props, { attrs, slots }) { const ratio = toRef(props, 'ratio') - const { style, ...aspectRatioAttrs } = attrs as AspectRatioIntrinsicElement const forwardedRef = useForwardRef() const originalReturn = () => h( @@ -41,7 +40,7 @@ const AspectRatio = defineComponent({ position: 'relative', width: '100%', paddingBottom: `${100 / ratio.value}%`, - } as CSSProperties, + }, 'data-oku-aspect-ratio-wrapper': '', }, [ @@ -49,10 +48,10 @@ const AspectRatio = defineComponent({ Primitive.div, { asChild: props.asChild, - ...aspectRatioAttrs, + ...attrs, ref: forwardedRef, style: { - ...(style as any), + ...attrs.style as any, position: 'absolute', top: '0px', right: '0px', @@ -72,7 +71,7 @@ const AspectRatio = defineComponent({ }) // TODO: https://github.com/vuejs/core/pull/7444 after delete -export const OkuAspectRatio = AspectRatio as typeof AspectRatio & +export const OkuAspectRatio = aspectRatio as typeof aspectRatio & (new () => { - $props: Partial + $props: AspectRatioNaviteElement }) diff --git a/packages/components/aspect-ratio/src/index.ts b/packages/components/aspect-ratio/src/index.ts index b682ddf78..da5e42d91 100644 --- a/packages/components/aspect-ratio/src/index.ts +++ b/packages/components/aspect-ratio/src/index.ts @@ -6,5 +6,5 @@ export { export type { AspectRatioProps, AspectRatioElement, - AspectRatioIntrinsicElement, + AspectRatioNaviteElement, } from './aspect-ratio' diff --git a/packages/components/aspect-ratio/src/stories/AspectRatioDemo.vue b/packages/components/aspect-ratio/src/stories/AspectRatioDemo.vue index 5da56f476..b3060cd79 100644 --- a/packages/components/aspect-ratio/src/stories/AspectRatioDemo.vue +++ b/packages/components/aspect-ratio/src/stories/AspectRatioDemo.vue @@ -5,13 +5,13 @@ import { onMounted, ref } from 'vue' export interface IAspectRatioProps { template?: '#1' | '#2' | '#3' | '#4' | '#5' imageurl?: string - allShow?: boolean + allshow?: boolean } withDefaults(defineProps(), { ratio: 16 / 9, template: '#1', - allShow: false, + allshow: false, }) const root = ref() @@ -22,12 +22,12 @@ onMounted(() => {