Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin into dev
This commit is contained in:
10
.github/workflows/deploy.yml
vendored
10
.github/workflows/deploy.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
|||||||
run: pnpm build:play
|
run: pnpm build:play
|
||||||
|
|
||||||
- name: Sync Playground files
|
- name: Sync Playground files
|
||||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
|
||||||
with:
|
with:
|
||||||
server: ${{ secrets.PRO_FTP_HOST }}
|
server: ${{ secrets.PRO_FTP_HOST }}
|
||||||
username: ${{ secrets.WEB_PLAYGROUND_FTP_ACCOUNT }}
|
username: ${{ secrets.WEB_PLAYGROUND_FTP_ACCOUNT }}
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
run: pnpm build:docs
|
run: pnpm build:docs
|
||||||
|
|
||||||
- name: Sync Docs files
|
- name: Sync Docs files
|
||||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
|
||||||
with:
|
with:
|
||||||
server: ${{ secrets.PRO_FTP_HOST }}
|
server: ${{ secrets.PRO_FTP_HOST }}
|
||||||
username: ${{ secrets.WEBSITE_FTP_ACCOUNT }}
|
username: ${{ secrets.WEBSITE_FTP_ACCOUNT }}
|
||||||
@@ -85,7 +85,7 @@ jobs:
|
|||||||
run: pnpm run build:antd
|
run: pnpm run build:antd
|
||||||
|
|
||||||
- name: Sync files
|
- name: Sync files
|
||||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
|
||||||
with:
|
with:
|
||||||
server: ${{ secrets.PRO_FTP_HOST }}
|
server: ${{ secrets.PRO_FTP_HOST }}
|
||||||
username: ${{ secrets.WEB_ANTD_FTP_ACCOUNT }}
|
username: ${{ secrets.WEB_ANTD_FTP_ACCOUNT }}
|
||||||
@@ -116,7 +116,7 @@ jobs:
|
|||||||
run: pnpm run build:ele
|
run: pnpm run build:ele
|
||||||
|
|
||||||
- name: Sync files
|
- name: Sync files
|
||||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
|
||||||
with:
|
with:
|
||||||
server: ${{ secrets.PRO_FTP_HOST }}
|
server: ${{ secrets.PRO_FTP_HOST }}
|
||||||
username: ${{ secrets.WEB_ELE_FTP_ACCOUNT }}
|
username: ${{ secrets.WEB_ELE_FTP_ACCOUNT }}
|
||||||
@@ -147,7 +147,7 @@ jobs:
|
|||||||
run: pnpm run build:naive
|
run: pnpm run build:naive
|
||||||
|
|
||||||
- name: Sync files
|
- name: Sync files
|
||||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
|
||||||
with:
|
with:
|
||||||
server: ${{ secrets.PRO_FTP_HOST }}
|
server: ${{ secrets.PRO_FTP_HOST }}
|
||||||
username: ${{ secrets.WEB_NAIVE_FTP_ACCOUNT }}
|
username: ${{ secrets.WEB_NAIVE_FTP_ACCOUNT }}
|
||||||
|
|||||||
2
.npmrc
2
.npmrc
@@ -1,4 +1,4 @@
|
|||||||
registry = "https://registry.npmmirror.com"
|
registry=https://registry.npmmirror.com
|
||||||
public-hoist-pattern[]=lefthook
|
public-hoist-pattern[]=lefthook
|
||||||
public-hoist-pattern[]=eslint
|
public-hoist-pattern[]=eslint
|
||||||
public-hoist-pattern[]=prettier
|
public-hoist-pattern[]=prettier
|
||||||
|
|||||||
12
apps/backend-mock/api/timezone/getTimezone.ts
Normal file
12
apps/backend-mock/api/timezone/getTimezone.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { eventHandler } from 'h3';
|
||||||
|
import { verifyAccessToken } from '~/utils/jwt-utils';
|
||||||
|
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
|
||||||
|
import { getTimezone } from '~/utils/timezone-utils';
|
||||||
|
|
||||||
|
export default eventHandler((event) => {
|
||||||
|
const userinfo = verifyAccessToken(event);
|
||||||
|
if (!userinfo) {
|
||||||
|
return unAuthorizedResponse(event);
|
||||||
|
}
|
||||||
|
return useResponseSuccess(getTimezone());
|
||||||
|
});
|
||||||
11
apps/backend-mock/api/timezone/getTimezoneOptions.ts
Normal file
11
apps/backend-mock/api/timezone/getTimezoneOptions.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { eventHandler } from 'h3';
|
||||||
|
import { TIME_ZONE_OPTIONS } from '~/utils/mock-data';
|
||||||
|
import { useResponseSuccess } from '~/utils/response';
|
||||||
|
|
||||||
|
export default eventHandler(() => {
|
||||||
|
const data = TIME_ZONE_OPTIONS.map((o) => ({
|
||||||
|
label: `${o.timezone} (GMT${o.offset >= 0 ? `+${o.offset}` : o.offset})`,
|
||||||
|
value: o.timezone,
|
||||||
|
}));
|
||||||
|
return useResponseSuccess(data);
|
||||||
|
});
|
||||||
22
apps/backend-mock/api/timezone/setTimezone.ts
Normal file
22
apps/backend-mock/api/timezone/setTimezone.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { eventHandler, readBody } from 'h3';
|
||||||
|
import { verifyAccessToken } from '~/utils/jwt-utils';
|
||||||
|
import { TIME_ZONE_OPTIONS } from '~/utils/mock-data';
|
||||||
|
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
|
||||||
|
import { setTimezone } from '~/utils/timezone-utils';
|
||||||
|
|
||||||
|
export default eventHandler(async (event) => {
|
||||||
|
const userinfo = verifyAccessToken(event);
|
||||||
|
if (!userinfo) {
|
||||||
|
return unAuthorizedResponse(event);
|
||||||
|
}
|
||||||
|
const body = await readBody<{ timezone?: unknown }>(event);
|
||||||
|
const timezone =
|
||||||
|
typeof body?.timezone === 'string' ? body.timezone : undefined;
|
||||||
|
const allowed = TIME_ZONE_OPTIONS.some((o) => o.timezone === timezone);
|
||||||
|
if (!timezone || !allowed) {
|
||||||
|
setResponseStatus(event, 400);
|
||||||
|
return useResponseError('Bad Request', 'Invalid timezone');
|
||||||
|
}
|
||||||
|
setTimezone(timezone);
|
||||||
|
return useResponseSuccess({});
|
||||||
|
});
|
||||||
@@ -7,6 +7,11 @@ export interface UserInfo {
|
|||||||
homePath?: string;
|
homePath?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TimezoneOption {
|
||||||
|
offset: number;
|
||||||
|
timezone: string;
|
||||||
|
}
|
||||||
|
|
||||||
export const MOCK_USERS: UserInfo[] = [
|
export const MOCK_USERS: UserInfo[] = [
|
||||||
{
|
{
|
||||||
id: 0,
|
id: 0,
|
||||||
@@ -276,7 +281,7 @@ export const MOCK_MENU_LIST = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
id: 20_401,
|
id: 20_401,
|
||||||
pid: 201,
|
pid: 202,
|
||||||
name: 'SystemDeptCreate',
|
name: 'SystemDeptCreate',
|
||||||
status: 1,
|
status: 1,
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -285,7 +290,7 @@ export const MOCK_MENU_LIST = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 20_402,
|
id: 20_402,
|
||||||
pid: 201,
|
pid: 202,
|
||||||
name: 'SystemDeptEdit',
|
name: 'SystemDeptEdit',
|
||||||
status: 1,
|
status: 1,
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -294,7 +299,7 @@ export const MOCK_MENU_LIST = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 20_403,
|
id: 20_403,
|
||||||
pid: 201,
|
pid: 202,
|
||||||
name: 'SystemDeptDelete',
|
name: 'SystemDeptDelete',
|
||||||
status: 1,
|
status: 1,
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -388,3 +393,29 @@ export function getMenuIds(menus: any[]) {
|
|||||||
});
|
});
|
||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时区选项
|
||||||
|
*/
|
||||||
|
export const TIME_ZONE_OPTIONS: TimezoneOption[] = [
|
||||||
|
{
|
||||||
|
offset: -5,
|
||||||
|
timezone: 'America/New_York',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
timezone: 'Europe/London',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 8,
|
||||||
|
timezone: 'Asia/Shanghai',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 9,
|
||||||
|
timezone: 'Asia/Tokyo',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 9,
|
||||||
|
timezone: 'Asia/Seoul',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
9
apps/backend-mock/utils/timezone-utils.ts
Normal file
9
apps/backend-mock/utils/timezone-utils.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
let mockTimeZone: null | string = null;
|
||||||
|
|
||||||
|
export const setTimezone = (timeZone: string) => {
|
||||||
|
mockTimeZone = timeZone;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getTimezone = () => {
|
||||||
|
return mockTimeZone;
|
||||||
|
};
|
||||||
@@ -8,12 +8,14 @@ import { $t } from '#/locales';
|
|||||||
|
|
||||||
const appName = computed(() => preferences.app.name);
|
const appName = computed(() => preferences.app.name);
|
||||||
const logo = computed(() => preferences.logo.source);
|
const logo = computed(() => preferences.logo.source);
|
||||||
|
const logoDark = computed(() => preferences.logo.sourceDark);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<AuthPageLayout
|
<AuthPageLayout
|
||||||
:app-name="appName"
|
:app-name="appName"
|
||||||
:logo="logo"
|
:logo="logo"
|
||||||
|
:logo-dark="logoDark"
|
||||||
:page-description="$t('authentication.pageDesc')"
|
:page-description="$t('authentication.pageDesc')"
|
||||||
:page-title="$t('authentication.pageTitle')"
|
:page-title="$t('authentication.pageTitle')"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -8,12 +8,14 @@ import { $t } from '#/locales';
|
|||||||
|
|
||||||
const appName = computed(() => preferences.app.name);
|
const appName = computed(() => preferences.app.name);
|
||||||
const logo = computed(() => preferences.logo.source);
|
const logo = computed(() => preferences.logo.source);
|
||||||
|
const logoDark = computed(() => preferences.logo.sourceDark);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<AuthPageLayout
|
<AuthPageLayout
|
||||||
:app-name="appName"
|
:app-name="appName"
|
||||||
:logo="logo"
|
:logo="logo"
|
||||||
|
:logo-dark="logoDark"
|
||||||
:page-description="$t('authentication.pageDesc')"
|
:page-description="$t('authentication.pageDesc')"
|
||||||
:page-title="$t('authentication.pageTitle')"
|
:page-title="$t('authentication.pageTitle')"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -8,12 +8,14 @@ import { $t } from '#/locales';
|
|||||||
|
|
||||||
const appName = computed(() => preferences.app.name);
|
const appName = computed(() => preferences.app.name);
|
||||||
const logo = computed(() => preferences.logo.source);
|
const logo = computed(() => preferences.logo.source);
|
||||||
|
const logoDark = computed(() => preferences.logo.sourceDark);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<AuthPageLayout
|
<AuthPageLayout
|
||||||
:app-name="appName"
|
:app-name="appName"
|
||||||
:logo="logo"
|
:logo="logo"
|
||||||
|
:logo-dark="logoDark"
|
||||||
:page-description="$t('authentication.pageDesc')"
|
:page-description="$t('authentication.pageDesc')"
|
||||||
:page-title="$t('authentication.pageTitle')"
|
:page-title="$t('authentication.pageTitle')"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
TabsList,
|
TabsList,
|
||||||
TabsRoot,
|
TabsRoot,
|
||||||
TabsTrigger,
|
TabsTrigger,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
@@ -56,7 +56,7 @@ const toggleOpen = () => {
|
|||||||
<TabsList class="relative flex">
|
<TabsList class="relative flex">
|
||||||
<template v-if="open">
|
<template v-if="open">
|
||||||
<TabsIndicator
|
<TabsIndicator
|
||||||
class="absolute bottom-0 left-0 h-[2px] w-[--radix-tabs-indicator-size] translate-x-[--radix-tabs-indicator-position] rounded-full transition-[width,transform] duration-300"
|
class="absolute bottom-0 left-0 h-[2px] w-[--reka-tabs-indicator-size] translate-x-[--reka-tabs-indicator-position] rounded-full transition-[width,transform] duration-300"
|
||||||
>
|
>
|
||||||
<div class="size-full bg-[var(--vp-c-indigo-1)]"></div>
|
<div class="size-full bg-[var(--vp-c-indigo-1)]"></div>
|
||||||
</TabsIndicator>
|
</TabsIndicator>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
"ant-design-vue": "catalog:",
|
"ant-design-vue": "catalog:",
|
||||||
"lucide-vue-next": "catalog:",
|
"lucide-vue-next": "catalog:",
|
||||||
"medium-zoom": "catalog:",
|
"medium-zoom": "catalog:",
|
||||||
"radix-vue": "catalog:",
|
"reka-ui": "catalog:",
|
||||||
"vitepress-plugin-group-icons": "catalog:"
|
"vitepress-plugin-group-icons": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ const [Grid] = useVbenVxeGrid({ gridOptions });
|
|||||||
<Image :src="row.imageUrl" height="30" width="30" />
|
<Image :src="row.imageUrl" height="30" width="30" />
|
||||||
</template>
|
</template>
|
||||||
<template #open="{ row }">
|
<template #open="{ row }">
|
||||||
<Switch v-model:checked="row.open" />
|
<Switch v-model="row.open" />
|
||||||
</template>
|
</template>
|
||||||
<template #status="{ row }">
|
<template #status="{ row }">
|
||||||
<Tag :color="row.color">{{ row.status }}</Tag>
|
<Tag :color="row.color">{{ row.status }}</Tag>
|
||||||
|
|||||||
@@ -261,6 +261,7 @@ const defaultPreferences: Preferences = {
|
|||||||
enable: true,
|
enable: true,
|
||||||
fit: 'contain',
|
fit: 'contain',
|
||||||
source: 'https://unpkg.com/@vbenjs/static-source@0.1.7/source/logo-v1.webp',
|
source: 'https://unpkg.com/@vbenjs/static-source@0.1.7/source/logo-v1.webp',
|
||||||
|
// sourceDark: 'https://unpkg.com/@vbenjs/static-source@0.1.7/source/logo-dark.webp', // Optional: Dark theme logo
|
||||||
},
|
},
|
||||||
navigation: {
|
navigation: {
|
||||||
accordion: true,
|
accordion: true,
|
||||||
@@ -457,6 +458,8 @@ interface LogoPreferences {
|
|||||||
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
||||||
/** Logo URL */
|
/** Logo URL */
|
||||||
source: string;
|
source: string;
|
||||||
|
/** Dark theme logo URL (optional, if not set, use source) */
|
||||||
|
sourceDark?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NavigationPreferences {
|
interface NavigationPreferences {
|
||||||
|
|||||||
@@ -260,6 +260,7 @@ const defaultPreferences: Preferences = {
|
|||||||
enable: true,
|
enable: true,
|
||||||
fit: 'contain',
|
fit: 'contain',
|
||||||
source: 'https://unpkg.com/@vbenjs/static-source@0.1.7/source/logo-v1.webp',
|
source: 'https://unpkg.com/@vbenjs/static-source@0.1.7/source/logo-v1.webp',
|
||||||
|
// sourceDark: 'https://unpkg.com/@vbenjs/static-source@0.1.7/source/logo-dark.webp', // 可选:暗色主题logo
|
||||||
},
|
},
|
||||||
navigation: {
|
navigation: {
|
||||||
accordion: true,
|
accordion: true,
|
||||||
@@ -457,6 +458,8 @@ interface LogoPreferences {
|
|||||||
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
||||||
/** logo地址 */
|
/** logo地址 */
|
||||||
source: string;
|
source: string;
|
||||||
|
/** 暗色主题logo地址 (可选,若不设置则使用 source) */
|
||||||
|
sourceDark?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NavigationPreferences {
|
interface NavigationPreferences {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
.side-content {
|
.side-content {
|
||||||
animation-duration: 0.2s;
|
animation-duration: 0.3s;
|
||||||
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
@keyframes slide-down {
|
@keyframes slide-down {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(-10px);
|
transform: translateY(50px);
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
@keyframes slide-left {
|
@keyframes slide-left {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateX(-10px);
|
transform: translateX(-50px);
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
@keyframes slide-right {
|
@keyframes slide-right {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateX(-10px);
|
transform: translateX(50px);
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
@keyframes slide-up {
|
@keyframes slide-up {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(10px);
|
transform: translateY(-50px);
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
|
|||||||
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,30 +1,26 @@
|
|||||||
import dayjs, { Dayjs } from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import timezone from 'dayjs/plugin/timezone';
|
||||||
|
import utc from 'dayjs/plugin/utc';
|
||||||
|
|
||||||
export function formatDate(
|
dayjs.extend(utc);
|
||||||
time: Date | Dayjs | number | string | undefined,
|
dayjs.extend(timezone);
|
||||||
format = 'YYYY-MM-DD',
|
|
||||||
) {
|
type FormatDate = Date | dayjs.Dayjs | number | string;
|
||||||
if (!time) {
|
|
||||||
return time;
|
export function formatDate(time: FormatDate, format = 'YYYY-MM-DD') {
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
const date = dayjs(time);
|
const date = dayjs.isDayjs(time) ? time : dayjs(time);
|
||||||
if (!date.isValid()) {
|
if (!date.isValid()) {
|
||||||
throw new Error('Invalid date');
|
throw new Error('Invalid date');
|
||||||
}
|
}
|
||||||
return date.format(format);
|
return date.tz().format(format);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Error formatting date: ${error}`);
|
console.error(`Error formatting date: ${error}`);
|
||||||
return time;
|
return String(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatDateTime(
|
export function formatDateTime(time: FormatDate) {
|
||||||
time: Date | Dayjs | number | string | undefined,
|
|
||||||
) {
|
|
||||||
if (!time) {
|
|
||||||
return time;
|
|
||||||
}
|
|
||||||
return formatDate(time, 'YYYY-MM-DD HH:mm:ss');
|
return formatDate(time, 'YYYY-MM-DD HH:mm:ss');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,3 +51,33 @@ export function isDayjsObject(value: any): value is dayjs.Dayjs {
|
|||||||
export function dateFormatter(_row: any, _column: any, cellValue: any): string {
|
export function dateFormatter(_row: any, _column: any, cellValue: any): string {
|
||||||
return cellValue ? formatDate(cellValue)?.toString() || '' : '';
|
return cellValue ? formatDate(cellValue)?.toString() || '' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前时区
|
||||||
|
* @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';
|
type AuthPageLayoutType = 'panel-center' | 'panel-left' | 'panel-right';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时区选项
|
||||||
|
*/
|
||||||
|
interface TimezoneOption {
|
||||||
|
label: string;
|
||||||
|
offset: number;
|
||||||
|
timezone: string;
|
||||||
|
}
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
AccessModeType,
|
AccessModeType,
|
||||||
AuthPageLayoutType,
|
AuthPageLayoutType,
|
||||||
@@ -108,4 +117,5 @@ export type {
|
|||||||
PreferencesButtonPositionType,
|
PreferencesButtonPositionType,
|
||||||
TabsStyleType,
|
TabsStyleType,
|
||||||
ThemeModeType,
|
ThemeModeType,
|
||||||
|
TimezoneOption,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vben-core/shared": "workspace:*",
|
"@vben-core/shared": "workspace:*",
|
||||||
"@vueuse/core": "catalog:",
|
"@vueuse/core": "catalog:",
|
||||||
"radix-vue": "catalog:",
|
"reka-ui": "catalog:",
|
||||||
"sortablejs": "catalog:",
|
"sortablejs": "catalog:",
|
||||||
"vue": "catalog:"
|
"vue": "catalog:"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ export {
|
|||||||
useForwardExpose,
|
useForwardExpose,
|
||||||
useForwardProps,
|
useForwardProps,
|
||||||
useForwardPropsEmits,
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
|
|||||||
"enableCheckUpdates": true,
|
"enableCheckUpdates": true,
|
||||||
"enablePreferences": true,
|
"enablePreferences": true,
|
||||||
"enableRefreshToken": false,
|
"enableRefreshToken": false,
|
||||||
|
"enableStickyPreferencesNavigationBar": true,
|
||||||
"isMobile": false,
|
"isMobile": false,
|
||||||
"layout": "sidebar-nav",
|
"layout": "sidebar-nav",
|
||||||
"locale": "zh-CN",
|
"locale": "zh-CN",
|
||||||
@@ -29,6 +30,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
|
|||||||
"name": "Vben Admin",
|
"name": "Vben Admin",
|
||||||
"preferencesButtonPosition": "auto",
|
"preferencesButtonPosition": "auto",
|
||||||
"watermark": false,
|
"watermark": false,
|
||||||
|
"watermarkContent": "",
|
||||||
"zIndex": 200,
|
"zIndex": 200,
|
||||||
},
|
},
|
||||||
"breadcrumb": {
|
"breadcrumb": {
|
||||||
@@ -131,6 +133,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
|
|||||||
"refresh": true,
|
"refresh": true,
|
||||||
"sidebarToggle": true,
|
"sidebarToggle": true,
|
||||||
"themeToggle": true,
|
"themeToggle": true,
|
||||||
|
"timezone": true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ const defaultPreferences: Preferences = {
|
|||||||
refresh: true,
|
refresh: true,
|
||||||
sidebarToggle: true,
|
sidebarToggle: true,
|
||||||
themeToggle: 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 {
|
interface BuiltinThemePreset {
|
||||||
color: string;
|
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 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 };
|
export type { BuiltinThemePreset };
|
||||||
|
|||||||
@@ -146,6 +146,8 @@ interface LogoPreferences {
|
|||||||
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
||||||
/** logo地址 */
|
/** logo地址 */
|
||||||
source: string;
|
source: string;
|
||||||
|
/** 暗色主题logo地址 (可选,若不设置则使用 source) */
|
||||||
|
sourceDark?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NavigationPreferences {
|
interface NavigationPreferences {
|
||||||
@@ -275,6 +277,8 @@ interface WidgetPreferences {
|
|||||||
sidebarToggle: boolean;
|
sidebarToggle: boolean;
|
||||||
/** 是否显示主题切换部件 */
|
/** 是否显示主题切换部件 */
|
||||||
themeToggle: boolean;
|
themeToggle: boolean;
|
||||||
|
/** 是否显示时区部件 */
|
||||||
|
timezone: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Preferences {
|
interface Preferences {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
useLayoutFooterStyle,
|
useLayoutFooterStyle,
|
||||||
useLayoutHeaderStyle,
|
useLayoutHeaderStyle,
|
||||||
} from '@vben-core/composables';
|
} from '@vben-core/composables';
|
||||||
import { Menu } from '@vben-core/icons';
|
import { IconifyIcon } from '@vben-core/icons';
|
||||||
import { VbenIconButton } from '@vben-core/shadcn-ui';
|
import { VbenIconButton } from '@vben-core/shadcn-ui';
|
||||||
import { ELEMENT_ID_MAIN_CONTENT } from '@vben-core/shared/constants';
|
import { ELEMENT_ID_MAIN_CONTENT } from '@vben-core/shared/constants';
|
||||||
|
|
||||||
@@ -559,7 +559,8 @@ const idMainContent = ELEMENT_ID_MAIN_CONTENT;
|
|||||||
class="my-0 mr-1 rounded-md"
|
class="my-0 mr-1 rounded-md"
|
||||||
@click="handleHeaderToggle"
|
@click="handleHeaderToggle"
|
||||||
>
|
>
|
||||||
<Menu class="size-4" />
|
<IconifyIcon v-if="showSidebar" icon="ep:fold" />
|
||||||
|
<IconifyIcon v-else icon="ep:expand" />
|
||||||
</VbenIconButton>
|
</VbenIconButton>
|
||||||
</template>
|
</template>
|
||||||
<slot name="header"></slot>
|
<slot name="header"></slot>
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ onBeforeUnmount(() => {
|
|||||||
is(rootMenu.theme, true),
|
is(rootMenu.theme, true),
|
||||||
opened ? '' : 'hidden',
|
opened ? '' : 'hidden',
|
||||||
'overflow-auto',
|
'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"
|
:content-props="contentProps"
|
||||||
:open="true"
|
:open="true"
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ function escapeKeyDown(e: KeyboardEvent) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handerOpenAutoFocus(e: Event) {
|
function handleOpenAutoFocus(e: Event) {
|
||||||
if (!openAutoFocus.value) {
|
if (!openAutoFocus.value) {
|
||||||
e?.preventDefault();
|
e?.preventDefault();
|
||||||
}
|
}
|
||||||
@@ -209,6 +209,12 @@ const getForceMount = computed(() => {
|
|||||||
return !unref(destroyOnClose) && unref(firstOpened);
|
return !unref(destroyOnClose) && unref(firstOpened);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const handleOpened = () => {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
props.modalApi?.onOpened();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
function handleClosed() {
|
function handleClosed() {
|
||||||
isClosed.value = true;
|
isClosed.value = true;
|
||||||
props.modalApi?.onClosed();
|
props.modalApi?.onClosed();
|
||||||
@@ -253,8 +259,8 @@ function handleClosed() {
|
|||||||
@escape-key-down="escapeKeyDown"
|
@escape-key-down="escapeKeyDown"
|
||||||
@focus-outside="handleFocusOutside"
|
@focus-outside="handleFocusOutside"
|
||||||
@interact-outside="interactOutside"
|
@interact-outside="interactOutside"
|
||||||
@open-auto-focus="handerOpenAutoFocus"
|
@open-auto-focus="handleOpenAutoFocus"
|
||||||
@opened="() => modalApi?.onOpened()"
|
@opened="handleOpened"
|
||||||
@pointer-down-outside="pointerDownOutside"
|
@pointer-down-outside="pointerDownOutside"
|
||||||
>
|
>
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
"@vueuse/core": "catalog:",
|
"@vueuse/core": "catalog:",
|
||||||
"class-variance-authority": "catalog:",
|
"class-variance-authority": "catalog:",
|
||||||
"lucide-vue-next": "catalog:",
|
"lucide-vue-next": "catalog:",
|
||||||
"radix-vue": "catalog:",
|
"reka-ui": "catalog:",
|
||||||
"vee-validate": "catalog:",
|
"vee-validate": "catalog:",
|
||||||
"vue": "catalog:"
|
"vue": "catalog:"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type {
|
|||||||
AvatarFallbackProps,
|
AvatarFallbackProps,
|
||||||
AvatarImageProps,
|
AvatarImageProps,
|
||||||
AvatarRootProps,
|
AvatarRootProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import type { CSSProperties } from 'vue';
|
import type { CSSProperties } from 'vue';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { BreadcrumbProps } from './types';
|
import type { BreadcrumbProps } from './types';
|
||||||
|
|
||||||
import { useForwardPropsEmits } from 'radix-vue';
|
import { useForwardPropsEmits } from 'reka-ui';
|
||||||
|
|
||||||
import BreadcrumbBackground from './breadcrumb-background.vue';
|
import BreadcrumbBackground from './breadcrumb-background.vue';
|
||||||
import Breadcrumb from './breadcrumb.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';
|
import type { Component } from 'vue';
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { computed } from 'vue';
|
|||||||
import { LoaderCircle } from '@vben-core/icons';
|
import { LoaderCircle } from '@vben-core/icons';
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { Primitive } from 'radix-vue';
|
import { Primitive } from 'reka-ui';
|
||||||
|
|
||||||
import { buttonVariants } from '../../ui';
|
import { buttonVariants } from '../../ui';
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
|
import type { CheckboxRootEmits, CheckboxRootProps } from 'reka-ui';
|
||||||
|
|
||||||
import { useId } from 'vue';
|
import { useId } from 'vue';
|
||||||
|
|
||||||
import { useForwardPropsEmits } from 'radix-vue';
|
import { useForwardPropsEmits } from 'reka-ui';
|
||||||
|
|
||||||
import { Checkbox } from '../../ui/checkbox';
|
import { Checkbox } from '../../ui/checkbox';
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ const props = defineProps<CheckboxRootProps & { indeterminate?: boolean }>();
|
|||||||
|
|
||||||
const emits = defineEmits<CheckboxRootEmits>();
|
const emits = defineEmits<CheckboxRootEmits>();
|
||||||
|
|
||||||
const checked = defineModel<boolean>('checked');
|
const checked = defineModel<boolean>();
|
||||||
|
|
||||||
const forwarded = useForwardPropsEmits(props, emits);
|
const forwarded = useForwardPropsEmits(props, emits);
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ const id = useId();
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex items-center">
|
<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>
|
<label :for="id" class="ml-2 cursor-pointer text-sm"> <slot></slot> </label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type {
|
|||||||
ContextMenuContentProps,
|
ContextMenuContentProps,
|
||||||
ContextMenuRootEmits,
|
ContextMenuRootEmits,
|
||||||
ContextMenuRootProps,
|
ContextMenuRootProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import type { ClassType } from '@vben-core/typings';
|
import type { ClassType } from '@vben-core/typings';
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ import type { IContextMenuItem } from './interface';
|
|||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { useForwardPropsEmits } from 'radix-vue';
|
import { useForwardPropsEmits } from 'reka-ui';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ContextMenu,
|
ContextMenu,
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ import type {
|
|||||||
HoverCardContentProps,
|
HoverCardContentProps,
|
||||||
HoverCardRootEmits,
|
HoverCardRootEmits,
|
||||||
HoverCardRootProps,
|
HoverCardRootProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import type { ClassType } from '@vben-core/typings';
|
import type { ClassType } from '@vben-core/typings';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { useForwardPropsEmits } from 'radix-vue';
|
import { useForwardPropsEmits } from 'reka-ui';
|
||||||
|
|
||||||
import { HoverCard, HoverCardContent, HoverCardTrigger } from '../../ui';
|
import { HoverCard, HoverCardContent, HoverCardTrigger } from '../../ui';
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
export { default as VbenHoverCard } from './hover-card.vue';
|
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">
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { VbenAvatar } from '../avatar';
|
import { VbenAvatar } from '../avatar';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -22,6 +24,10 @@ interface Props {
|
|||||||
* @zh_CN Logo 图标
|
* @zh_CN Logo 图标
|
||||||
*/
|
*/
|
||||||
src?: string;
|
src?: string;
|
||||||
|
/**
|
||||||
|
* @zh_CN 暗色主题 Logo 图标 (可选,若不设置则使用 src)
|
||||||
|
*/
|
||||||
|
srcDark?: string;
|
||||||
/**
|
/**
|
||||||
* @zh_CN Logo 文本
|
* @zh_CN Logo 文本
|
||||||
*/
|
*/
|
||||||
@@ -36,14 +42,27 @@ defineOptions({
|
|||||||
name: 'VbenLogo',
|
name: 'VbenLogo',
|
||||||
});
|
});
|
||||||
|
|
||||||
withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
href: 'javascript:void 0',
|
href: 'javascript:void 0',
|
||||||
logoSize: 32,
|
logoSize: 32,
|
||||||
src: '',
|
src: '',
|
||||||
|
srcDark: '',
|
||||||
theme: 'light',
|
theme: 'light',
|
||||||
fit: 'cover',
|
fit: 'cover',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @zh_CN 根据主题选择合适的 logo 图标
|
||||||
|
*/
|
||||||
|
const logoSrc = computed(() => {
|
||||||
|
// 如果是暗色主题且提供了 srcDark,则使用暗色主题的 logo
|
||||||
|
if (props.theme === 'dark' && props.srcDark) {
|
||||||
|
return props.srcDark;
|
||||||
|
}
|
||||||
|
// 否则使用默认的 src
|
||||||
|
return props.src;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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"
|
class="flex h-full items-center gap-2 overflow-hidden px-3 text-lg leading-normal transition-all duration-500"
|
||||||
>
|
>
|
||||||
<VbenAvatar
|
<VbenAvatar
|
||||||
v-if="src"
|
v-if="logoSrc"
|
||||||
:alt="text"
|
:alt="text"
|
||||||
:src="src"
|
:src="logoSrc"
|
||||||
:size="logoSize"
|
:size="logoSize"
|
||||||
:fit="fit"
|
:fit="fit"
|
||||||
class="relative rounded-none bg-transparent"
|
class="relative rounded-none bg-transparent"
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ onBeforeUnmount(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const id = useId();
|
const id = useId();
|
||||||
|
|
||||||
|
const pinType = 'text' as const;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -94,7 +96,7 @@ const id = useId();
|
|||||||
class="flex w-full justify-between"
|
class="flex w-full justify-between"
|
||||||
otp
|
otp
|
||||||
placeholder="○"
|
placeholder="○"
|
||||||
type="number"
|
:type="pinType"
|
||||||
@complete="handleComplete"
|
@complete="handleComplete"
|
||||||
>
|
>
|
||||||
<div class="relative flex w-full">
|
<div class="relative flex w-full">
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ import type {
|
|||||||
PopoverContentProps,
|
PopoverContentProps,
|
||||||
PopoverRootEmits,
|
PopoverRootEmits,
|
||||||
PopoverRootProps,
|
PopoverRootProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import type { ClassType } from '@vben-core/typings';
|
import type { ClassType } from '@vben-core/typings';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { useForwardPropsEmits } from 'radix-vue';
|
import { useForwardPropsEmits } from 'reka-ui';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
PopoverContent,
|
PopoverContent,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { SegmentedItem } from './types';
|
|||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { TabsTrigger } from 'radix-vue';
|
import { TabsTrigger } from 'reka-ui';
|
||||||
|
|
||||||
import { Tabs, TabsContent, TabsList } from '../../ui';
|
import { Tabs, TabsContent, TabsList } from '../../ui';
|
||||||
import TabsIndicator from './tabs-indicator.vue';
|
import TabsIndicator from './tabs-indicator.vue';
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { TabsIndicatorProps } from 'radix-vue';
|
import type { TabsIndicatorProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
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 }>();
|
const props = defineProps<TabsIndicatorProps & { class?: any }>();
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|||||||
v-bind="forwardedProps"
|
v-bind="forwardedProps"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
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,
|
props.class,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { TooltipContentProps } from 'radix-vue';
|
import type { TooltipContentProps } from 'reka-ui';
|
||||||
|
|
||||||
import type { StyleValue } from 'vue';
|
import type { StyleValue } from 'vue';
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export * from './components';
|
export * from './components';
|
||||||
export * from './ui';
|
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">
|
<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 props = defineProps<AccordionRootProps>();
|
||||||
const emits = defineEmits<AccordionRootEmits>();
|
const emits = defineEmits<AccordionRootEmits>();
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { AccordionContentProps } from 'radix-vue';
|
import type { AccordionContentProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { AccordionContent } from 'radix-vue';
|
import { AccordionContent } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<AccordionContentProps & { class?: any }>();
|
const props = defineProps<AccordionContentProps & { class?: any }>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { AccordionItemProps } from 'radix-vue';
|
import type { AccordionItemProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
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 }>();
|
const props = defineProps<AccordionItemProps & { class?: any }>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { AccordionTriggerProps } from 'radix-vue';
|
import type { AccordionTriggerProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { ChevronDown } from 'lucide-vue-next';
|
import { ChevronDown } from 'lucide-vue-next';
|
||||||
import { AccordionHeader, AccordionTrigger } from 'radix-vue';
|
import { AccordionHeader, AccordionTrigger } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<AccordionTriggerProps & { class?: any }>();
|
const props = defineProps<AccordionTriggerProps & { class?: any }>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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 props = defineProps<AlertDialogProps>();
|
||||||
const emits = defineEmits<AlertDialogEmits>();
|
const emits = defineEmits<AlertDialogEmits>();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
const props = defineProps<AlertDialogActionProps>();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
const props = defineProps<AlertDialogCancelProps>();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type {
|
import type { AlertDialogContentEmits, AlertDialogContentProps } from 'reka-ui';
|
||||||
AlertDialogContentEmits,
|
|
||||||
AlertDialogContentProps,
|
|
||||||
} from 'radix-vue';
|
|
||||||
|
|
||||||
import type { ClassType } from '@vben-core/typings';
|
import type { ClassType } from '@vben-core/typings';
|
||||||
|
|
||||||
@@ -14,7 +11,7 @@ import {
|
|||||||
AlertDialogContent,
|
AlertDialogContent,
|
||||||
AlertDialogPortal,
|
AlertDialogPortal,
|
||||||
useForwardPropsEmits,
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import AlertDialogOverlay from './AlertDialogOverlay.vue';
|
import AlertDialogOverlay from './AlertDialogOverlay.vue';
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { AlertDialogDescriptionProps } from 'radix-vue';
|
import type { AlertDialogDescriptionProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
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 }>();
|
const props = defineProps<AlertDialogDescriptionProps & { class?: any }>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { AlertDialogTitleProps } from 'radix-vue';
|
import type { AlertDialogTitleProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
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 }>();
|
const props = defineProps<AlertDialogTitleProps & { class?: any }>();
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { AvatarVariants } from './avatar';
|
|||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { AvatarRoot } from 'radix-vue';
|
import { AvatarRoot } from 'reka-ui';
|
||||||
|
|
||||||
import { avatarVariant } from './avatar';
|
import { avatarVariant } from './avatar';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
const props = defineProps<AvatarFallbackProps>();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
const props = defineProps<AvatarImageProps>();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { PrimitiveProps } from 'radix-vue';
|
import type { PrimitiveProps } from 'reka-ui';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { Primitive } from 'radix-vue';
|
import { Primitive } from 'reka-ui';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<PrimitiveProps & { class?: any }>(), {
|
const props = withDefaults(defineProps<PrimitiveProps & { class?: any }>(), {
|
||||||
as: 'a',
|
as: 'a',
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PrimitiveProps } from 'radix-vue';
|
import type { PrimitiveProps } from 'reka-ui';
|
||||||
|
|
||||||
import type { ButtonVariants, ButtonVariantSize } from './types';
|
import type { ButtonVariants, ButtonVariantSize } from './types';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { Primitive } from 'radix-vue';
|
import { Primitive } from 'reka-ui';
|
||||||
|
|
||||||
import { buttonVariants } from './button';
|
import { buttonVariants } from './button';
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
|
import type { CheckboxRootEmits, CheckboxRootProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { Check, Minus } from 'lucide-vue-next';
|
import { Check, Minus } from 'lucide-vue-next';
|
||||||
import {
|
import { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits } from 'reka-ui';
|
||||||
CheckboxIndicator,
|
|
||||||
CheckboxRoot,
|
|
||||||
useForwardPropsEmits,
|
|
||||||
} from 'radix-vue';
|
|
||||||
|
|
||||||
const props = defineProps<
|
const props = defineProps<
|
||||||
CheckboxRootProps & { class?: any; indeterminate?: boolean }
|
CheckboxRootProps & { class?: any; indeterminate?: boolean }
|
||||||
@@ -31,7 +27,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|||||||
v-bind="forwarded"
|
v-bind="forwarded"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground border-border peer h-4 w-4 shrink-0 rounded-sm border transition focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50',
|
'focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground border-border hover:border-primary peer h-4 w-4 shrink-0 rounded-sm border transition focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50',
|
||||||
props.class,
|
props.class,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>(), {
|
const props = withDefaults(defineProps<ContextMenuRootProps>(), {
|
||||||
modal: false,
|
modal: false,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import type {
|
import type {
|
||||||
ContextMenuCheckboxItemEmits,
|
ContextMenuCheckboxItemEmits,
|
||||||
ContextMenuCheckboxItemProps,
|
ContextMenuCheckboxItemProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
ContextMenuCheckboxItem,
|
ContextMenuCheckboxItem,
|
||||||
ContextMenuItemIndicator,
|
ContextMenuItemIndicator,
|
||||||
useForwardPropsEmits,
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<ContextMenuCheckboxItemProps & { class?: any }>();
|
const props = defineProps<ContextMenuCheckboxItemProps & { class?: any }>();
|
||||||
const emits = defineEmits<ContextMenuCheckboxItemEmits>();
|
const emits = defineEmits<ContextMenuCheckboxItemEmits>();
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type {
|
import type { ContextMenuContentEmits, ContextMenuContentProps } from 'reka-ui';
|
||||||
ContextMenuContentEmits,
|
|
||||||
ContextMenuContentProps,
|
|
||||||
} from 'radix-vue';
|
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
@@ -12,7 +9,7 @@ import {
|
|||||||
ContextMenuContent,
|
ContextMenuContent,
|
||||||
ContextMenuPortal,
|
ContextMenuPortal,
|
||||||
useForwardPropsEmits,
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<ContextMenuContentProps & { class?: any }>();
|
const props = defineProps<ContextMenuContentProps & { class?: any }>();
|
||||||
const emits = defineEmits<ContextMenuContentEmits>();
|
const emits = defineEmits<ContextMenuContentEmits>();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
const props = defineProps<ContextMenuGroupProps>();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ContextMenuItemEmits, ContextMenuItemProps } from 'radix-vue';
|
import type { ContextMenuItemEmits, ContextMenuItemProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { ContextMenuItem, useForwardPropsEmits } from 'radix-vue';
|
import { ContextMenuItem, useForwardPropsEmits } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<
|
const props = defineProps<
|
||||||
ContextMenuItemProps & { class?: any; inset?: boolean }
|
ContextMenuItemProps & { class?: any; inset?: boolean }
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ContextMenuLabelProps } from 'radix-vue';
|
import type { ContextMenuLabelProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { ContextMenuLabel } from 'radix-vue';
|
import { ContextMenuLabel } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<
|
const props = defineProps<
|
||||||
ContextMenuLabelProps & { class?: any; inset?: boolean }
|
ContextMenuLabelProps & { class?: any; inset?: boolean }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
const props = defineProps<ContextMenuPortalProps>();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
import type {
|
import type {
|
||||||
ContextMenuRadioGroupEmits,
|
ContextMenuRadioGroupEmits,
|
||||||
ContextMenuRadioGroupProps,
|
ContextMenuRadioGroupProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import { ContextMenuRadioGroup, useForwardPropsEmits } from 'radix-vue';
|
import { ContextMenuRadioGroup, useForwardPropsEmits } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<ContextMenuRadioGroupProps>();
|
const props = defineProps<ContextMenuRadioGroupProps>();
|
||||||
const emits = defineEmits<ContextMenuRadioGroupEmits>();
|
const emits = defineEmits<ContextMenuRadioGroupEmits>();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import type {
|
import type {
|
||||||
ContextMenuRadioItemEmits,
|
ContextMenuRadioItemEmits,
|
||||||
ContextMenuRadioItemProps,
|
ContextMenuRadioItemProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
ContextMenuItemIndicator,
|
ContextMenuItemIndicator,
|
||||||
ContextMenuRadioItem,
|
ContextMenuRadioItem,
|
||||||
useForwardPropsEmits,
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<ContextMenuRadioItemProps & { class?: any }>();
|
const props = defineProps<ContextMenuRadioItemProps & { class?: any }>();
|
||||||
const emits = defineEmits<ContextMenuRadioItemEmits>();
|
const emits = defineEmits<ContextMenuRadioItemEmits>();
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ContextMenuSeparatorProps } from 'radix-vue';
|
import type { ContextMenuSeparatorProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { ContextMenuSeparator } from 'radix-vue';
|
import { ContextMenuSeparator } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<ContextMenuSeparatorProps & { class?: any }>();
|
const props = defineProps<ContextMenuSeparatorProps & { class?: any }>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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 props = defineProps<ContextMenuSubProps>();
|
||||||
const emits = defineEmits<ContextMenuSubEmits>();
|
const emits = defineEmits<ContextMenuSubEmits>();
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
import type {
|
import type {
|
||||||
DropdownMenuSubContentEmits,
|
DropdownMenuSubContentEmits,
|
||||||
DropdownMenuSubContentProps,
|
DropdownMenuSubContentProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
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 props = defineProps<DropdownMenuSubContentProps & { class?: any }>();
|
||||||
const emits = defineEmits<DropdownMenuSubContentEmits>();
|
const emits = defineEmits<DropdownMenuSubContentEmits>();
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ContextMenuSubTriggerProps } from 'radix-vue';
|
import type { ContextMenuSubTriggerProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { ChevronRight } from 'lucide-vue-next';
|
import { ChevronRight } from 'lucide-vue-next';
|
||||||
import { ContextMenuSubTrigger, useForwardProps } from 'radix-vue';
|
import { ContextMenuSubTrigger, useForwardProps } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<
|
const props = defineProps<
|
||||||
ContextMenuSubTriggerProps & {
|
ContextMenuSubTriggerProps & {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
const props = defineProps<ContextMenuTriggerProps>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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 props = defineProps<DialogRootProps>();
|
||||||
const emits = defineEmits<DialogRootEmits>();
|
const emits = defineEmits<DialogRootEmits>();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
const props = defineProps<DialogCloseProps>();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<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';
|
import type { ClassType } from '@vben-core/typings';
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ import { computed, ref } from 'vue';
|
|||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { X } from 'lucide-vue-next';
|
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';
|
import DialogOverlay from './DialogOverlay.vue';
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { DialogDescriptionProps } from 'radix-vue';
|
import type { DialogDescriptionProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
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 }>();
|
const props = defineProps<DialogDescriptionProps & { class?: any }>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { DialogContentEmits, DialogContentProps } from 'radix-vue';
|
import type { DialogContentEmits, DialogContentProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
DialogOverlay,
|
DialogOverlay,
|
||||||
DialogPortal,
|
DialogPortal,
|
||||||
useForwardPropsEmits,
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<DialogContentProps & { class?: any; zIndex?: number }>(),
|
defineProps<DialogContentProps & { class?: any; zIndex?: number }>(),
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { DialogTitleProps } from 'radix-vue';
|
import type { DialogTitleProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
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 }>();
|
const props = defineProps<DialogTitleProps & { class?: any }>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
const props = defineProps<DialogTriggerProps>();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>(), {
|
const props = withDefaults(defineProps<DropdownMenuRootProps>(), {
|
||||||
modal: false,
|
modal: false,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import type {
|
import type {
|
||||||
DropdownMenuCheckboxItemEmits,
|
DropdownMenuCheckboxItemEmits,
|
||||||
DropdownMenuCheckboxItemProps,
|
DropdownMenuCheckboxItemProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
DropdownMenuCheckboxItem,
|
DropdownMenuCheckboxItem,
|
||||||
DropdownMenuItemIndicator,
|
DropdownMenuItemIndicator,
|
||||||
useForwardPropsEmits,
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: any }>();
|
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: any }>();
|
||||||
const emits = defineEmits<DropdownMenuCheckboxItemEmits>();
|
const emits = defineEmits<DropdownMenuCheckboxItemEmits>();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import type {
|
import type {
|
||||||
DropdownMenuContentEmits,
|
DropdownMenuContentEmits,
|
||||||
DropdownMenuContentProps,
|
DropdownMenuContentProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
DropdownMenuContent,
|
DropdownMenuContent,
|
||||||
DropdownMenuPortal,
|
DropdownMenuPortal,
|
||||||
useForwardPropsEmits,
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<DropdownMenuContentProps & { class?: any }>(),
|
defineProps<DropdownMenuContentProps & { class?: any }>(),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
const props = defineProps<DropdownMenuGroupProps>();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { DropdownMenuItemProps } from 'radix-vue';
|
import type { DropdownMenuItemProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { DropdownMenuItem, useForwardProps } from 'radix-vue';
|
import { DropdownMenuItem, useForwardProps } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<
|
const props = defineProps<
|
||||||
DropdownMenuItemProps & { class?: any; inset?: boolean }
|
DropdownMenuItemProps & { class?: any; inset?: boolean }
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { DropdownMenuLabelProps } from 'radix-vue';
|
import type { DropdownMenuLabelProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { DropdownMenuLabel, useForwardProps } from 'radix-vue';
|
import { DropdownMenuLabel, useForwardProps } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<
|
const props = defineProps<
|
||||||
DropdownMenuLabelProps & { class?: any; inset?: boolean }
|
DropdownMenuLabelProps & { class?: any; inset?: boolean }
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
import type {
|
import type {
|
||||||
DropdownMenuRadioGroupEmits,
|
DropdownMenuRadioGroupEmits,
|
||||||
DropdownMenuRadioGroupProps,
|
DropdownMenuRadioGroupProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import { DropdownMenuRadioGroup, useForwardPropsEmits } from 'radix-vue';
|
import { DropdownMenuRadioGroup, useForwardPropsEmits } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuRadioGroupProps>();
|
const props = defineProps<DropdownMenuRadioGroupProps>();
|
||||||
const emits = defineEmits<DropdownMenuRadioGroupEmits>();
|
const emits = defineEmits<DropdownMenuRadioGroupEmits>();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import type {
|
import type {
|
||||||
DropdownMenuRadioItemEmits,
|
DropdownMenuRadioItemEmits,
|
||||||
DropdownMenuRadioItemProps,
|
DropdownMenuRadioItemProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
DropdownMenuItemIndicator,
|
DropdownMenuItemIndicator,
|
||||||
DropdownMenuRadioItem,
|
DropdownMenuRadioItem,
|
||||||
useForwardPropsEmits,
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuRadioItemProps & { class?: any }>();
|
const props = defineProps<DropdownMenuRadioItemProps & { class?: any }>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { DropdownMenuSeparatorProps } from 'radix-vue';
|
import type { DropdownMenuSeparatorProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { DropdownMenuSeparator } from 'radix-vue';
|
import { DropdownMenuSeparator } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<
|
const props = defineProps<
|
||||||
DropdownMenuSeparatorProps & {
|
DropdownMenuSeparatorProps & {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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 props = defineProps<DropdownMenuSubProps>();
|
||||||
const emits = defineEmits<DropdownMenuSubEmits>();
|
const emits = defineEmits<DropdownMenuSubEmits>();
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
import type {
|
import type {
|
||||||
DropdownMenuSubContentEmits,
|
DropdownMenuSubContentEmits,
|
||||||
DropdownMenuSubContentProps,
|
DropdownMenuSubContentProps,
|
||||||
} from 'radix-vue';
|
} from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
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 props = defineProps<DropdownMenuSubContentProps & { class?: any }>();
|
||||||
const emits = defineEmits<DropdownMenuSubContentEmits>();
|
const emits = defineEmits<DropdownMenuSubContentEmits>();
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { DropdownMenuSubTriggerProps } from 'radix-vue';
|
import type { DropdownMenuSubTriggerProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { ChevronRight } from 'lucide-vue-next';
|
import { ChevronRight } from 'lucide-vue-next';
|
||||||
import { DropdownMenuSubTrigger, useForwardProps } from 'radix-vue';
|
import { DropdownMenuSubTrigger, useForwardProps } from 'reka-ui';
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuSubTriggerProps & { class?: any }>();
|
const props = defineProps<DropdownMenuSubTriggerProps & { class?: any }>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
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 DropdownMenuSubContent } from './DropdownMenuSubContent.vue';
|
||||||
export { default as DropdownMenuSubTrigger } from './DropdownMenuSubTrigger.vue';
|
export { default as DropdownMenuSubTrigger } from './DropdownMenuSubTrigger.vue';
|
||||||
export { default as DropdownMenuTrigger } from './DropdownMenuTrigger.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>
|
<script lang="ts" setup>
|
||||||
import { Slot } from 'radix-vue';
|
import { Slot } from 'reka-ui';
|
||||||
|
|
||||||
import { useFormField } from './useFormField';
|
import { useFormField } from './useFormField';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { LabelProps } from 'radix-vue';
|
import type { LabelProps } from 'reka-ui';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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 props = defineProps<HoverCardRootProps>();
|
||||||
const emits = defineEmits<HoverCardRootEmits>();
|
const emits = defineEmits<HoverCardRootEmits>();
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { HoverCardContentProps } from 'radix-vue';
|
import type { HoverCardContentProps } from 'reka-ui';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { HoverCardContent, HoverCardPortal, useForwardProps } from 'radix-vue';
|
import { HoverCardContent, HoverCardPortal, useForwardProps } from 'reka-ui';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<HoverCardContentProps & { class?: any }>(),
|
defineProps<HoverCardContentProps & { class?: any }>(),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<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>();
|
const props = defineProps<HoverCardTriggerProps>();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user