perf: format code with better style (#5283)

This commit is contained in:
Vben
2025-01-01 11:39:49 +08:00
committed by GitHub
parent 4d81b9d18d
commit 081d2aed23
288 changed files with 1805 additions and 2164 deletions

View File

@@ -1,10 +1,11 @@
import type { Component } from 'vue';
import type {
BaseFormComponentType,
FormCommonConfig,
VbenFormAdapterOptions,
} from './types';
import type { Component } from 'vue';
import { h } from 'vue';
import {

View File

@@ -1,4 +1,3 @@
import type { Recordable } from '@vben-core/typings';
import type {
FormState,
GenericObject,
@@ -6,6 +5,8 @@ import type {
ValidationOptions,
} from 'vee-validate';
import type { Recordable } from '@vben-core/typings';
import type { FormActions, FormSchema, VbenFormProps } from './types';
import { toRaw } from 'vue';
@@ -45,20 +46,20 @@ function getDefaultState(): VbenFormProps {
}
export class FormApi {
// 最后一次点击提交时的表单值
private latestSubmissionValues: null | Recordable<any> = null;
private prevState: null | VbenFormProps = null;
// private api: Pick<VbenFormProps, 'handleReset' | 'handleSubmit'>;
public form = {} as FormActions;
isMounted = false;
public state: null | VbenFormProps = null;
stateHandler: StateHandler;
public store: Store<VbenFormProps>;
// 最后一次点击提交时的表单值
private latestSubmissionValues: null | Recordable<any> = null;
private prevState: null | VbenFormProps = null;
constructor(options: VbenFormProps = {}) {
const { ...storeState } = options;
@@ -83,40 +84,6 @@ export class FormApi {
bindMethods(this);
}
private async getForm() {
if (!this.isMounted) {
// 等待form挂载
await this.stateHandler.waitForCondition();
}
if (!this.form?.meta) {
throw new Error('<VbenForm /> is not mounted');
}
return this.form;
}
private updateState() {
const currentSchema = this.state?.schema ?? [];
const prevSchema = this.prevState?.schema ?? [];
// 进行了删除schema操作
if (currentSchema.length < prevSchema.length) {
const currentFields = new Set(
currentSchema.map((item) => item.fieldName),
);
const deletedSchema = prevSchema.filter(
(item) => !currentFields.has(item.fieldName),
);
for (const schema of deletedSchema) {
this.form?.setFieldValue(schema.fieldName, undefined);
}
}
}
// 如果需要多次更新状态,可以使用 batch 方法
batchStore(cb: () => void) {
this.store.batch(cb);
}
getLatestSubmissionValues() {
return this.latestSubmissionValues || {};
}
@@ -363,4 +330,33 @@ export class FormApi {
}
return validateResult;
}
private async getForm() {
if (!this.isMounted) {
// 等待form挂载
await this.stateHandler.waitForCondition();
}
if (!this.form?.meta) {
throw new Error('<VbenForm /> is not mounted');
}
return this.form;
}
private updateState() {
const currentSchema = this.state?.schema ?? [];
const prevSchema = this.prevState?.schema ?? [];
// 进行了删除schema操作
if (currentSchema.length < prevSchema.length) {
const currentFields = new Set(
currentSchema.map((item) => item.fieldName),
);
const deletedSchema = prevSchema.filter(
(item) => !currentFields.has(item.fieldName),
);
for (const schema of deletedSchema) {
this.form?.setFieldValue(schema.fieldName, undefined);
}
}
}
}

View File

@@ -44,9 +44,9 @@ const {
renderComponentContent,
rules,
} = defineProps<
{
Props & {
commonComponentProps: MaybeComponentProps;
} & Props
}
>();
const { componentBindEventMap, componentMap, isVertical } = useFormContext();

View File

@@ -1,4 +1,5 @@
<script setup lang="ts">
import type { GenericObject } from 'vee-validate';
import type { ZodTypeAny } from 'zod';
import type {
@@ -13,8 +14,6 @@ import { computed } from 'vue';
import { Form } from '@vben-core/shadcn-ui';
import { cn, isString, mergeWithArrayOverride } from '@vben-core/shared/utils';
import { type GenericObject } from 'vee-validate';
import { provideFormRenderProps } from './context';
import { useExpandable } from './expandable';
import FormField from './form-field.vue';
@@ -23,7 +22,7 @@ import { getBaseRules, getDefaultValueInZodStack } from './helper';
interface Props extends FormRenderProps {}
const props = withDefaults(
defineProps<{ globalCommonConfig?: FormCommonConfig } & Props>(),
defineProps<Props & { globalCommonConfig?: FormCommonConfig }>(),
{
collapsedRows: 1,
commonConfig: () => ({}),
@@ -81,10 +80,10 @@ const formCollapsed = computed(() => {
});
const computedSchema = computed(
(): ({
(): (Omit<FormSchema, 'formFieldProps'> & {
commonComponentProps: Record<string, any>;
formFieldProps: Record<string, any>;
} & Omit<FormSchema, 'formFieldProps'>)[] => {
})[] => {
const {
colon = false,
componentProps = {},

View File

@@ -1,3 +1,3 @@
export { default as Form } from './form.vue';
export { default as FormField } from './form-field.vue';
export { default as FormLabel } from './form-label.vue';
export { default as Form } from './form.vue';

View File

@@ -3,8 +3,8 @@ export { setupVbenForm } from './config';
export type {
BaseFormComponentType,
ExtendedFormApi,
FormSchema as VbenFormSchema,
VbenFormProps,
FormSchema as VbenFormSchema,
} from './types';
export * from './use-vben-form';

View File

@@ -1,12 +1,13 @@
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';
import type { FormApi } from './form-api';
import type { Component, HtmlHTMLAttributes, Ref } from 'vue';
import type { VbenButtonProps } from '@vben-core/shadcn-ui';
import type { ClassType } from '@vben-core/typings';
import type { FormApi } from './form-api';
export type FormLayout = 'horizontal' | 'vertical';
export type BaseFormComponentType =
@@ -19,7 +20,7 @@ export type BaseFormComponentType =
| 'VbenSelect'
| (Record<never, never> & string);
type Breakpoints = '' | '2xl:' | '3xl:' | 'lg:' | 'md:' | 'sm:' | 'xl:';
type Breakpoints = '2xl:' | '3xl:' | '' | 'lg:' | 'md:' | 'sm:' | 'xl:';
type GridCols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
@@ -35,12 +36,12 @@ export type FormItemClassType =
| WrapperClassType;
export type FormFieldOptions = Partial<
{
FieldOptions & {
validateOnBlur?: boolean;
validateOnChange?: boolean;
validateOnInput?: boolean;
validateOnModelUpdate?: boolean;
} & FieldOptions
}
>;
export interface FormShape {
@@ -372,11 +373,11 @@ export interface VbenFormProps<
submitOnEnter?: boolean;
}
export type ExtendedFormApi = {
export type ExtendedFormApi = FormApi & {
useStore: <T = NoInfer<VbenFormProps>>(
selector?: (state: NoInfer<VbenFormProps>) => T,
) => Readonly<Ref<T>>;
} & FormApi;
};
export interface VbenFormAdapterOptions<
T extends BaseFormComponentType = BaseFormComponentType,

View File

@@ -1,12 +1,16 @@
import type { ZodRawShape } from 'zod';
import type { ComputedRef } from 'vue';
import type { FormActions, VbenFormProps } from './types';
import { computed, type ComputedRef, unref, useSlots } from 'vue';
import { computed, unref, useSlots } from 'vue';
import { createContext } from '@vben-core/shadcn-ui';
import { isString } from '@vben-core/shared/utils';
import { useForm } from 'vee-validate';
import { object, type ZodRawShape } from 'zod';
import { object } from 'zod';
import { getDefaultsForSchema } from 'zod-defaults';
export const [injectFormProps, provideFormProps] =

View File

@@ -2,12 +2,10 @@
import type { ExtendedFormApi, VbenFormProps } from './types';
// import { toRaw, watch } from 'vue';
import { useForwardPriorityValues } from '@vben-core/composables';
import { nextTick, onMounted, watch } from 'vue';
// import { isFunction } from '@vben-core/shared/utils';
import { nextTick, onMounted, watch } from 'vue';
import { useForwardPriorityValues } from '@vben-core/composables';
import { cloneDeep } from '@vben-core/shared/utils';
import { useDebounceFn } from '@vueuse/core';

View File

@@ -1,7 +1,8 @@
<script setup lang="ts">
import type { CSSProperties } from 'vue';
import type { ContentCompactType } from '@vben-core/typings';
import type { CSSProperties } from 'vue';
import { computed } from 'vue';
import { useLayoutContentStyle } from '@vben-core/composables';

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { CSSProperties } from 'vue';
import { computed } from 'vue';
interface Props {

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { CSSProperties } from 'vue';
import { computed, useSlots } from 'vue';
interface Props {

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { CSSProperties } from 'vue';
import { computed, shallowRef, useSlots, watchEffect } from 'vue';
import { VbenScrollbar } from '@vben-core/shadcn-ui';

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { CSSProperties } from 'vue';
import { computed } from 'vue';
interface Props {

View File

@@ -1,7 +1,8 @@
<script setup lang="ts">
import type { CSSProperties } from 'vue';
import type { VbenLayoutProps } from './vben-layout';
import type { CSSProperties } from 'vue';
import { computed, ref, watch } from 'vue';
import {

View File

@@ -1,4 +1,4 @@
export { default as Menu } from './menu.vue';
export { default as MenuBadge } from './menu-badge.vue';
export { default as MenuItem } from './menu-item.vue';
export { default as Menu } from './menu.vue';
export { default as SubMenu } from './sub-menu.vue';

View File

@@ -1,6 +1,8 @@
<script lang="ts" setup>
import type { UseResizeObserverReturn } from '@vueuse/core';
import type { VNodeArrayChildren } from 'vue';
import type {
MenuItemClicked,
MenuItemRegistered,
@@ -15,7 +17,6 @@ import {
ref,
toRef,
useSlots,
type VNodeArrayChildren,
watch,
watchEffect,
} from 'vue';

View File

@@ -1,7 +1,7 @@
import type { MenuRecordBadgeRaw, ThemeModeType } from '@vben-core/typings';
import type { Component, Ref } from 'vue';
import type { MenuRecordBadgeRaw, ThemeModeType } from '@vben-core/typings';
interface MenuProps {
/**
* @zh_CN 是否开启手风琴模式

View File

@@ -4,6 +4,7 @@ import type {
VNodeChild,
VNodeNormalizedChildren,
} from 'vue';
import { isVNode } from 'vue';
type VNodeChildAtom = Exclude<VNodeChild, Array<any>>;

View File

@@ -9,7 +9,11 @@ vi.mock('@vben-core/shared/store', () => {
return {
isFunction: (fn: any) => typeof fn === 'function',
Store: class {
get state() {
return this._state;
}
private _state: DrawerState;
private options: any;
constructor(initialState: DrawerState, options: any) {
@@ -25,10 +29,6 @@ vi.mock('@vben-core/shared/store', () => {
this._state = fn(this._state);
this.options.onUpdate();
}
get state() {
return this._state;
}
},
};
});
@@ -100,17 +100,6 @@ describe('drawerApi', () => {
expect(onOpenChange).toHaveBeenCalledWith(true);
});
it('should batch state updates', () => {
const batchSpy = vi.spyOn(drawerApi.store, 'batch');
drawerApi.batchStore(() => {
drawerApi.setState({ title: 'Batch Title' });
drawerApi.setState({ confirmText: 'Batch Confirm' });
});
expect(batchSpy).toHaveBeenCalled();
expect(drawerApi.store.state.title).toBe('Batch Title');
expect(drawerApi.store.state.confirmText).toBe('Batch Confirm');
});
it('should call onClosed callback when provided', () => {
const onClosed = vi.fn();
const drawerApiWithHook = new DrawerApi({ onClosed });

View File

@@ -4,6 +4,12 @@ import { Store } from '@vben-core/shared/store';
import { bindMethods, isFunction } from '@vben-core/shared/utils';
export class DrawerApi {
// 共享数据
public sharedData: Record<'payload', any> = {
payload: {},
};
public store: Store<DrawerState>;
private api: Pick<
DrawerApiOptions,
| 'onBeforeClose'
@@ -13,16 +19,10 @@ export class DrawerApi {
| 'onOpenChange'
| 'onOpened'
>;
// private prevState!: DrawerState;
private state!: DrawerState;
// 共享数据
public sharedData: Record<'payload', any> = {
payload: {},
};
public store: Store<DrawerState>;
constructor(options: DrawerApiOptions = {}) {
const {
connectedComponent: _,
@@ -83,11 +83,6 @@ export class DrawerApi {
bindMethods(this);
}
// 如果需要多次更新状态,可以使用 batch 方法
batchStore(cb: () => void) {
this.store.batch(cb);
}
/**
* 关闭弹窗
*/

View File

@@ -1,9 +1,9 @@
import type { Component, Ref } from 'vue';
import type { ClassType } from '@vben-core/typings';
import type { DrawerApi } from './drawer-api';
import type { Component, Ref } from 'vue';
export type DrawerPlacement = 'bottom' | 'left' | 'right' | 'top';
export type CloseIconPlacement = 'left' | 'right';
@@ -124,11 +124,11 @@ export interface DrawerState extends DrawerProps {
sharedData?: Record<string, any>;
}
export type ExtendedDrawerApi = {
export type ExtendedDrawerApi = DrawerApi & {
useStore: <T = NoInfer<DrawerState>>(
selector?: (state: NoInfer<DrawerState>) => T,
) => Readonly<Ref<T>>;
} & DrawerApi;
};
export interface DrawerApiOptions extends DrawerState {
/**

View File

@@ -16,8 +16,8 @@ import {
import { useStore } from '@vben-core/shared/store';
import VbenDrawer from './drawer.vue';
import { DrawerApi } from './drawer-api';
import VbenDrawer from './drawer.vue';
const USER_DRAWER_INJECT_KEY = Symbol('VBEN_DRAWER_INJECT');

View File

@@ -8,7 +8,11 @@ vi.mock('@vben-core/shared/store', () => {
return {
isFunction: (fn: any) => typeof fn === 'function',
Store: class {
get state() {
return this._state;
}
private _state: ModalState;
private options: any;
constructor(initialState: ModalState, options: any) {
@@ -24,10 +28,6 @@ vi.mock('@vben-core/shared/store', () => {
this._state = fn(this._state);
this.options.onUpdate();
}
get state() {
return this._state;
}
},
};
});
@@ -100,17 +100,6 @@ describe('modalApi', () => {
expect(onOpenChange).toHaveBeenCalledWith(true);
});
it('should batch state updates', () => {
const batchSpy = vi.spyOn(modalApi.store, 'batch');
modalApi.batchStore(() => {
modalApi.setState({ title: 'Batch Title' });
modalApi.setState({ confirmText: 'Batch Confirm' });
});
expect(batchSpy).toHaveBeenCalled();
expect(modalApi.store.state.title).toBe('Batch Title');
expect(modalApi.store.state.confirmText).toBe('Batch Confirm');
});
it('should call onClosed callback when provided', () => {
const onClosed = vi.fn();
const modalApiWithHook = new ModalApi({ onClosed });

View File

@@ -4,6 +4,12 @@ import { Store } from '@vben-core/shared/store';
import { bindMethods, isFunction } from '@vben-core/shared/utils';
export class ModalApi {
// 共享数据
public sharedData: Record<'payload', any> = {
payload: {},
};
public store: Store<ModalState>;
private api: Pick<
ModalApiOptions,
| 'onBeforeClose'
@@ -13,16 +19,10 @@ export class ModalApi {
| 'onOpenChange'
| 'onOpened'
>;
// private prevState!: ModalState;
private state!: ModalState;
// 共享数据
public sharedData: Record<'payload', any> = {
payload: {},
};
public store: Store<ModalState>;
constructor(options: ModalApiOptions = {}) {
const {
connectedComponent: _,
@@ -93,11 +93,6 @@ export class ModalApi {
bindMethods(this);
}
// 如果需要多次更新状态,可以使用 batch 方法
batchStore(cb: () => void) {
this.store.batch(cb);
}
/**
* 关闭弹窗
*/

View File

@@ -1,7 +1,7 @@
import type { ModalApi } from './modal-api';
import type { Component, Ref } from 'vue';
import type { ModalApi } from './modal-api';
export interface ModalProps {
/**
* 是否要挂载到内容区域
@@ -132,11 +132,11 @@ export interface ModalState extends ModalProps {
sharedData?: Record<string, any>;
}
export type ExtendedModalApi = {
export type ExtendedModalApi = ModalApi & {
useStore: <T = NoInfer<ModalState>>(
selector?: (state: NoInfer<ModalState>) => T,
) => Readonly<Ref<T>>;
} & ModalApi;
};
export interface ModalApiOptions extends ModalState {
/**

View File

@@ -3,9 +3,10 @@
* 调整部分细节
*/
import { onBeforeUnmount, onMounted, reactive, ref, watchEffect } from 'vue';
import type { ComputedRef, Ref } from 'vue';
import { onBeforeUnmount, onMounted, reactive, ref, watchEffect } from 'vue';
import { unrefElement } from '@vueuse/core';
export function useModalDraggable(

View File

@@ -12,8 +12,8 @@ import {
import { useStore } from '@vben-core/shared/store';
import VbenModal from './modal.vue';
import { ModalApi } from './modal-api';
import VbenModal from './modal.vue';
const USER_MODAL_INJECT_KEY = Symbol('VBEN_MODAL_INJECT');

View File

@@ -1,16 +1,17 @@
<script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import type {
AvatarFallbackProps,
AvatarImageProps,
AvatarRootProps,
} from 'radix-vue';
import type { ClassType } from '@vben-core/typings';
import { computed } from 'vue';
import { Avatar, AvatarFallback, AvatarImage } from '../../ui';
interface Props extends AvatarRootProps, AvatarFallbackProps, AvatarImageProps {
interface Props extends AvatarFallbackProps, AvatarImageProps, AvatarRootProps {
alt?: string;
class?: ClassType;
dot?: boolean;

View File

@@ -3,8 +3,8 @@ import type { BreadcrumbProps } from './types';
import { useForwardPropsEmits } from 'radix-vue';
import Breadcrumb from './breadcrumb.vue';
import BreadcrumbBackground from './breadcrumb-background.vue';
import Breadcrumb from './breadcrumb.vue';
interface Props extends BreadcrumbProps {
class?: any;

View File

@@ -1,7 +1,7 @@
import type { BreadcrumbStyleType } from '@vben-core/typings';
import type { Component } from 'vue';
import type { BreadcrumbStyleType } from '@vben-core/typings';
export interface IBreadcrumb {
icon?: Component | string;
isHome?: boolean;

View File

@@ -1,9 +1,9 @@
import type { AsTag } from 'radix-vue';
import type { ButtonVariants, ButtonVariantSize } from '../../ui';
import type { Component } from 'vue';
import type { ButtonVariants, ButtonVariantSize } from '../../ui';
export interface VbenButtonProps {
/**
* The element or component this component should render as. Can be overwrite by `asChild`

View File

@@ -1,11 +1,12 @@
<script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import type {
ContextMenuContentProps,
ContextMenuRootEmits,
ContextMenuRootProps,
} from 'radix-vue';
import type { ClassType } from '@vben-core/typings';
import type { IContextMenuItem } from './interface';
import { computed } from 'vue';
@@ -22,14 +23,14 @@ import {
} from '../../ui/context-menu';
const props = defineProps<
{
ContextMenuRootProps & {
class?: ClassType;
contentClass?: ClassType;
contentProps?: ContextMenuContentProps;
handlerData?: Record<string, any>;
itemClass?: ClassType;
menus: (data: any) => IContextMenuItem[];
} & ContextMenuRootProps
}
>();
const emits = defineEmits<ContextMenuRootEmits>();

View File

@@ -1,11 +1,12 @@
<script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import type {
HoverCardContentProps,
HoverCardRootEmits,
HoverCardRootProps,
} from 'radix-vue';
import type { ClassType } from '@vben-core/typings';
import { computed } from 'vue';
import { useForwardPropsEmits } from 'radix-vue';

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
import { type Component, computed } from 'vue';
import type { Component } from 'vue';
import { computed } from 'vue';
import { IconDefault, IconifyIcon } from '@vben-core/icons';
import {

View File

@@ -1,11 +1,12 @@
<script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import type {
PopoverContentProps,
PopoverRootEmits,
PopoverRootProps,
} from 'radix-vue';
import type { ClassType } from '@vben-core/typings';
import { computed } from 'vue';
import { useForwardPropsEmits } from 'radix-vue';

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import type { Component, PropType } from 'vue';
import { defineComponent, h } from 'vue';
import { isFunction, isObject } from '@vben-core/shared/utils';

View File

@@ -7,7 +7,7 @@ import { cn } from '@vben-core/shared/utils';
import { TabsIndicator, useForwardProps } from 'radix-vue';
const props = defineProps<{ class?: any } & TabsIndicatorProps>();
const props = defineProps<TabsIndicatorProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -1,9 +1,10 @@
<script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import type { TooltipContentProps } from 'radix-vue';
import type { StyleValue } from 'vue';
import type { ClassType } from '@vben-core/typings';
import {
Tooltip,
TooltipContent,

View File

@@ -1,10 +1,7 @@
<script setup lang="ts">
import {
AccordionRoot,
type AccordionRootEmits,
type AccordionRootProps,
useForwardPropsEmits,
} from 'radix-vue';
import type { AccordionRootEmits, AccordionRootProps } from 'radix-vue';
import { AccordionRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<AccordionRootProps>();
const emits = defineEmits<AccordionRootEmits>();

View File

@@ -1,11 +1,13 @@
<script setup lang="ts">
import type { AccordionContentProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { AccordionContent, type AccordionContentProps } from 'radix-vue';
import { AccordionContent } from 'radix-vue';
const props = defineProps<{ class?: any } & AccordionContentProps>();
const props = defineProps<AccordionContentProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -1,15 +1,13 @@
<script setup lang="ts">
import type { AccordionItemProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
AccordionItem,
type AccordionItemProps,
useForwardProps,
} from 'radix-vue';
import { AccordionItem, useForwardProps } from 'radix-vue';
const props = defineProps<{ class?: any } & AccordionItemProps>();
const props = defineProps<AccordionItemProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -1,16 +1,14 @@
<script setup lang="ts">
import type { AccordionTriggerProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { ChevronDown } from 'lucide-vue-next';
import {
AccordionHeader,
AccordionTrigger,
type AccordionTriggerProps,
} from 'radix-vue';
import { AccordionHeader, AccordionTrigger } from 'radix-vue';
const props = defineProps<{ class?: any } & AccordionTriggerProps>();
const props = defineProps<AccordionTriggerProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -1,9 +1,11 @@
<script setup lang="ts">
import type { AvatarVariants } from './avatar';
import { cn } from '@vben-core/shared/utils';
import { AvatarRoot } from 'radix-vue';
import { avatarVariant, type AvatarVariants } from './avatar';
import { avatarVariant } from './avatar';
const props = withDefaults(
defineProps<{

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
import { AvatarFallback, type AvatarFallbackProps } from 'radix-vue';
import type { AvatarFallbackProps } from 'radix-vue';
import { AvatarFallback } from 'radix-vue';
const props = defineProps<AvatarFallbackProps>();
</script>

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
import { AvatarImage, type AvatarImageProps } from 'radix-vue';
import type { AvatarImageProps } from 'radix-vue';
import { AvatarImage } from 'radix-vue';
const props = defineProps<AvatarImageProps>();
</script>

View File

@@ -1,4 +1,6 @@
import { cva, type VariantProps } from 'class-variance-authority';
import type { VariantProps } from 'class-variance-authority';
import { cva } from 'class-variance-authority';
export const avatarVariant = cva(
'inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden',

View File

@@ -1,7 +1,9 @@
<script setup lang="ts">
import type { BadgeVariants } from './badge';
import { cn } from '@vben-core/shared/utils';
import { type BadgeVariants, badgeVariants } from './badge';
import { badgeVariants } from './badge';
const props = defineProps<{
class?: any;

View File

@@ -1,4 +1,6 @@
import { cva, type VariantProps } from 'class-variance-authority';
import type { VariantProps } from 'class-variance-authority';
import { cva } from 'class-variance-authority';
export const badgeVariants = cva(
'inline-flex items-center rounded-md border border-border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',

View File

@@ -1,9 +1,11 @@
<script lang="ts" setup>
import type { PrimitiveProps } from 'radix-vue';
import { cn } from '@vben-core/shared/utils';
import { Primitive, type PrimitiveProps } from 'radix-vue';
import { Primitive } from 'radix-vue';
const props = withDefaults(defineProps<{ class?: any } & PrimitiveProps>(), {
const props = withDefaults(defineProps<PrimitiveProps & { class?: any }>(), {
as: 'a',
});
</script>

View File

@@ -1,9 +1,11 @@
<script setup lang="ts">
import type { PrimitiveProps } from 'radix-vue';
import type { ButtonVariants, ButtonVariantSize } from './types';
import { cn } from '@vben-core/shared/utils';
import { Primitive, type PrimitiveProps } from 'radix-vue';
import { Primitive } from 'radix-vue';
import { buttonVariants } from './button';

View File

@@ -12,7 +12,7 @@ import {
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<{ class?: any } & CheckboxRootProps>();
const props = defineProps<CheckboxRootProps & { class?: any }>();
const emits = defineEmits<CheckboxRootEmits>();
const delegatedProps = computed(() => {

View File

@@ -1,4 +1,9 @@
<script setup lang="ts">
import type {
ContextMenuCheckboxItemEmits,
ContextMenuCheckboxItemProps,
} from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
@@ -6,13 +11,11 @@ import { cn } from '@vben-core/shared/utils';
import { Check } from 'lucide-vue-next';
import {
ContextMenuCheckboxItem,
type ContextMenuCheckboxItemEmits,
type ContextMenuCheckboxItemProps,
ContextMenuItemIndicator,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<{ class?: any } & ContextMenuCheckboxItemProps>();
const props = defineProps<ContextMenuCheckboxItemProps & { class?: any }>();
const emits = defineEmits<ContextMenuCheckboxItemEmits>();
const delegatedProps = computed(() => {

View File

@@ -1,17 +1,20 @@
<script setup lang="ts">
import type {
ContextMenuContentEmits,
ContextMenuContentProps,
} from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
ContextMenuContent,
type ContextMenuContentEmits,
type ContextMenuContentProps,
ContextMenuPortal,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<{ class?: any } & ContextMenuContentProps>();
const props = defineProps<ContextMenuContentProps & { class?: any }>();
const emits = defineEmits<ContextMenuContentEmits>();
const delegatedProps = computed(() => {

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
import { ContextMenuGroup, type ContextMenuGroupProps } from 'radix-vue';
import type { ContextMenuGroupProps } from 'radix-vue';
import { ContextMenuGroup } from 'radix-vue';
const props = defineProps<ContextMenuGroupProps>();
</script>

View File

@@ -1,17 +1,14 @@
<script setup lang="ts">
import type { ContextMenuItemEmits, ContextMenuItemProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
ContextMenuItem,
type ContextMenuItemEmits,
type ContextMenuItemProps,
useForwardPropsEmits,
} from 'radix-vue';
import { ContextMenuItem, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<
{ class?: any; inset?: boolean } & ContextMenuItemProps
ContextMenuItemProps & { class?: any; inset?: boolean }
>();
const emits = defineEmits<ContextMenuItemEmits>();

View File

@@ -1,12 +1,14 @@
<script setup lang="ts">
import type { ContextMenuLabelProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { ContextMenuLabel, type ContextMenuLabelProps } from 'radix-vue';
import { ContextMenuLabel } from 'radix-vue';
const props = defineProps<
{ class?: any; inset?: boolean } & ContextMenuLabelProps
ContextMenuLabelProps & { class?: any; inset?: boolean }
>();
const delegatedProps = computed(() => {

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
import { ContextMenuPortal, type ContextMenuPortalProps } from 'radix-vue';
import type { ContextMenuPortalProps } from 'radix-vue';
import { ContextMenuPortal } from 'radix-vue';
const props = defineProps<ContextMenuPortalProps>();
</script>

View File

@@ -1,11 +1,11 @@
<script setup lang="ts">
import {
ContextMenuRadioGroup,
type ContextMenuRadioGroupEmits,
type ContextMenuRadioGroupProps,
useForwardPropsEmits,
import type {
ContextMenuRadioGroupEmits,
ContextMenuRadioGroupProps,
} from 'radix-vue';
import { ContextMenuRadioGroup, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<ContextMenuRadioGroupProps>();
const emits = defineEmits<ContextMenuRadioGroupEmits>();

View File

@@ -1,4 +1,9 @@
<script setup lang="ts">
import type {
ContextMenuRadioItemEmits,
ContextMenuRadioItemProps,
} from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
@@ -7,12 +12,10 @@ import { Circle } from 'lucide-vue-next';
import {
ContextMenuItemIndicator,
ContextMenuRadioItem,
type ContextMenuRadioItemEmits,
type ContextMenuRadioItemProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<{ class?: any } & ContextMenuRadioItemProps>();
const props = defineProps<ContextMenuRadioItemProps & { class?: any }>();
const emits = defineEmits<ContextMenuRadioItemEmits>();
const delegatedProps = computed(() => {

View File

@@ -1,14 +1,13 @@
<script setup lang="ts">
import type { ContextMenuSeparatorProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
ContextMenuSeparator,
type ContextMenuSeparatorProps,
} from 'radix-vue';
import { ContextMenuSeparator } from 'radix-vue';
const props = defineProps<{ class?: any } & ContextMenuSeparatorProps>();
const props = defineProps<ContextMenuSeparatorProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -1,10 +1,7 @@
<script setup lang="ts">
import {
ContextMenuSub,
type ContextMenuSubEmits,
type ContextMenuSubProps,
useForwardPropsEmits,
} from 'radix-vue';
import type { ContextMenuSubEmits, ContextMenuSubProps } from 'radix-vue';
import { ContextMenuSub, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<ContextMenuSubProps>();
const emits = defineEmits<ContextMenuSubEmits>();

View File

@@ -1,16 +1,16 @@
<script setup lang="ts">
import type {
DropdownMenuSubContentEmits,
DropdownMenuSubContentProps,
} from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
ContextMenuSubContent,
type DropdownMenuSubContentEmits,
type DropdownMenuSubContentProps,
useForwardPropsEmits,
} from 'radix-vue';
import { ContextMenuSubContent, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<{ class?: any } & DropdownMenuSubContentProps>();
const props = defineProps<DropdownMenuSubContentProps & { class?: any }>();
const emits = defineEmits<DropdownMenuSubContentEmits>();
const delegatedProps = computed(() => {

View File

@@ -1,20 +1,18 @@
<script setup lang="ts">
import type { ContextMenuSubTriggerProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { ChevronRight } from 'lucide-vue-next';
import {
ContextMenuSubTrigger,
type ContextMenuSubTriggerProps,
useForwardProps,
} from 'radix-vue';
import { ContextMenuSubTrigger, useForwardProps } from 'radix-vue';
const props = defineProps<
{
ContextMenuSubTriggerProps & {
class?: any;
inset?: boolean;
} & ContextMenuSubTriggerProps
}
>();
const delegatedProps = computed(() => {

View File

@@ -1,9 +1,7 @@
<script setup lang="ts">
import {
ContextMenuTrigger,
type ContextMenuTriggerProps,
useForwardProps,
} from 'radix-vue';
import type { ContextMenuTriggerProps } from 'radix-vue';
import { ContextMenuTrigger, useForwardProps } from 'radix-vue';
const props = defineProps<ContextMenuTriggerProps>();

View File

@@ -1,10 +1,7 @@
<script setup lang="ts">
import {
DialogRoot,
type DialogRootEmits,
type DialogRootProps,
useForwardPropsEmits,
} from 'radix-vue';
import type { DialogRootEmits, DialogRootProps } from 'radix-vue';
import { DialogRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<DialogRootProps>();
const emits = defineEmits<DialogRootEmits>();

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
import { DialogClose, type DialogCloseProps } from 'radix-vue';
import type { DialogCloseProps } from 'radix-vue';
import { DialogClose } from 'radix-vue';
const props = defineProps<DialogCloseProps>();
</script>

View File

@@ -1,4 +1,6 @@
<script setup lang="ts">
import type { DialogContentEmits, DialogContentProps } from 'radix-vue';
import type { ClassType } from '@vben-core/typings';
import { computed, ref } from 'vue';
@@ -9,8 +11,6 @@ import { X } from 'lucide-vue-next';
import {
DialogClose,
DialogContent,
type DialogContentEmits,
type DialogContentProps,
DialogPortal,
useForwardPropsEmits,
} from 'radix-vue';
@@ -19,7 +19,7 @@ import DialogOverlay from './DialogOverlay.vue';
const props = withDefaults(
defineProps<
{
DialogContentProps & {
appendTo?: HTMLElement | string;
class?: ClassType;
closeClass?: ClassType;
@@ -27,12 +27,12 @@ const props = withDefaults(
open?: boolean;
showClose?: boolean;
zIndex?: number;
} & DialogContentProps
}
>(),
{ appendTo: 'body', showClose: true, zIndex: 1000 },
);
const emits = defineEmits<
{ close: []; closed: []; opened: [] } & DialogContentEmits
DialogContentEmits & { close: []; closed: []; opened: [] }
>();
const delegatedProps = computed(() => {

View File

@@ -1,15 +1,13 @@
<script setup lang="ts">
import type { DialogDescriptionProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
DialogDescription,
type DialogDescriptionProps,
useForwardProps,
} from 'radix-vue';
import { DialogDescription, useForwardProps } from 'radix-vue';
const props = defineProps<{ class?: any } & DialogDescriptionProps>();
const props = defineProps<DialogDescriptionProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -1,4 +1,6 @@
<script setup lang="ts">
import type { DialogContentEmits, DialogContentProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
@@ -7,15 +9,13 @@ import { X } from 'lucide-vue-next';
import {
DialogClose,
DialogContent,
type DialogContentEmits,
type DialogContentProps,
DialogOverlay,
DialogPortal,
useForwardPropsEmits,
} from 'radix-vue';
const props = withDefaults(
defineProps<{ class?: any; zIndex?: number } & DialogContentProps>(),
defineProps<DialogContentProps & { class?: any; zIndex?: number }>(),
{ zIndex: 1000 },
);
const emits = defineEmits<DialogContentEmits>();

View File

@@ -1,11 +1,13 @@
<script setup lang="ts">
import type { DialogTitleProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { DialogTitle, type DialogTitleProps, useForwardProps } from 'radix-vue';
import { DialogTitle, useForwardProps } from 'radix-vue';
const props = defineProps<{ class?: any } & DialogTitleProps>();
const props = defineProps<DialogTitleProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
import { DialogTrigger, type DialogTriggerProps } from 'radix-vue';
import type { DialogTriggerProps } from 'radix-vue';
import { DialogTrigger } from 'radix-vue';
const props = defineProps<DialogTriggerProps>();
</script>

View File

@@ -1,10 +1,7 @@
<script setup lang="ts">
import {
DropdownMenuRoot,
type DropdownMenuRootEmits,
type DropdownMenuRootProps,
useForwardPropsEmits,
} from 'radix-vue';
import type { DropdownMenuRootEmits, DropdownMenuRootProps } from 'radix-vue';
import { DropdownMenuRoot, useForwardPropsEmits } from 'radix-vue';
const props = withDefaults(defineProps<DropdownMenuRootProps>(), {
modal: false,

View File

@@ -1,4 +1,9 @@
<script setup lang="ts">
import type {
DropdownMenuCheckboxItemEmits,
DropdownMenuCheckboxItemProps,
} from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
@@ -6,13 +11,11 @@ import { cn } from '@vben-core/shared/utils';
import { Check } from 'lucide-vue-next';
import {
DropdownMenuCheckboxItem,
type DropdownMenuCheckboxItemEmits,
type DropdownMenuCheckboxItemProps,
DropdownMenuItemIndicator,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<{ class?: any } & DropdownMenuCheckboxItemProps>();
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: any }>();
const emits = defineEmits<DropdownMenuCheckboxItemEmits>();
const delegatedProps = computed(() => {

View File

@@ -1,18 +1,21 @@
<script setup lang="ts">
import type {
DropdownMenuContentEmits,
DropdownMenuContentProps,
} from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
DropdownMenuContent,
type DropdownMenuContentEmits,
type DropdownMenuContentProps,
DropdownMenuPortal,
useForwardPropsEmits,
} from 'radix-vue';
const props = withDefaults(
defineProps<{ class?: any } & DropdownMenuContentProps>(),
defineProps<DropdownMenuContentProps & { class?: any }>(),
{
sideOffset: 4,
},

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
import { DropdownMenuGroup, type DropdownMenuGroupProps } from 'radix-vue';
import type { DropdownMenuGroupProps } from 'radix-vue';
import { DropdownMenuGroup } from 'radix-vue';
const props = defineProps<DropdownMenuGroupProps>();
</script>

View File

@@ -1,16 +1,14 @@
<script setup lang="ts">
import type { DropdownMenuItemProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
DropdownMenuItem,
type DropdownMenuItemProps,
useForwardProps,
} from 'radix-vue';
import { DropdownMenuItem, useForwardProps } from 'radix-vue';
const props = defineProps<
{ class?: any; inset?: boolean } & DropdownMenuItemProps
DropdownMenuItemProps & { class?: any; inset?: boolean }
>();
const delegatedProps = computed(() => {

View File

@@ -1,16 +1,14 @@
<script setup lang="ts">
import type { DropdownMenuLabelProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
DropdownMenuLabel,
type DropdownMenuLabelProps,
useForwardProps,
} from 'radix-vue';
import { DropdownMenuLabel, useForwardProps } from 'radix-vue';
const props = defineProps<
{ class?: any; inset?: boolean } & DropdownMenuLabelProps
DropdownMenuLabelProps & { class?: any; inset?: boolean }
>();
const delegatedProps = computed(() => {

View File

@@ -1,11 +1,11 @@
<script setup lang="ts">
import {
DropdownMenuRadioGroup,
type DropdownMenuRadioGroupEmits,
type DropdownMenuRadioGroupProps,
useForwardPropsEmits,
import type {
DropdownMenuRadioGroupEmits,
DropdownMenuRadioGroupProps,
} from 'radix-vue';
import { DropdownMenuRadioGroup, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<DropdownMenuRadioGroupProps>();
const emits = defineEmits<DropdownMenuRadioGroupEmits>();

View File

@@ -1,4 +1,9 @@
<script setup lang="ts">
import type {
DropdownMenuRadioItemEmits,
DropdownMenuRadioItemProps,
} from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
@@ -7,12 +12,10 @@ import { Circle } from 'lucide-vue-next';
import {
DropdownMenuItemIndicator,
DropdownMenuRadioItem,
type DropdownMenuRadioItemEmits,
type DropdownMenuRadioItemProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<{ class?: any } & DropdownMenuRadioItemProps>();
const props = defineProps<DropdownMenuRadioItemProps & { class?: any }>();
const emits = defineEmits<DropdownMenuRadioItemEmits>();

View File

@@ -1,17 +1,16 @@
<script setup lang="ts">
import type { DropdownMenuSeparatorProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
DropdownMenuSeparator,
type DropdownMenuSeparatorProps,
} from 'radix-vue';
import { DropdownMenuSeparator } from 'radix-vue';
const props = defineProps<
{
DropdownMenuSeparatorProps & {
class?: any;
} & DropdownMenuSeparatorProps
}
>();
const delegatedProps = computed(() => {

View File

@@ -1,10 +1,7 @@
<script setup lang="ts">
import {
DropdownMenuSub,
type DropdownMenuSubEmits,
type DropdownMenuSubProps,
useForwardPropsEmits,
} from 'radix-vue';
import type { DropdownMenuSubEmits, DropdownMenuSubProps } from 'radix-vue';
import { DropdownMenuSub, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<DropdownMenuSubProps>();
const emits = defineEmits<DropdownMenuSubEmits>();

View File

@@ -1,16 +1,16 @@
<script setup lang="ts">
import type {
DropdownMenuSubContentEmits,
DropdownMenuSubContentProps,
} from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
DropdownMenuSubContent,
type DropdownMenuSubContentEmits,
type DropdownMenuSubContentProps,
useForwardPropsEmits,
} from 'radix-vue';
import { DropdownMenuSubContent, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<{ class?: any } & DropdownMenuSubContentProps>();
const props = defineProps<DropdownMenuSubContentProps & { class?: any }>();
const emits = defineEmits<DropdownMenuSubContentEmits>();
const delegatedProps = computed(() => {

View File

@@ -1,16 +1,14 @@
<script setup lang="ts">
import type { DropdownMenuSubTriggerProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { ChevronRight } from 'lucide-vue-next';
import {
DropdownMenuSubTrigger,
type DropdownMenuSubTriggerProps,
useForwardProps,
} from 'radix-vue';
import { DropdownMenuSubTrigger, useForwardProps } from 'radix-vue';
const props = defineProps<{ class?: any } & DropdownMenuSubTriggerProps>();
const props = defineProps<DropdownMenuSubTriggerProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -1,9 +1,7 @@
<script setup lang="ts">
import {
DropdownMenuTrigger,
type DropdownMenuTriggerProps,
useForwardProps,
} from 'radix-vue';
import type { DropdownMenuTriggerProps } from 'radix-vue';
import { DropdownMenuTrigger, useForwardProps } from 'radix-vue';
const props = defineProps<DropdownMenuTriggerProps>();

View File

@@ -6,7 +6,7 @@ import { cn } from '@vben-core/shared/utils';
import { Label } from '../label';
import { useFormField } from './useFormField';
const props = defineProps<{ class?: any } & LabelProps>();
const props = defineProps<LabelProps & { class?: any }>();
const { formItemId } = useFormField();
</script>

View File

@@ -5,7 +5,7 @@ export { default as FormLabel } from './FormLabel.vue';
export { default as FormMessage } from './FormMessage.vue';
export { FORM_ITEM_INJECTION_KEY } from './injectionKeys';
export {
Form,
Field as FormField,
FieldArray as FormFieldArray,
Form,
} from 'vee-validate';

View File

@@ -1,10 +1,7 @@
<script setup lang="ts">
import {
HoverCardRoot,
type HoverCardRootEmits,
type HoverCardRootProps,
useForwardPropsEmits,
} from 'radix-vue';
import type { HoverCardRootEmits, HoverCardRootProps } from 'radix-vue';
import { HoverCardRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<HoverCardRootProps>();
const emits = defineEmits<HoverCardRootEmits>();

View File

@@ -1,17 +1,14 @@
<script setup lang="ts">
import type { HoverCardContentProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import {
HoverCardContent,
type HoverCardContentProps,
HoverCardPortal,
useForwardProps,
} from 'radix-vue';
import { HoverCardContent, HoverCardPortal, useForwardProps } from 'radix-vue';
const props = withDefaults(
defineProps<{ class?: any } & HoverCardContentProps>(),
defineProps<HoverCardContentProps & { class?: any }>(),
{
sideOffset: 4,
},

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
import { HoverCardTrigger, type HoverCardTriggerProps } from 'radix-vue';
import type { HoverCardTriggerProps } from 'radix-vue';
import { HoverCardTrigger } from 'radix-vue';
const props = defineProps<HoverCardTriggerProps>();
</script>

View File

@@ -1,11 +1,13 @@
<script setup lang="ts">
import type { LabelProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { Label, type LabelProps } from 'radix-vue';
import { Label } from 'radix-vue';
const props = defineProps<{ class?: any } & LabelProps>();
const props = defineProps<LabelProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -7,7 +7,7 @@ import { cn } from '@vben-core/shared/utils';
import { NumberFieldRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<{ class?: any } & NumberFieldRootProps>();
const props = defineProps<NumberFieldRootProps & { class?: any }>();
const emits = defineEmits<NumberFieldRootEmits>();
const delegatedProps = computed(() => {

View File

@@ -8,7 +8,7 @@ import { cn } from '@vben-core/shared/utils';
import { Minus } from 'lucide-vue-next';
import { NumberFieldDecrement, useForwardProps } from 'radix-vue';
const props = defineProps<{ class?: any } & NumberFieldDecrementProps>();
const props = defineProps<NumberFieldDecrementProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -8,7 +8,7 @@ import { cn } from '@vben-core/shared/utils';
import { Plus } from 'lucide-vue-next';
import { NumberFieldIncrement, useForwardProps } from 'radix-vue';
const props = defineProps<{ class?: any } & NumberFieldIncrementProps>();
const props = defineProps<NumberFieldIncrementProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -1,12 +1,14 @@
<script setup lang="ts">
import type { PaginationEllipsisProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { MoreHorizontal } from 'lucide-vue-next';
import { PaginationEllipsis, type PaginationEllipsisProps } from 'radix-vue';
import { PaginationEllipsis } from 'radix-vue';
const props = defineProps<{ class?: any } & PaginationEllipsisProps>();
const props = defineProps<PaginationEllipsisProps & { class?: any }>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;

View File

@@ -1,15 +1,17 @@
<script setup lang="ts">
import type { PaginationFirstProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { ChevronsLeft } from 'lucide-vue-next';
import { PaginationFirst, type PaginationFirstProps } from 'radix-vue';
import { PaginationFirst } from 'radix-vue';
import { Button } from '../button';
const props = withDefaults(
defineProps<{ class?: any } & PaginationFirstProps>(),
defineProps<PaginationFirstProps & { class?: any }>(),
{
asChild: true,
},

View File

@@ -1,15 +1,17 @@
<script setup lang="ts">
import type { PaginationLastProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { ChevronsRight } from 'lucide-vue-next';
import { PaginationLast, type PaginationLastProps } from 'radix-vue';
import { PaginationLast } from 'radix-vue';
import { Button } from '../button';
const props = withDefaults(
defineProps<{ class?: any } & PaginationLastProps>(),
defineProps<PaginationLastProps & { class?: any }>(),
{
asChild: true,
},

View File

@@ -1,15 +1,17 @@
<script setup lang="ts">
import type { PaginationNextProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { ChevronRight } from 'lucide-vue-next';
import { PaginationNext, type PaginationNextProps } from 'radix-vue';
import { PaginationNext } from 'radix-vue';
import { Button } from '../button';
const props = withDefaults(
defineProps<{ class?: any } & PaginationNextProps>(),
defineProps<PaginationNextProps & { class?: any }>(),
{
asChild: true,
},

View File

@@ -1,15 +1,17 @@
<script setup lang="ts">
import type { PaginationPrevProps } from 'radix-vue';
import { computed } from 'vue';
import { cn } from '@vben-core/shared/utils';
import { ChevronLeft } from 'lucide-vue-next';
import { PaginationPrev, type PaginationPrevProps } from 'radix-vue';
import { PaginationPrev } from 'radix-vue';
import { Button } from '../button';
const props = withDefaults(
defineProps<{ class?: any } & PaginationPrevProps>(),
defineProps<PaginationPrevProps & { class?: any }>(),
{
asChild: true,
},

View File

@@ -4,7 +4,7 @@ export { default as PaginationLast } from './PaginationLast.vue';
export { default as PaginationNext } from './PaginationNext.vue';
export { default as PaginationPrev } from './PaginationPrev.vue';
export {
PaginationRoot as Pagination,
PaginationList,
PaginationListItem,
PaginationRoot as Pagination,
} from 'radix-vue';

Some files were not shown because too many files have changed in this diff Show More