diff --git a/docs/src/components/common-ui/vben-form.md b/docs/src/components/common-ui/vben-form.md index e099c648..f881cfb1 100644 --- a/docs/src/components/common-ui/vben-form.md +++ b/docs/src/components/common-ui/vben-form.md @@ -320,7 +320,7 @@ useVbenForm 返回的第二个参数,是一个对象,包含了一些表单 ```ts export interface ActionButtonOptions { /** 样式 */ - class?: any; + class?: ClassType; /** 是否禁用 */ disabled?: boolean; /** 是否加载中 */ diff --git a/docs/src/guide/essentials/icons.md b/docs/src/guide/essentials/icons.md index ceac41a9..db4f01de 100644 --- a/docs/src/guide/essentials/icons.md +++ b/docs/src/guide/essentials/icons.md @@ -67,7 +67,7 @@ import { SvgTestIcon } from '@vben/icons'; ``` -## Tailwind CSS 图标 +## Tailwind CSS 图标 ### 使用 diff --git a/packages/@core/base/typings/src/basic.d.ts b/packages/@core/base/typings/src/basic.d.ts index de72239c..2f209f02 100644 --- a/packages/@core/base/typings/src/basic.d.ts +++ b/packages/@core/base/typings/src/basic.d.ts @@ -30,4 +30,6 @@ interface BasicUserInfo { username: string; } -export type { BasicOption, BasicUserInfo, SelectOption, TabOption }; +type ClassType = Array | object | string; + +export type { BasicOption, BasicUserInfo, ClassType, SelectOption, TabOption }; diff --git a/packages/@core/ui-kit/form-ui/package.json b/packages/@core/ui-kit/form-ui/package.json index 70181560..92c952f3 100644 --- a/packages/@core/ui-kit/form-ui/package.json +++ b/packages/@core/ui-kit/form-ui/package.json @@ -40,6 +40,7 @@ "@vben-core/composables": "workspace:*", "@vben-core/shadcn-ui": "workspace:*", "@vben-core/shared": "workspace:*", + "@vben-core/typings": "workspace:*", "@vee-validate/zod": "catalog:", "@vueuse/core": "catalog:", "vee-validate": "catalog:", diff --git a/packages/@core/ui-kit/form-ui/src/types.ts b/packages/@core/ui-kit/form-ui/src/types.ts index 5f21befd..74116756 100644 --- a/packages/@core/ui-kit/form-ui/src/types.ts +++ b/packages/@core/ui-kit/form-ui/src/types.ts @@ -1,4 +1,5 @@ import type { VbenButtonProps } from '@vben-core/shadcn-ui'; +import type { ClassType } from '@vben-core/typings'; import type { FieldOptions, FormContext, GenericObject } from 'vee-validate'; import type { ZodTypeAny } from 'zod'; @@ -303,7 +304,7 @@ export interface VbenFormProps< /** * 表单操作区域class */ - actionWrapperClass?: any; + actionWrapperClass?: ClassType; /** * 表单重置回调 */ diff --git a/packages/@core/ui-kit/popup-ui/package.json b/packages/@core/ui-kit/popup-ui/package.json index ba5f9526..3ef78c72 100644 --- a/packages/@core/ui-kit/popup-ui/package.json +++ b/packages/@core/ui-kit/popup-ui/package.json @@ -41,6 +41,7 @@ "@vben-core/icons": "workspace:*", "@vben-core/shadcn-ui": "workspace:*", "@vben-core/shared": "workspace:*", + "@vben-core/typings": "workspace:*", "@vueuse/core": "catalog:", "vue": "catalog:" } diff --git a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts index 7bcb70cf..3b4ce4b7 100644 --- a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts +++ b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts @@ -1,3 +1,5 @@ +import type { ClassType } from '@vben-core/typings'; + import type { DrawerApi } from './drawer-api'; import type { Component, Ref } from 'vue'; @@ -7,7 +9,7 @@ export interface DrawerProps { * 取消按钮文字 */ cancelText?: string; - class?: any; + class?: ClassType; /** * 是否显示右上角的关闭按钮 * @default true @@ -45,11 +47,17 @@ export interface DrawerProps { /** * 弹窗底部样式 */ - footerClass?: any; + footerClass?: ClassType; + /** + * 是否显示顶栏 + * @default true + */ + header?: boolean; /** * 弹窗头部样式 */ - headerClass?: any; + headerClass?: ClassType; + /** * 弹窗是否显示 * @default false diff --git a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue index 10094600..9abbaf5a 100644 --- a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue +++ b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue @@ -57,6 +57,7 @@ const { description, footer: showFooter, footerClass, + header: showHeader, headerClass, loading: showLoading, modal, @@ -131,6 +132,7 @@ function handleFocusOutside(e: Event) { @pointer-down-outside="pointerDownOutside" > +import type { ClassType } from '@vben-core/typings'; import type { AvatarFallbackProps, AvatarImageProps, @@ -11,9 +12,9 @@ import { Avatar, AvatarFallback, AvatarImage } from '../../ui'; interface Props extends AvatarRootProps, AvatarFallbackProps, AvatarImageProps { alt?: string; - class?: any; + class?: ClassType; dot?: boolean; - dotClass?: any; + dotClass?: ClassType; } defineOptions({ diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/context-menu/context-menu.vue b/packages/@core/ui-kit/shadcn-ui/src/components/context-menu/context-menu.vue index 5d3dd299..4cc4119a 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/components/context-menu/context-menu.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/components/context-menu/context-menu.vue @@ -1,4 +1,5 @@