feat!: handle color states on form elements (#234)

This commit is contained in:
Benjamin Canac
2023-05-26 22:07:49 +02:00
committed by GitHub
parent 1a9dc5c980
commit 9ce531a06f
21 changed files with 598 additions and 274 deletions

View File

@@ -14,3 +14,18 @@ export const omit = (obj: object, keys: string[]) => {
Object.entries(obj).filter(([key]) => !keys.includes(key))
)
}
export const getSlotsChildren = (slots: any) => {
let children = slots.default?.()
if (children.length) {
if (typeof children[0].type === 'symbol') {
// @ts-ignore-next
children = children[0].children
// @ts-ignore-next
} else if (children[0].type.name === 'ContentSlot') {
// @ts-ignore-next
children = children[0].ctx.slots.default?.()
}
}
return children
}