mirror of
https://gitee.com/yudaocode/yudao-ui-admin-vben.git
synced 2025-12-30 10:32:25 +00:00
Merge branch 'main' into fix-downloader
This commit is contained in:
@@ -24,3 +24,5 @@ export const VBEN_ELE_PREVIEW_URL = 'https://ele.vben.pro';
|
||||
export const VBEN_NAIVE_PREVIEW_URL = 'https://naive.vben.pro';
|
||||
|
||||
export const VBEN_ANT_PREVIEW_URL = 'https://ant.vben.pro';
|
||||
|
||||
export const VBEN_TD_PREVIEW_URL = 'https://tdesign.vben.pro';
|
||||
|
||||
143
packages/@core/base/shared/src/utils/__tests__/date.test.ts
Normal file
143
packages/@core/base/shared/src/utils/__tests__/date.test.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import dayjs from 'dayjs';
|
||||
import timezone from 'dayjs/plugin/timezone';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import {
|
||||
formatDate,
|
||||
formatDateTime,
|
||||
getCurrentTimezone,
|
||||
getSystemTimezone,
|
||||
isDate,
|
||||
isDayjsObject,
|
||||
setCurrentTimezone,
|
||||
} from '../date';
|
||||
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
|
||||
describe('dateUtils', () => {
|
||||
const sampleISO = '2024-10-30T12:34:56Z';
|
||||
const sampleTimestamp = Date.parse(sampleISO);
|
||||
|
||||
beforeEach(() => {
|
||||
// 重置时区
|
||||
dayjs.tz.setDefault();
|
||||
setCurrentTimezone(); // 重置为系统默认
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
// ===============================
|
||||
// formatDate
|
||||
// ===============================
|
||||
describe('formatDate', () => {
|
||||
it('should format a valid ISO date string', () => {
|
||||
const formatted = formatDate(sampleISO, 'YYYY/MM/DD');
|
||||
expect(formatted).toMatch(/2024\/10\/30/);
|
||||
});
|
||||
|
||||
it('should format a timestamp correctly', () => {
|
||||
const formatted = formatDate(sampleTimestamp);
|
||||
expect(formatted).toMatch(/2024-10-30/);
|
||||
});
|
||||
|
||||
it('should format a Date object', () => {
|
||||
const formatted = formatDate(new Date(sampleISO));
|
||||
expect(formatted).toMatch(/2024-10-30/);
|
||||
});
|
||||
|
||||
it('should format a dayjs object', () => {
|
||||
const formatted = formatDate(dayjs(sampleISO));
|
||||
expect(formatted).toMatch(/2024-10-30/);
|
||||
});
|
||||
|
||||
it('should return original input if date is invalid', () => {
|
||||
const invalid = 'not-a-date';
|
||||
const spy = vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
const formatted = formatDate(invalid);
|
||||
expect(formatted).toBe(invalid);
|
||||
expect(spy).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
it('should apply given format', () => {
|
||||
const formatted = formatDate(sampleISO, 'YYYY-MM-DD HH:mm');
|
||||
expect(formatted).toMatch(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}/);
|
||||
});
|
||||
});
|
||||
|
||||
// ===============================
|
||||
// formatDateTime
|
||||
// ===============================
|
||||
describe('formatDateTime', () => {
|
||||
it('should format date into full datetime', () => {
|
||||
const result = formatDateTime(sampleISO);
|
||||
expect(result).toMatch(/2024-10-30 \d{2}:\d{2}:\d{2}/);
|
||||
});
|
||||
});
|
||||
|
||||
// ===============================
|
||||
// isDate
|
||||
// ===============================
|
||||
describe('isDate', () => {
|
||||
it('should return true for Date instances', () => {
|
||||
expect(isDate(new Date())).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for non-Date values', () => {
|
||||
expect(isDate('2024-10-30')).toBe(false);
|
||||
expect(isDate(null)).toBe(false);
|
||||
expect(isDate(undefined)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
// ===============================
|
||||
// isDayjsObject
|
||||
// ===============================
|
||||
describe('isDayjsObject', () => {
|
||||
it('should return true for dayjs objects', () => {
|
||||
expect(isDayjsObject(dayjs())).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for other values', () => {
|
||||
expect(isDayjsObject(new Date())).toBe(false);
|
||||
expect(isDayjsObject('string')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
// ===============================
|
||||
// getSystemTimezone
|
||||
// ===============================
|
||||
describe('getSystemTimezone', () => {
|
||||
it('should return a valid IANA timezone string', () => {
|
||||
const tz = getSystemTimezone();
|
||||
expect(typeof tz).toBe('string');
|
||||
expect(tz).toMatch(/^[A-Z]+\/[A-Z_]+/i);
|
||||
});
|
||||
});
|
||||
|
||||
// ===============================
|
||||
// setCurrentTimezone / getCurrentTimezone
|
||||
// ===============================
|
||||
describe('setCurrentTimezone & getCurrentTimezone', () => {
|
||||
it('should set and retrieve the current timezone', () => {
|
||||
setCurrentTimezone('Asia/Shanghai');
|
||||
expect(getCurrentTimezone()).toBe('Asia/Shanghai');
|
||||
});
|
||||
|
||||
it('should reset to system timezone when called with no args', () => {
|
||||
const guessed = getSystemTimezone();
|
||||
setCurrentTimezone();
|
||||
expect(getCurrentTimezone()).toBe(guessed);
|
||||
});
|
||||
|
||||
it('should update dayjs default timezone', () => {
|
||||
setCurrentTimezone('America/New_York');
|
||||
const d = dayjs('2024-01-01T00:00:00Z');
|
||||
// 校验时区转换生效(小时变化)
|
||||
expect(d.tz().format('HH')).not.toBe('00');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,19 +1,38 @@
|
||||
import dayjs from 'dayjs';
|
||||
import timezone from 'dayjs/plugin/timezone';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
|
||||
export function formatDate(time: number | string, format = 'YYYY-MM-DD') {
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
|
||||
type FormatDate = Date | dayjs.Dayjs | number | string;
|
||||
|
||||
type Format =
|
||||
| 'HH'
|
||||
| 'HH:mm'
|
||||
| 'HH:mm:ss'
|
||||
| 'YYYY'
|
||||
| 'YYYY-MM'
|
||||
| 'YYYY-MM-DD'
|
||||
| 'YYYY-MM-DD HH'
|
||||
| 'YYYY-MM-DD HH:mm'
|
||||
| 'YYYY-MM-DD HH:mm:ss'
|
||||
| (string & {});
|
||||
|
||||
export function formatDate(time?: FormatDate, format: Format = 'YYYY-MM-DD') {
|
||||
try {
|
||||
const date = dayjs(time);
|
||||
const date = dayjs.isDayjs(time) ? time : dayjs(time);
|
||||
if (!date.isValid()) {
|
||||
throw new Error('Invalid date');
|
||||
}
|
||||
return date.format(format);
|
||||
return date.tz().format(format);
|
||||
} catch (error) {
|
||||
console.error(`Error formatting date: ${error}`);
|
||||
return time;
|
||||
return String(time ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
export function formatDateTime(time: number | string) {
|
||||
export function formatDateTime(time?: FormatDate) {
|
||||
return formatDate(time, 'YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
@@ -24,3 +43,33 @@ export function isDate(value: any): value is Date {
|
||||
export function isDayjsObject(value: any): value is dayjs.Dayjs {
|
||||
return dayjs.isDayjs(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时区
|
||||
* @returns 当前时区
|
||||
*/
|
||||
export const getSystemTimezone = () => {
|
||||
return dayjs.tz.guess();
|
||||
};
|
||||
|
||||
/**
|
||||
* 自定义设置的时区
|
||||
*/
|
||||
let currentTimezone = getSystemTimezone();
|
||||
|
||||
/**
|
||||
* 设置默认时区
|
||||
* @param timezone
|
||||
*/
|
||||
export const setCurrentTimezone = (timezone?: string) => {
|
||||
currentTimezone = timezone || getSystemTimezone();
|
||||
dayjs.tz.setDefault(currentTimezone);
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取设置的时区
|
||||
* @returns 设置的时区
|
||||
*/
|
||||
export const getCurrentTimezone = () => {
|
||||
return currentTimezone;
|
||||
};
|
||||
|
||||
10
packages/@core/base/typings/src/app.d.ts
vendored
10
packages/@core/base/typings/src/app.d.ts
vendored
@@ -93,6 +93,15 @@ type PageTransitionType = 'fade' | 'fade-down' | 'fade-slide' | 'fade-up';
|
||||
*/
|
||||
type AuthPageLayoutType = 'panel-center' | 'panel-left' | 'panel-right';
|
||||
|
||||
/**
|
||||
* 时区选项
|
||||
*/
|
||||
interface TimezoneOption {
|
||||
label: string;
|
||||
offset: number;
|
||||
timezone: string;
|
||||
}
|
||||
|
||||
export type {
|
||||
AccessModeType,
|
||||
AuthPageLayoutType,
|
||||
@@ -108,4 +117,5 @@ export type {
|
||||
PreferencesButtonPositionType,
|
||||
TabsStyleType,
|
||||
ThemeModeType,
|
||||
TimezoneOption,
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"dependencies": {
|
||||
"@vben-core/shared": "workspace:*",
|
||||
"@vueuse/core": "catalog:",
|
||||
"radix-vue": "catalog:",
|
||||
"reka-ui": "catalog:",
|
||||
"sortablejs": "catalog:",
|
||||
"vue": "catalog:"
|
||||
},
|
||||
|
||||
@@ -10,4 +10,4 @@ export {
|
||||
useForwardExpose,
|
||||
useForwardProps,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
@@ -133,6 +133,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
|
||||
"refresh": true,
|
||||
"sidebarToggle": true,
|
||||
"themeToggle": true,
|
||||
"timezone": true,
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -134,6 +134,7 @@ const defaultPreferences: Preferences = {
|
||||
refresh: true,
|
||||
sidebarToggle: true,
|
||||
themeToggle: true,
|
||||
timezone: true,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { BuiltinThemeType } from '@vben-core/typings';
|
||||
import type { BuiltinThemeType, TimezoneOption } from '@vben-core/typings';
|
||||
|
||||
interface BuiltinThemePreset {
|
||||
color: string;
|
||||
@@ -81,8 +81,39 @@ const BUILT_IN_THEME_PRESETS: BuiltinThemePreset[] = [
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 时区选项
|
||||
*/
|
||||
const DEFAULT_TIME_ZONE_OPTIONS: TimezoneOption[] = [
|
||||
{
|
||||
offset: -5,
|
||||
timezone: 'America/New_York',
|
||||
label: 'America/New_York(GMT-5)',
|
||||
},
|
||||
{
|
||||
offset: 0,
|
||||
timezone: 'Europe/London',
|
||||
label: 'Europe/London(GMT0)',
|
||||
},
|
||||
{
|
||||
offset: 8,
|
||||
timezone: 'Asia/Shanghai',
|
||||
label: 'Asia/Shanghai(GMT+8)',
|
||||
},
|
||||
{
|
||||
offset: 9,
|
||||
timezone: 'Asia/Tokyo',
|
||||
label: 'Asia/Tokyo(GMT+9)',
|
||||
},
|
||||
{
|
||||
offset: 9,
|
||||
timezone: 'Asia/Seoul',
|
||||
label: 'Asia/Seoul(GMT+9)',
|
||||
},
|
||||
];
|
||||
|
||||
export const COLOR_PRESETS = [...BUILT_IN_THEME_PRESETS].slice(0, 7);
|
||||
|
||||
export { BUILT_IN_THEME_PRESETS };
|
||||
export { BUILT_IN_THEME_PRESETS, DEFAULT_TIME_ZONE_OPTIONS };
|
||||
|
||||
export type { BuiltinThemePreset };
|
||||
|
||||
@@ -146,6 +146,8 @@ interface LogoPreferences {
|
||||
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
||||
/** logo地址 */
|
||||
source: string;
|
||||
/** 暗色主题logo地址 (可选,若不设置则使用 source) */
|
||||
sourceDark?: string;
|
||||
}
|
||||
|
||||
interface NavigationPreferences {
|
||||
@@ -275,6 +277,8 @@ interface WidgetPreferences {
|
||||
sidebarToggle: boolean;
|
||||
/** 是否显示主题切换部件 */
|
||||
themeToggle: boolean;
|
||||
/** 是否显示时区部件 */
|
||||
timezone: boolean;
|
||||
}
|
||||
|
||||
interface Preferences {
|
||||
|
||||
@@ -47,7 +47,7 @@ async function handleSubmit(e: Event) {
|
||||
return;
|
||||
}
|
||||
|
||||
const values = toRaw(await props.formApi.getValues());
|
||||
const values = toRaw(await props.formApi.getValues()) ?? {};
|
||||
await props.handleSubmit?.(values);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ async function handleReset(e: Event) {
|
||||
e?.stopPropagation();
|
||||
const props = unref(rootProps);
|
||||
|
||||
const values = toRaw(await props.formApi?.getValues());
|
||||
const values = toRaw(await props.formApi?.getValues()) ?? {};
|
||||
|
||||
if (isFunction(props.handleReset)) {
|
||||
await props.handleReset?.(values);
|
||||
|
||||
@@ -36,6 +36,7 @@ function getDefaultState(): VbenFormProps {
|
||||
handleReset: undefined,
|
||||
handleSubmit: undefined,
|
||||
handleValuesChange: undefined,
|
||||
handleCollapsedChange: undefined,
|
||||
layout: 'horizontal',
|
||||
resetButtonOptions: {},
|
||||
schema: [],
|
||||
|
||||
@@ -379,6 +379,10 @@ export interface VbenFormProps<
|
||||
* 表单字段映射
|
||||
*/
|
||||
fieldMappingTime?: FieldMappingTime;
|
||||
/**
|
||||
* 表单收起展开状态变化回调
|
||||
*/
|
||||
handleCollapsedChange?: (collapsed: boolean) => void;
|
||||
/**
|
||||
* 表单重置回调
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ import { useForm } from 'vee-validate';
|
||||
import { object, ZodIntersection, ZodNumber, ZodObject, ZodString } from 'zod';
|
||||
import { getDefaultsForSchema } from 'zod-defaults';
|
||||
|
||||
type ExtendFormProps = VbenFormProps & { formApi: ExtendedFormApi };
|
||||
type ExtendFormProps = VbenFormProps & { formApi?: ExtendedFormApi };
|
||||
|
||||
export const [injectFormProps, provideFormProps] =
|
||||
createContext<[ComputedRef<ExtendFormProps> | ExtendFormProps, FormActions]>(
|
||||
|
||||
@@ -40,7 +40,9 @@ const { delegatedSlots, form } = useFormInitial(props);
|
||||
provideFormProps([props, form]);
|
||||
|
||||
const handleUpdateCollapsed = (value: boolean) => {
|
||||
currentCollapsed.value = !!value;
|
||||
currentCollapsed.value = value;
|
||||
// 触发收起展开状态变化回调
|
||||
props.handleCollapsedChange?.(value);
|
||||
};
|
||||
|
||||
watchEffect(() => {
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
} from './use-form-context';
|
||||
// 通过 extends 会导致热更新卡死,所以重复写了一遍
|
||||
interface Props extends VbenFormProps {
|
||||
formApi: ExtendedFormApi;
|
||||
formApi?: ExtendedFormApi;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
@@ -44,11 +44,13 @@ provideComponentRefMap(componentRefMap);
|
||||
props.formApi?.mount?.(form, componentRefMap);
|
||||
|
||||
const handleUpdateCollapsed = (value: boolean) => {
|
||||
props.formApi?.setState({ collapsed: !!value });
|
||||
props.formApi?.setState({ collapsed: value });
|
||||
// 触发收起展开状态变化回调
|
||||
forward.value.handleCollapsedChange?.(value);
|
||||
};
|
||||
|
||||
function handleKeyDownEnter(event: KeyboardEvent) {
|
||||
if (!state.value.submitOnEnter || !forward.value.formApi?.isMounted) {
|
||||
if (!state?.value.submitOnEnter || !forward.value.formApi?.isMounted) {
|
||||
return;
|
||||
}
|
||||
// 如果是 textarea 不阻止默认行为,否则会导致无法换行。
|
||||
@@ -58,11 +60,11 @@ function handleKeyDownEnter(event: KeyboardEvent) {
|
||||
}
|
||||
event.preventDefault();
|
||||
|
||||
forward.value.formApi.validateAndSubmitForm();
|
||||
forward.value.formApi?.validateAndSubmitForm();
|
||||
}
|
||||
|
||||
const handleValuesChangeDebounced = useDebounceFn(async () => {
|
||||
state.value.submitOnChange && forward.value.formApi?.validateAndSubmitForm();
|
||||
state?.value.submitOnChange && forward.value.formApi?.validateAndSubmitForm();
|
||||
}, 300);
|
||||
|
||||
const valuesCache: Recordable<any> = {};
|
||||
@@ -74,7 +76,7 @@ onMounted(async () => {
|
||||
() => form.values,
|
||||
async (newVal) => {
|
||||
if (forward.value.handleValuesChange) {
|
||||
const fields = state.value.schema?.map((item) => {
|
||||
const fields = state?.value.schema?.map((item) => {
|
||||
return item.fieldName;
|
||||
});
|
||||
|
||||
@@ -91,8 +93,9 @@ onMounted(async () => {
|
||||
|
||||
if (changedFields.length > 0) {
|
||||
// 调用handleValuesChange回调,传入所有表单值的深拷贝和变更的字段列表
|
||||
const values = await forward.value.formApi?.getValues();
|
||||
forward.value.handleValuesChange(
|
||||
cloneDeep(await forward.value.formApi.getValues()),
|
||||
cloneDeep(values ?? {}) as Record<string, any>,
|
||||
changedFields,
|
||||
);
|
||||
}
|
||||
@@ -109,7 +112,7 @@ onMounted(async () => {
|
||||
<Form
|
||||
@keydown.enter="handleKeyDownEnter"
|
||||
v-bind="forward"
|
||||
:collapsed="state.collapsed"
|
||||
:collapsed="state?.collapsed"
|
||||
:component-bind-event-map="COMPONENT_BIND_EVENT_MAP"
|
||||
:component-map="COMPONENT_MAP"
|
||||
:form="form"
|
||||
@@ -126,7 +129,7 @@ onMounted(async () => {
|
||||
<slot v-bind="slotProps">
|
||||
<FormActions
|
||||
v-if="forward.showDefaultActions"
|
||||
:model-value="state.collapsed"
|
||||
:model-value="state?.collapsed"
|
||||
@update:model-value="handleUpdateCollapsed"
|
||||
>
|
||||
<template #reset-before="resetSlotProps">
|
||||
|
||||
@@ -209,7 +209,7 @@ onBeforeUnmount(() => {
|
||||
is(rootMenu.theme, true),
|
||||
opened ? '' : 'hidden',
|
||||
'overflow-auto',
|
||||
'max-h-[calc(var(--radix-hover-card-content-available-height)-20px)]',
|
||||
'max-h-[calc(var(--reka-hover-card-content-available-height)-20px)]',
|
||||
]"
|
||||
:content-props="contentProps"
|
||||
:open="true"
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
"@vueuse/core": "catalog:",
|
||||
"class-variance-authority": "catalog:",
|
||||
"lucide-vue-next": "catalog:",
|
||||
"radix-vue": "catalog:",
|
||||
"reka-ui": "catalog:",
|
||||
"vee-validate": "catalog:",
|
||||
"vue": "catalog:"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import type {
|
||||
AvatarFallbackProps,
|
||||
AvatarImageProps,
|
||||
AvatarRootProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import type { CSSProperties } from 'vue';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { BreadcrumbProps } from './types';
|
||||
|
||||
import { useForwardPropsEmits } from 'radix-vue';
|
||||
import { useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
import BreadcrumbBackground from './breadcrumb-background.vue';
|
||||
import Breadcrumb from './breadcrumb.vue';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { AsTag } from 'radix-vue';
|
||||
import type { AsTag } from 'reka-ui';
|
||||
|
||||
import type { Component } from 'vue';
|
||||
|
||||
@@ -13,7 +13,7 @@ export interface VbenButtonProps {
|
||||
/**
|
||||
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
||||
*
|
||||
* Read our [Composition](https://www.radix-vue.com/guides/composition.html) guide for more details.
|
||||
* Read our [Composition](https://www.reka-ui.com/docs/guides/composition) guide for more details.
|
||||
*/
|
||||
asChild?: boolean;
|
||||
class?: any;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { computed } from 'vue';
|
||||
import { LoaderCircle } from '@vben-core/icons';
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { Primitive } from 'radix-vue';
|
||||
import { Primitive } from 'reka-ui';
|
||||
|
||||
import { buttonVariants } from '../../ui';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
|
||||
import type { CheckboxRootEmits, CheckboxRootProps } from 'reka-ui';
|
||||
|
||||
import { useId } from 'vue';
|
||||
|
||||
import { useForwardPropsEmits } from 'radix-vue';
|
||||
import { useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
import { Checkbox } from '../../ui/checkbox';
|
||||
|
||||
@@ -11,7 +11,7 @@ const props = defineProps<CheckboxRootProps & { indeterminate?: boolean }>();
|
||||
|
||||
const emits = defineEmits<CheckboxRootEmits>();
|
||||
|
||||
const checked = defineModel<boolean>('checked');
|
||||
const checked = defineModel<boolean>();
|
||||
|
||||
const forwarded = useForwardPropsEmits(props, emits);
|
||||
|
||||
@@ -20,7 +20,7 @@ const id = useId();
|
||||
|
||||
<template>
|
||||
<div class="flex items-center">
|
||||
<Checkbox v-bind="forwarded" :id="id" v-model:checked="checked" />
|
||||
<Checkbox v-bind="forwarded" :id="id" v-model="checked" />
|
||||
<label :for="id" class="ml-2 cursor-pointer text-sm"> <slot></slot> </label>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -3,7 +3,7 @@ import type {
|
||||
ContextMenuContentProps,
|
||||
ContextMenuRootEmits,
|
||||
ContextMenuRootProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import type { ClassType } from '@vben-core/typings';
|
||||
|
||||
@@ -11,7 +11,7 @@ import type { IContextMenuItem } from './interface';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useForwardPropsEmits } from 'radix-vue';
|
||||
import { useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
import {
|
||||
ContextMenu,
|
||||
|
||||
@@ -3,13 +3,13 @@ import type {
|
||||
HoverCardContentProps,
|
||||
HoverCardRootEmits,
|
||||
HoverCardRootProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import type { ClassType } from '@vben-core/typings';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useForwardPropsEmits } from 'radix-vue';
|
||||
import { useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
import { HoverCard, HoverCardContent, HoverCardTrigger } from '../../ui';
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { default as VbenHoverCard } from './hover-card.vue';
|
||||
export type { HoverCardContentProps } from 'radix-vue';
|
||||
export type { HoverCardContentProps } from 'reka-ui';
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { VbenAvatar } from '../avatar';
|
||||
|
||||
interface Props {
|
||||
@@ -22,6 +24,10 @@ interface Props {
|
||||
* @zh_CN Logo 图标
|
||||
*/
|
||||
src?: string;
|
||||
/**
|
||||
* @zh_CN 暗色主题 Logo 图标 (可选,若不设置则使用 src)
|
||||
*/
|
||||
srcDark?: string;
|
||||
/**
|
||||
* @zh_CN Logo 文本
|
||||
*/
|
||||
@@ -36,14 +42,27 @@ defineOptions({
|
||||
name: 'VbenLogo',
|
||||
});
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
collapsed: false,
|
||||
href: 'javascript:void 0',
|
||||
logoSize: 32,
|
||||
src: '',
|
||||
srcDark: '',
|
||||
theme: 'light',
|
||||
fit: 'cover',
|
||||
});
|
||||
|
||||
/**
|
||||
* @zh_CN 根据主题选择合适的 logo 图标
|
||||
*/
|
||||
const logoSrc = computed(() => {
|
||||
// 如果是暗色主题且提供了 srcDark,则使用暗色主题的 logo
|
||||
if (props.theme === 'dark' && props.srcDark) {
|
||||
return props.srcDark;
|
||||
}
|
||||
// 否则使用默认的 src
|
||||
return props.src;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -54,9 +73,9 @@ withDefaults(defineProps<Props>(), {
|
||||
class="flex h-full items-center gap-2 overflow-hidden px-3 text-lg leading-normal transition-all duration-500"
|
||||
>
|
||||
<VbenAvatar
|
||||
v-if="src"
|
||||
v-if="logoSrc"
|
||||
:alt="text"
|
||||
:src="src"
|
||||
:src="logoSrc"
|
||||
:size="logoSize"
|
||||
:fit="fit"
|
||||
class="relative rounded-none bg-transparent"
|
||||
|
||||
@@ -84,6 +84,8 @@ onBeforeUnmount(() => {
|
||||
});
|
||||
|
||||
const id = useId();
|
||||
|
||||
const pinType = 'text' as const;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -94,7 +96,7 @@ const id = useId();
|
||||
class="flex w-full justify-between"
|
||||
otp
|
||||
placeholder="○"
|
||||
type="number"
|
||||
:type="pinType"
|
||||
@complete="handleComplete"
|
||||
>
|
||||
<div class="relative flex w-full">
|
||||
|
||||
@@ -3,13 +3,13 @@ import type {
|
||||
PopoverContentProps,
|
||||
PopoverRootEmits,
|
||||
PopoverRootProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import type { ClassType } from '@vben-core/typings';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useForwardPropsEmits } from 'radix-vue';
|
||||
import { useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
import {
|
||||
PopoverContent,
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { SegmentedItem } from './types';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { TabsTrigger } from 'radix-vue';
|
||||
import { TabsTrigger } from 'reka-ui';
|
||||
|
||||
import { Tabs, TabsContent, TabsList } from '../../ui';
|
||||
import TabsIndicator from './tabs-indicator.vue';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { TabsIndicatorProps } from 'radix-vue';
|
||||
import type { TabsIndicatorProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { TabsIndicator, useForwardProps } from 'radix-vue';
|
||||
import { TabsIndicator, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<TabsIndicatorProps & { class?: any }>();
|
||||
|
||||
@@ -23,7 +23,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
||||
v-bind="forwardedProps"
|
||||
:class="
|
||||
cn(
|
||||
'absolute bottom-0 left-0 z-10 h-full w-1/2 translate-x-[--radix-tabs-indicator-position] rounded-full px-0 py-1 pr-0.5 transition-[width,transform] duration-300',
|
||||
'absolute bottom-0 left-0 z-10 h-full w-1/2 translate-x-[--reka-tabs-indicator-position] rounded-full px-0 py-1 pr-0.5 transition-[width,transform] duration-300',
|
||||
props.class,
|
||||
)
|
||||
"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { TooltipContentProps } from 'radix-vue';
|
||||
import type { TooltipContentProps } from 'reka-ui';
|
||||
|
||||
import type { StyleValue } from 'vue';
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from './components';
|
||||
export * from './ui';
|
||||
export { createContext, Slot, VisuallyHidden } from 'radix-vue';
|
||||
export { createContext, Slot, VisuallyHidden } from 'reka-ui';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { AccordionRootEmits, AccordionRootProps } from 'radix-vue';
|
||||
import type { AccordionRootEmits, AccordionRootProps } from 'reka-ui';
|
||||
|
||||
import { AccordionRoot, useForwardPropsEmits } from 'radix-vue';
|
||||
import { AccordionRoot, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<AccordionRootProps>();
|
||||
const emits = defineEmits<AccordionRootEmits>();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { AccordionContentProps } from 'radix-vue';
|
||||
import type { AccordionContentProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { AccordionContent } from 'radix-vue';
|
||||
import { AccordionContent } from 'reka-ui';
|
||||
|
||||
const props = defineProps<AccordionContentProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { AccordionItemProps } from 'radix-vue';
|
||||
import type { AccordionItemProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { AccordionItem, useForwardProps } from 'radix-vue';
|
||||
import { AccordionItem, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<AccordionItemProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { AccordionTriggerProps } from 'radix-vue';
|
||||
import type { AccordionTriggerProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { ChevronDown } from 'lucide-vue-next';
|
||||
import { AccordionHeader, AccordionTrigger } from 'radix-vue';
|
||||
import { AccordionHeader, AccordionTrigger } from 'reka-ui';
|
||||
|
||||
const props = defineProps<AccordionTriggerProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { AlertDialogEmits, AlertDialogProps } from 'radix-vue';
|
||||
import type { AlertDialogEmits, AlertDialogProps } from 'reka-ui';
|
||||
|
||||
import { AlertDialogRoot, useForwardPropsEmits } from 'radix-vue';
|
||||
import { AlertDialogRoot, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<AlertDialogProps>();
|
||||
const emits = defineEmits<AlertDialogEmits>();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { AlertDialogActionProps } from 'radix-vue';
|
||||
import type { AlertDialogActionProps } from 'reka-ui';
|
||||
|
||||
import { AlertDialogAction } from 'radix-vue';
|
||||
import { AlertDialogAction } from 'reka-ui';
|
||||
|
||||
const props = defineProps<AlertDialogActionProps>();
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { AlertDialogCancelProps } from 'radix-vue';
|
||||
import type { AlertDialogCancelProps } from 'reka-ui';
|
||||
|
||||
import { AlertDialogCancel } from 'radix-vue';
|
||||
import { AlertDialogCancel } from 'reka-ui';
|
||||
|
||||
const props = defineProps<AlertDialogCancelProps>();
|
||||
</script>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type {
|
||||
AlertDialogContentEmits,
|
||||
AlertDialogContentProps,
|
||||
} from 'radix-vue';
|
||||
import type { AlertDialogContentEmits, AlertDialogContentProps } from 'reka-ui';
|
||||
|
||||
import type { ClassType } from '@vben-core/typings';
|
||||
|
||||
@@ -14,7 +11,7 @@ import {
|
||||
AlertDialogContent,
|
||||
AlertDialogPortal,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import AlertDialogOverlay from './AlertDialogOverlay.vue';
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script lang="ts" setup>
|
||||
import type { AlertDialogDescriptionProps } from 'radix-vue';
|
||||
import type { AlertDialogDescriptionProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { AlertDialogDescription, useForwardProps } from 'radix-vue';
|
||||
import { AlertDialogDescription, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<AlertDialogDescriptionProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { AlertDialogTitleProps } from 'radix-vue';
|
||||
import type { AlertDialogTitleProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { AlertDialogTitle, useForwardProps } from 'radix-vue';
|
||||
import { AlertDialogTitle, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<AlertDialogTitleProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { AvatarVariants } from './avatar';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { AvatarRoot } from 'radix-vue';
|
||||
import { AvatarRoot } from 'reka-ui';
|
||||
|
||||
import { avatarVariant } from './avatar';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { AvatarFallbackProps } from 'radix-vue';
|
||||
import type { AvatarFallbackProps } from 'reka-ui';
|
||||
|
||||
import { AvatarFallback } from 'radix-vue';
|
||||
import { AvatarFallback } from 'reka-ui';
|
||||
|
||||
const props = defineProps<AvatarFallbackProps>();
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { AvatarImageProps } from 'radix-vue';
|
||||
import type { AvatarImageProps } from 'reka-ui';
|
||||
|
||||
import { AvatarImage } from 'radix-vue';
|
||||
import { AvatarImage } from 'reka-ui';
|
||||
|
||||
const props = defineProps<AvatarImageProps>();
|
||||
</script>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import type { PrimitiveProps } from 'radix-vue';
|
||||
import type { PrimitiveProps } from 'reka-ui';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { Primitive } from 'radix-vue';
|
||||
import { Primitive } from 'reka-ui';
|
||||
|
||||
const props = withDefaults(defineProps<PrimitiveProps & { class?: any }>(), {
|
||||
as: 'a',
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { PrimitiveProps } from 'radix-vue';
|
||||
import type { PrimitiveProps } from 'reka-ui';
|
||||
|
||||
import type { ButtonVariants, ButtonVariantSize } from './types';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { Primitive } from 'radix-vue';
|
||||
import { Primitive } from 'reka-ui';
|
||||
|
||||
import { buttonVariants } from './button';
|
||||
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
|
||||
import type { CheckboxRootEmits, CheckboxRootProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { Check, Minus } from 'lucide-vue-next';
|
||||
import {
|
||||
CheckboxIndicator,
|
||||
CheckboxRoot,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
import { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<
|
||||
CheckboxRootProps & { class?: any; indeterminate?: boolean }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue';
|
||||
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'reka-ui';
|
||||
|
||||
import { ContextMenuRoot, useForwardPropsEmits } from 'radix-vue';
|
||||
import { ContextMenuRoot, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = withDefaults(defineProps<ContextMenuRootProps>(), {
|
||||
modal: false,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import type {
|
||||
ContextMenuCheckboxItemEmits,
|
||||
ContextMenuCheckboxItemProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
ContextMenuCheckboxItem,
|
||||
ContextMenuItemIndicator,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
const props = defineProps<ContextMenuCheckboxItemProps & { class?: any }>();
|
||||
const emits = defineEmits<ContextMenuCheckboxItemEmits>();
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type {
|
||||
ContextMenuContentEmits,
|
||||
ContextMenuContentProps,
|
||||
} from 'radix-vue';
|
||||
import type { ContextMenuContentEmits, ContextMenuContentProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
@@ -12,7 +9,7 @@ import {
|
||||
ContextMenuContent,
|
||||
ContextMenuPortal,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
const props = defineProps<ContextMenuContentProps & { class?: any }>();
|
||||
const emits = defineEmits<ContextMenuContentEmits>();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { ContextMenuGroupProps } from 'radix-vue';
|
||||
import type { ContextMenuGroupProps } from 'reka-ui';
|
||||
|
||||
import { ContextMenuGroup } from 'radix-vue';
|
||||
import { ContextMenuGroup } from 'reka-ui';
|
||||
|
||||
const props = defineProps<ContextMenuGroupProps>();
|
||||
</script>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { ContextMenuItemEmits, ContextMenuItemProps } from 'radix-vue';
|
||||
import type { ContextMenuItemEmits, ContextMenuItemProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { ContextMenuItem, useForwardPropsEmits } from 'radix-vue';
|
||||
import { ContextMenuItem, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<
|
||||
ContextMenuItemProps & { class?: any; inset?: boolean }
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { ContextMenuLabelProps } from 'radix-vue';
|
||||
import type { ContextMenuLabelProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { ContextMenuLabel } from 'radix-vue';
|
||||
import { ContextMenuLabel } from 'reka-ui';
|
||||
|
||||
const props = defineProps<
|
||||
ContextMenuLabelProps & { class?: any; inset?: boolean }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { ContextMenuPortalProps } from 'radix-vue';
|
||||
import type { ContextMenuPortalProps } from 'reka-ui';
|
||||
|
||||
import { ContextMenuPortal } from 'radix-vue';
|
||||
import { ContextMenuPortal } from 'reka-ui';
|
||||
|
||||
const props = defineProps<ContextMenuPortalProps>();
|
||||
</script>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import type {
|
||||
ContextMenuRadioGroupEmits,
|
||||
ContextMenuRadioGroupProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import { ContextMenuRadioGroup, useForwardPropsEmits } from 'radix-vue';
|
||||
import { ContextMenuRadioGroup, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<ContextMenuRadioGroupProps>();
|
||||
const emits = defineEmits<ContextMenuRadioGroupEmits>();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import type {
|
||||
ContextMenuRadioItemEmits,
|
||||
ContextMenuRadioItemProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
ContextMenuItemIndicator,
|
||||
ContextMenuRadioItem,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
const props = defineProps<ContextMenuRadioItemProps & { class?: any }>();
|
||||
const emits = defineEmits<ContextMenuRadioItemEmits>();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { ContextMenuSeparatorProps } from 'radix-vue';
|
||||
import type { ContextMenuSeparatorProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { ContextMenuSeparator } from 'radix-vue';
|
||||
import { ContextMenuSeparator } from 'reka-ui';
|
||||
|
||||
const props = defineProps<ContextMenuSeparatorProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { ContextMenuSubEmits, ContextMenuSubProps } from 'radix-vue';
|
||||
import type { ContextMenuSubEmits, ContextMenuSubProps } from 'reka-ui';
|
||||
|
||||
import { ContextMenuSub, useForwardPropsEmits } from 'radix-vue';
|
||||
import { ContextMenuSub, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<ContextMenuSubProps>();
|
||||
const emits = defineEmits<ContextMenuSubEmits>();
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import type {
|
||||
DropdownMenuSubContentEmits,
|
||||
DropdownMenuSubContentProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { ContextMenuSubContent, useForwardPropsEmits } from 'radix-vue';
|
||||
import { ContextMenuSubContent, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DropdownMenuSubContentProps & { class?: any }>();
|
||||
const emits = defineEmits<DropdownMenuSubContentEmits>();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { ContextMenuSubTriggerProps } from 'radix-vue';
|
||||
import type { ContextMenuSubTriggerProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { ChevronRight } from 'lucide-vue-next';
|
||||
import { ContextMenuSubTrigger, useForwardProps } from 'radix-vue';
|
||||
import { ContextMenuSubTrigger, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<
|
||||
ContextMenuSubTriggerProps & {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { ContextMenuTriggerProps } from 'radix-vue';
|
||||
import type { ContextMenuTriggerProps } from 'reka-ui';
|
||||
|
||||
import { ContextMenuTrigger, useForwardProps } from 'radix-vue';
|
||||
import { ContextMenuTrigger, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<ContextMenuTriggerProps>();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { DialogRootEmits, DialogRootProps } from 'radix-vue';
|
||||
import type { DialogRootEmits, DialogRootProps } from 'reka-ui';
|
||||
|
||||
import { DialogRoot, useForwardPropsEmits } from 'radix-vue';
|
||||
import { DialogRoot, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DialogRootProps>();
|
||||
const emits = defineEmits<DialogRootEmits>();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { DialogCloseProps } from 'radix-vue';
|
||||
import type { DialogCloseProps } from 'reka-ui';
|
||||
|
||||
import { DialogClose } from 'radix-vue';
|
||||
import { DialogClose } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DialogCloseProps>();
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { DialogContentEmits, DialogContentProps } from 'radix-vue';
|
||||
import type { DialogContentEmits, DialogContentProps } from 'reka-ui';
|
||||
|
||||
import type { ClassType } from '@vben-core/typings';
|
||||
|
||||
@@ -8,7 +8,7 @@ import { computed, ref } from 'vue';
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { X } from 'lucide-vue-next';
|
||||
import { DialogClose, DialogContent, useForwardPropsEmits } from 'radix-vue';
|
||||
import { DialogClose, DialogContent, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
import DialogOverlay from './DialogOverlay.vue';
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { DialogDescriptionProps } from 'radix-vue';
|
||||
import type { DialogDescriptionProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { DialogDescription, useForwardProps } from 'radix-vue';
|
||||
import { DialogDescription, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DialogDescriptionProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { DialogContentEmits, DialogContentProps } from 'radix-vue';
|
||||
import type { DialogContentEmits, DialogContentProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
DialogOverlay,
|
||||
DialogPortal,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<DialogContentProps & { class?: any; zIndex?: number }>(),
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { DialogTitleProps } from 'radix-vue';
|
||||
import type { DialogTitleProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { DialogTitle, useForwardProps } from 'radix-vue';
|
||||
import { DialogTitle, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DialogTitleProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { DialogTriggerProps } from 'radix-vue';
|
||||
import type { DialogTriggerProps } from 'reka-ui';
|
||||
|
||||
import { DialogTrigger } from 'radix-vue';
|
||||
import { DialogTrigger } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DialogTriggerProps>();
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { DropdownMenuRootEmits, DropdownMenuRootProps } from 'radix-vue';
|
||||
import type { DropdownMenuRootEmits, DropdownMenuRootProps } from 'reka-ui';
|
||||
|
||||
import { DropdownMenuRoot, useForwardPropsEmits } from 'radix-vue';
|
||||
import { DropdownMenuRoot, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = withDefaults(defineProps<DropdownMenuRootProps>(), {
|
||||
modal: false,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import type {
|
||||
DropdownMenuCheckboxItemEmits,
|
||||
DropdownMenuCheckboxItemProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
DropdownMenuCheckboxItem,
|
||||
DropdownMenuItemIndicator,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: any }>();
|
||||
const emits = defineEmits<DropdownMenuCheckboxItemEmits>();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import type {
|
||||
DropdownMenuContentEmits,
|
||||
DropdownMenuContentProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
DropdownMenuContent,
|
||||
DropdownMenuPortal,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<DropdownMenuContentProps & { class?: any }>(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { DropdownMenuGroupProps } from 'radix-vue';
|
||||
import type { DropdownMenuGroupProps } from 'reka-ui';
|
||||
|
||||
import { DropdownMenuGroup } from 'radix-vue';
|
||||
import { DropdownMenuGroup } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DropdownMenuGroupProps>();
|
||||
</script>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { DropdownMenuItemProps } from 'radix-vue';
|
||||
import type { DropdownMenuItemProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { DropdownMenuItem, useForwardProps } from 'radix-vue';
|
||||
import { DropdownMenuItem, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<
|
||||
DropdownMenuItemProps & { class?: any; inset?: boolean }
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { DropdownMenuLabelProps } from 'radix-vue';
|
||||
import type { DropdownMenuLabelProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { DropdownMenuLabel, useForwardProps } from 'radix-vue';
|
||||
import { DropdownMenuLabel, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<
|
||||
DropdownMenuLabelProps & { class?: any; inset?: boolean }
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import type {
|
||||
DropdownMenuRadioGroupEmits,
|
||||
DropdownMenuRadioGroupProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import { DropdownMenuRadioGroup, useForwardPropsEmits } from 'radix-vue';
|
||||
import { DropdownMenuRadioGroup, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DropdownMenuRadioGroupProps>();
|
||||
const emits = defineEmits<DropdownMenuRadioGroupEmits>();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import type {
|
||||
DropdownMenuRadioItemEmits,
|
||||
DropdownMenuRadioItemProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
DropdownMenuItemIndicator,
|
||||
DropdownMenuRadioItem,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
const props = defineProps<DropdownMenuRadioItemProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { DropdownMenuSeparatorProps } from 'radix-vue';
|
||||
import type { DropdownMenuSeparatorProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { DropdownMenuSeparator } from 'radix-vue';
|
||||
import { DropdownMenuSeparator } from 'reka-ui';
|
||||
|
||||
const props = defineProps<
|
||||
DropdownMenuSeparatorProps & {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { DropdownMenuSubEmits, DropdownMenuSubProps } from 'radix-vue';
|
||||
import type { DropdownMenuSubEmits, DropdownMenuSubProps } from 'reka-ui';
|
||||
|
||||
import { DropdownMenuSub, useForwardPropsEmits } from 'radix-vue';
|
||||
import { DropdownMenuSub, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DropdownMenuSubProps>();
|
||||
const emits = defineEmits<DropdownMenuSubEmits>();
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import type {
|
||||
DropdownMenuSubContentEmits,
|
||||
DropdownMenuSubContentProps,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { DropdownMenuSubContent, useForwardPropsEmits } from 'radix-vue';
|
||||
import { DropdownMenuSubContent, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DropdownMenuSubContentProps & { class?: any }>();
|
||||
const emits = defineEmits<DropdownMenuSubContentEmits>();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { DropdownMenuSubTriggerProps } from 'radix-vue';
|
||||
import type { DropdownMenuSubTriggerProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { ChevronRight } from 'lucide-vue-next';
|
||||
import { DropdownMenuSubTrigger, useForwardProps } from 'radix-vue';
|
||||
import { DropdownMenuSubTrigger, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DropdownMenuSubTriggerProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { DropdownMenuTriggerProps } from 'radix-vue';
|
||||
import type { DropdownMenuTriggerProps } from 'reka-ui';
|
||||
|
||||
import { DropdownMenuTrigger, useForwardProps } from 'radix-vue';
|
||||
import { DropdownMenuTrigger, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<DropdownMenuTriggerProps>();
|
||||
|
||||
|
||||
@@ -13,4 +13,4 @@ export { default as DropdownMenuSub } from './DropdownMenuSub.vue';
|
||||
export { default as DropdownMenuSubContent } from './DropdownMenuSubContent.vue';
|
||||
export { default as DropdownMenuSubTrigger } from './DropdownMenuSubTrigger.vue';
|
||||
export { default as DropdownMenuTrigger } from './DropdownMenuTrigger.vue';
|
||||
export { DropdownMenuPortal } from 'radix-vue';
|
||||
export { DropdownMenuPortal } from 'reka-ui';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { Slot } from 'radix-vue';
|
||||
import { Slot } from 'reka-ui';
|
||||
|
||||
import { useFormField } from './useFormField';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import type { LabelProps } from 'radix-vue';
|
||||
import type { LabelProps } from 'reka-ui';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { HoverCardRootEmits, HoverCardRootProps } from 'radix-vue';
|
||||
import type { HoverCardRootEmits, HoverCardRootProps } from 'reka-ui';
|
||||
|
||||
import { HoverCardRoot, useForwardPropsEmits } from 'radix-vue';
|
||||
import { HoverCardRoot, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<HoverCardRootProps>();
|
||||
const emits = defineEmits<HoverCardRootEmits>();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { HoverCardContentProps } from 'radix-vue';
|
||||
import type { HoverCardContentProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { HoverCardContent, HoverCardPortal, useForwardProps } from 'radix-vue';
|
||||
import { HoverCardContent, HoverCardPortal, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<HoverCardContentProps & { class?: any }>(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { HoverCardTriggerProps } from 'radix-vue';
|
||||
import type { HoverCardTriggerProps } from 'reka-ui';
|
||||
|
||||
import { HoverCardTrigger } from 'radix-vue';
|
||||
import { HoverCardTrigger } from 'reka-ui';
|
||||
|
||||
const props = defineProps<HoverCardTriggerProps>();
|
||||
</script>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { LabelProps } from 'radix-vue';
|
||||
import type { LabelProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { Label } from 'radix-vue';
|
||||
import { Label } from 'reka-ui';
|
||||
|
||||
const props = defineProps<LabelProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { NumberFieldRootEmits, NumberFieldRootProps } from 'radix-vue';
|
||||
import type { NumberFieldRootEmits, NumberFieldRootProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { NumberFieldRoot, useForwardPropsEmits } from 'radix-vue';
|
||||
import { NumberFieldRoot, useForwardPropsEmits } from 'reka-ui';
|
||||
|
||||
const props = defineProps<NumberFieldRootProps & { class?: any }>();
|
||||
const emits = defineEmits<NumberFieldRootEmits>();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { NumberFieldDecrementProps } from 'radix-vue';
|
||||
import type { NumberFieldDecrementProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { Minus } from 'lucide-vue-next';
|
||||
import { NumberFieldDecrement, useForwardProps } from 'radix-vue';
|
||||
import { NumberFieldDecrement, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<NumberFieldDecrementProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { NumberFieldIncrementProps } from 'radix-vue';
|
||||
import type { NumberFieldIncrementProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { Plus } from 'lucide-vue-next';
|
||||
import { NumberFieldIncrement, useForwardProps } from 'radix-vue';
|
||||
import { NumberFieldIncrement, useForwardProps } from 'reka-ui';
|
||||
|
||||
const props = defineProps<NumberFieldIncrementProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { NumberFieldInput } from 'radix-vue';
|
||||
import { NumberFieldInput } from 'reka-ui';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { PaginationEllipsisProps } from 'radix-vue';
|
||||
import type { PaginationEllipsisProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { MoreHorizontal } from 'lucide-vue-next';
|
||||
import { PaginationEllipsis } from 'radix-vue';
|
||||
import { PaginationEllipsis } from 'reka-ui';
|
||||
|
||||
const props = defineProps<PaginationEllipsisProps & { class?: any }>();
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { PaginationFirstProps } from 'radix-vue';
|
||||
import type { PaginationFirstProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { ChevronsLeft } from 'lucide-vue-next';
|
||||
import { PaginationFirst } from 'radix-vue';
|
||||
import { PaginationFirst } from 'reka-ui';
|
||||
|
||||
import { Button } from '../button';
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { PaginationLastProps } from 'radix-vue';
|
||||
import type { PaginationLastProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { ChevronsRight } from 'lucide-vue-next';
|
||||
import { PaginationLast } from 'radix-vue';
|
||||
import { PaginationLast } from 'reka-ui';
|
||||
|
||||
import { Button } from '../button';
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { PaginationNextProps } from 'radix-vue';
|
||||
import type { PaginationNextProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { ChevronRight } from 'lucide-vue-next';
|
||||
import { PaginationNext } from 'radix-vue';
|
||||
import { PaginationNext } from 'reka-ui';
|
||||
|
||||
import { Button } from '../button';
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { PaginationPrevProps } from 'radix-vue';
|
||||
import type { PaginationPrevProps } from 'reka-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import { ChevronLeft } from 'lucide-vue-next';
|
||||
import { PaginationPrev } from 'radix-vue';
|
||||
import { PaginationPrev } from 'reka-ui';
|
||||
|
||||
import { Button } from '../button';
|
||||
|
||||
|
||||
@@ -7,4 +7,4 @@ export {
|
||||
PaginationRoot as Pagination,
|
||||
PaginationList,
|
||||
PaginationListItem,
|
||||
} from 'radix-vue';
|
||||
} from 'reka-ui';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user