mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-23 01:30:26 +08:00
refactor(project): re-adjust the overall folder
This commit is contained in:
parent
a1a566cb2f
commit
14538f7ed5
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@ -165,11 +165,11 @@
|
||||
},
|
||||
|
||||
"cssVariables.lookupFiles": [
|
||||
"packages/@vben-core/shared/design-tokens/src/**/*.css"
|
||||
"packages/@vben-core/shared/design/src/**/*.css"
|
||||
],
|
||||
|
||||
"i18n-ally.localesPaths": [
|
||||
"packages/@core/locales/src/langs",
|
||||
"packages/locales/src/langs",
|
||||
"apps/*/src/locales/langs"
|
||||
],
|
||||
"i18n-ally.enabledParsers": ["json", "ts", "js", "yaml"],
|
||||
|
@ -26,11 +26,6 @@
|
||||
"#/*": "./src/*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vben-core/helpers": "workspace:*",
|
||||
"@vben-core/locales": "workspace:*",
|
||||
"@vben-core/preferences": "workspace:*",
|
||||
"@vben-core/request": "workspace:*",
|
||||
"@vben-core/stores": "workspace:*",
|
||||
"@vben/access": "workspace:*",
|
||||
"@vben/chart-ui": "workspace:*",
|
||||
"@vben/common-ui": "workspace:*",
|
||||
@ -38,6 +33,10 @@
|
||||
"@vben/hooks": "workspace:*",
|
||||
"@vben/icons": "workspace:*",
|
||||
"@vben/layouts": "workspace:*",
|
||||
"@vben/locales": "workspace:*",
|
||||
"@vben/preferences": "workspace:*",
|
||||
"@vben/request": "workspace:*",
|
||||
"@vben/stores": "workspace:*",
|
||||
"@vben/styles": "workspace:*",
|
||||
"@vben/types": "workspace:*",
|
||||
"@vben/utils": "workspace:*",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { UserApi } from '../types';
|
||||
|
||||
import { requestClient } from '#/forward';
|
||||
import { requestClient } from '#/apis/request';
|
||||
|
||||
/**
|
||||
* 登录
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { RouteRecordStringComponent } from '@vben/types';
|
||||
|
||||
import { requestClient } from '#/forward';
|
||||
import { requestClient } from '#/apis/request';
|
||||
|
||||
/**
|
||||
* 获取用户所有菜单
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { UserInfo } from '@vben/types';
|
||||
|
||||
import { requestClient } from '#/forward';
|
||||
import { requestClient } from '#/apis/request';
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { requestClient } from '#/forward';
|
||||
import { requestClient } from '#/apis/request';
|
||||
|
||||
/**
|
||||
* 模拟任意状态码
|
||||
|
@ -1,10 +1,10 @@
|
||||
/**
|
||||
* 该文件可自行根据业务逻辑进行调整
|
||||
*/
|
||||
import type { HttpResponse } from '@vben-core/request';
|
||||
import type { HttpResponse } from '@vben/request';
|
||||
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
import { RequestClient } from '@vben-core/request';
|
||||
import { preferences } from '@vben/preferences';
|
||||
import { RequestClient } from '@vben/request';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { GlobalProvider } from '@vben/common-ui';
|
||||
import { preferences, usePreferences } from '@vben-core/preferences';
|
||||
import { preferences, usePreferences } from '@vben/preferences';
|
||||
|
||||
import { App, ConfigProvider, theme } from 'ant-design-vue';
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { createApp } from 'vue';
|
||||
|
||||
import { preferences } from '@vben/preferences';
|
||||
import '@vben/styles';
|
||||
import '@vben/styles/antd';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
|
||||
import { loadMessages, setupI18n } from '#/locales';
|
||||
import { setupStore } from '#/store';
|
||||
|
@ -1,11 +0,0 @@
|
||||
# forward
|
||||
|
||||
用于扩展、转发大仓的包以及其他功能,方便在app内自定义不同的逻辑
|
||||
|
||||
## request
|
||||
|
||||
用于扩展请求的功能,例如添加header、错误响应等
|
||||
|
||||
## locale
|
||||
|
||||
用于扩展国际化的功能,例如扩展 dayjs、antd组件库的多语言切换
|
@ -1,2 +0,0 @@
|
||||
export * from './access';
|
||||
export * from './request';
|
@ -12,12 +12,12 @@ import {
|
||||
NotificationItem,
|
||||
UserDropdown,
|
||||
} from '@vben/layouts';
|
||||
import { preferences } from '@vben/preferences';
|
||||
import { openWindow } from '@vben/utils';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
|
||||
import { $t } from '#/locales';
|
||||
import { resetRoutes } from '#/router';
|
||||
import { storeToRefs, useAccessStore, useAppStore } from '#/store';
|
||||
import { resetAllStores, storeToRefs, useAccessStore } from '#/store';
|
||||
|
||||
const notifications = ref<NotificationItem[]>([
|
||||
{
|
||||
@ -84,10 +84,8 @@ const menus = computed(() => [
|
||||
},
|
||||
]);
|
||||
|
||||
const appStore = useAppStore();
|
||||
const accessStore = useAccessStore();
|
||||
|
||||
const { isLockScreen, lockScreenPassword } = storeToRefs(appStore);
|
||||
const {
|
||||
loading: loginLoading,
|
||||
openLoginExpiredModal,
|
||||
@ -101,8 +99,7 @@ const avatar = computed(() => {
|
||||
const router = useRouter();
|
||||
|
||||
async function handleLogout() {
|
||||
appStore.resetAppState();
|
||||
appStore.unlockScreen();
|
||||
resetAllStores();
|
||||
resetRoutes();
|
||||
await router.replace(LOGIN_PATH);
|
||||
}
|
||||
@ -114,10 +111,6 @@ function handleNoticeClear() {
|
||||
function handleMakeAll() {
|
||||
notifications.value.forEach((item) => (item.isRead = true));
|
||||
}
|
||||
|
||||
function handleLockScreen(password: string) {
|
||||
appStore.lockScreen(password);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -129,7 +122,6 @@ function handleLockScreen(password: string) {
|
||||
:text="userInfo?.realName"
|
||||
description="ann.vben@gmail.com"
|
||||
tag-text="Pro"
|
||||
@lock-screen="handleLockScreen"
|
||||
@logout="handleLogout"
|
||||
/>
|
||||
</template>
|
||||
@ -152,13 +144,7 @@ function handleLockScreen(password: string) {
|
||||
/>
|
||||
</template>
|
||||
<template #lock-screen>
|
||||
<LockScreen
|
||||
v-if="isLockScreen"
|
||||
:avatar
|
||||
:cached-password="lockScreenPassword"
|
||||
@to-login="handleLogout"
|
||||
@unlock="appStore.unlockScreen"
|
||||
/>
|
||||
<LockScreen :avatar @to-login="handleLogout" />
|
||||
</template>
|
||||
</BasicLayout>
|
||||
</template>
|
||||
|
@ -3,7 +3,7 @@ import type { Locale } from 'ant-design-vue/es/locale';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { $t, loadLocalesMap, setupI18n } from '@vben-core/locales';
|
||||
import { $t, loadLocalesMap, setupI18n } from '@vben/locales';
|
||||
|
||||
import antdEnLocale from 'ant-design-vue/es/locale/en_US';
|
||||
import antdDefaultLocale from 'ant-design-vue/es/locale/zh_CN';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { preferencesManager } from '@vben-core/preferences';
|
||||
import { initPreferences } from '@vben/preferences';
|
||||
|
||||
import { overridesPreferences } from './preferences';
|
||||
|
||||
@ -12,7 +12,7 @@ async function initApplication() {
|
||||
const namespace = `${import.meta.env.VITE_APP_NAMESPACE}-${env}`;
|
||||
|
||||
// app偏好设置初始化
|
||||
await preferencesManager.initPreferences({
|
||||
await initPreferences({
|
||||
namespace,
|
||||
overrides: overridesPreferences,
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { defineOverridesPreferences } from '@vben-core/preferences';
|
||||
import { defineOverridesPreferences } from '@vben/preferences';
|
||||
|
||||
/**
|
||||
* @description 项目配置文件
|
||||
|
@ -4,7 +4,7 @@ import type {
|
||||
} from '@vben/types';
|
||||
|
||||
import { generateAccessible } from '@vben/access';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
import { preferences } from '@vben/preferences';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
@ -1,16 +1,17 @@
|
||||
import type { Router } from 'vue-router';
|
||||
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
import { preferences } from '@vben/preferences';
|
||||
import { startProgress, stopProgress } from '@vben/utils';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
|
||||
import { useTitle } from '@vueuse/core';
|
||||
|
||||
import { generateAccess } from '#/forward';
|
||||
import { $t } from '#/locales';
|
||||
import { coreRouteNames, dynamicRoutes } from '#/router/routes';
|
||||
import { useAccessStore } from '#/store';
|
||||
|
||||
import { generateAccess } from './access';
|
||||
|
||||
/**
|
||||
* 通用守卫配置
|
||||
* @param router
|
||||
|
@ -1,7 +1,6 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { traverseTreeValues } from '@vben/utils';
|
||||
import { mergeRouteModules } from '@vben-core/helpers';
|
||||
import { mergeRouteModules, traverseTreeValues } from '@vben/utils';
|
||||
|
||||
import { coreRoutes, fallbackNotFoundRoute } from './core';
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { InitStoreOptions } from '@vben-core/stores';
|
||||
import type { InitStoreOptions } from '@vben/stores';
|
||||
|
||||
import type { App } from 'vue';
|
||||
|
||||
import { initStore, storeToRefs } from '@vben-core/stores';
|
||||
import { initStore, resetAllStores, storeToRefs } from '@vben/stores';
|
||||
|
||||
/**
|
||||
* @zh_CN 初始化pinia
|
||||
@ -13,7 +13,6 @@ async function setupStore(app: App, options: InitStoreOptions) {
|
||||
app.use(pinia);
|
||||
}
|
||||
|
||||
export { setupStore, storeToRefs };
|
||||
export { resetAllStores, setupStore, storeToRefs };
|
||||
|
||||
export { useAccessStore } from './modules/access';
|
||||
export { useAppStore } from './modules/app';
|
||||
|
@ -6,7 +6,7 @@ import { computed, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { DEFAULT_HOME_PATH, LOGIN_PATH } from '@vben/constants';
|
||||
import { useCoreAccessStore } from '@vben-core/stores';
|
||||
import { resetAllStores, useCoreAccessStore } from '@vben/stores';
|
||||
|
||||
import { notification } from 'ant-design-vue';
|
||||
import { defineStore } from 'pinia';
|
||||
@ -50,7 +50,7 @@ export const useAccessStore = defineStore('access', () => {
|
||||
onSuccess?: () => Promise<void> | void,
|
||||
) {
|
||||
// 异步处理用户登录操作并获取 accessToken
|
||||
let userInfo: UserInfo | null = null;
|
||||
let userInfo: null | UserInfo = null;
|
||||
try {
|
||||
loading.value = true;
|
||||
const { accessToken, refreshToken } = await login(params);
|
||||
@ -102,7 +102,7 @@ export const useAccessStore = defineStore('access', () => {
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
coreStoreAccess.$reset();
|
||||
resetAllStores();
|
||||
openLoginExpiredModal.value = false;
|
||||
|
||||
// 回登陆页带上当前路由地址
|
||||
@ -115,17 +115,19 @@ export const useAccessStore = defineStore('access', () => {
|
||||
}
|
||||
|
||||
async function fetchUserInfo() {
|
||||
let userInfo: UserInfo | null = null;
|
||||
let userInfo: null | UserInfo = null;
|
||||
userInfo = await getUserInfo();
|
||||
coreStoreAccess.setUserInfo(userInfo);
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
function reset() {
|
||||
coreStoreAccess.$reset();
|
||||
function $reset() {
|
||||
loading.value = false;
|
||||
openLoginExpiredModal.value = false;
|
||||
}
|
||||
|
||||
return {
|
||||
$reset,
|
||||
accessRoutes,
|
||||
accessToken,
|
||||
authLogin,
|
||||
@ -134,7 +136,6 @@ export const useAccessStore = defineStore('access', () => {
|
||||
logout,
|
||||
openLoginExpiredModal,
|
||||
refreshToken,
|
||||
reset,
|
||||
setAccessMenus,
|
||||
setAccessRoutes,
|
||||
setAccessToken,
|
||||
|
@ -4,6 +4,7 @@ import type { LoginCodeParams } from '@vben/common-ui';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { AuthenticationCodeLogin } from '@vben/common-ui';
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
|
||||
defineOptions({ name: 'CodeLogin' });
|
||||
|
||||
@ -21,5 +22,9 @@ async function handleLogin(values: LoginCodeParams) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthenticationCodeLogin :loading="loading" @submit="handleLogin" />
|
||||
<AuthenticationCodeLogin
|
||||
:loading="loading"
|
||||
:login-path="LOGIN_PATH"
|
||||
@submit="handleLogin"
|
||||
/>
|
||||
</template>
|
||||
|
@ -2,6 +2,7 @@
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { AuthenticationForgetPassword } from '@vben/common-ui';
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
|
||||
defineOptions({ name: 'ForgetPassword' });
|
||||
|
||||
@ -14,5 +15,9 @@ function handleSubmit(value: string) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthenticationForgetPassword :loading="loading" @submit="handleSubmit" />
|
||||
<AuthenticationForgetPassword
|
||||
:loading="loading"
|
||||
:login-path="LOGIN_PATH"
|
||||
@submit="handleSubmit"
|
||||
/>
|
||||
</template>
|
||||
|
@ -1,9 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
import { AuthenticationQrCodeLogin } from '@vben/common-ui';
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
|
||||
defineOptions({ name: 'QrCodeLogin' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthenticationQrCodeLogin />
|
||||
<AuthenticationQrCodeLogin :login-path="LOGIN_PATH" />
|
||||
</template>
|
||||
|
@ -4,6 +4,7 @@ import type { LoginAndRegisterParams } from '@vben/common-ui';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { AuthenticationRegister } from '@vben/common-ui';
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
|
||||
defineOptions({ name: 'Register' });
|
||||
|
||||
@ -16,5 +17,9 @@ function handleSubmit(value: LoginAndRegisterParams) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthenticationRegister :loading="loading" @submit="handleSubmit" />
|
||||
<AuthenticationRegister
|
||||
:loading="loading"
|
||||
:login-path="LOGIN_PATH"
|
||||
@submit="handleSubmit"
|
||||
/>
|
||||
</template>
|
||||
|
@ -16,7 +16,7 @@ import {
|
||||
WorkbenchTodo,
|
||||
WorkbenchTrends,
|
||||
} from '@vben/common-ui';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
import { preferences } from '@vben/preferences';
|
||||
|
||||
import { useAccessStore } from '#/store';
|
||||
|
||||
|
@ -7,7 +7,7 @@ import { AccessControl, useAccess } from '@vben/access';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
|
||||
import { useAccessStore, useAppStore } from '#/store';
|
||||
import { resetAllStores, useAccessStore } from '#/store';
|
||||
|
||||
defineOptions({ name: 'AccessButtonControl' });
|
||||
|
||||
@ -28,7 +28,6 @@ const accounts: Record<string, LoginAndRegisterParams> = {
|
||||
|
||||
const { accessMode, hasAccessByCodes } = useAccess();
|
||||
const accessStore = useAccessStore();
|
||||
const appStore = useAppStore();
|
||||
const router = useRouter();
|
||||
|
||||
function roleButtonType(role: string) {
|
||||
@ -41,7 +40,7 @@ async function changeAccount(role: string) {
|
||||
}
|
||||
|
||||
const account = accounts[role];
|
||||
appStore.resetAppState();
|
||||
resetAllStores();
|
||||
await accessStore.authLogin(account, async () => {
|
||||
router.go(0);
|
||||
});
|
||||
|
@ -7,7 +7,7 @@ import { useAccess } from '@vben/access';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
|
||||
import { useAccessStore, useAppStore } from '#/store';
|
||||
import { resetAllStores, useAccessStore } from '#/store';
|
||||
|
||||
defineOptions({ name: 'Access' });
|
||||
|
||||
@ -28,7 +28,6 @@ const accounts: Record<string, LoginAndRegisterParams> = {
|
||||
|
||||
const { accessMode, toggleAccessMode } = useAccess();
|
||||
const accessStore = useAccessStore();
|
||||
const appStore = useAppStore();
|
||||
const router = useRouter();
|
||||
|
||||
function roleButtonType(role: string) {
|
||||
@ -41,7 +40,7 @@ async function changeAccount(role: string) {
|
||||
}
|
||||
|
||||
const account = accounts[role];
|
||||
appStore.resetAppState();
|
||||
resetAllStores();
|
||||
await accessStore.authLogin(account, async () => {
|
||||
router.go(0);
|
||||
});
|
||||
@ -49,7 +48,8 @@ async function changeAccount(role: string) {
|
||||
|
||||
async function handleToggleAccessMode() {
|
||||
await toggleAccessMode();
|
||||
appStore.resetAppState();
|
||||
resetAllStores();
|
||||
|
||||
await accessStore.authLogin(accounts.super, async () => {
|
||||
router.go(0);
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { LoginExpiredModeType } from '@vben/types';
|
||||
|
||||
import { preferences, updatePreferences } from '@vben-core/preferences';
|
||||
import { preferences, updatePreferences } from '@vben/preferences';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
|
||||
|
@ -32,22 +32,22 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.7.0",
|
||||
"@types/eslint": "^8.56.10",
|
||||
"@typescript-eslint/eslint-plugin": "^7.16.1",
|
||||
"@typescript-eslint/parser": "^7.16.1",
|
||||
"@types/eslint": "^9.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.17.0",
|
||||
"@typescript-eslint/parser": "^7.17.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-i": "^2.29.1",
|
||||
"eslint-plugin-jsdoc": "^48.8.1",
|
||||
"eslint-plugin-jsdoc": "^48.8.3",
|
||||
"eslint-plugin-jsonc": "^2.16.0",
|
||||
"eslint-plugin-n": "^17.9.0",
|
||||
"eslint-plugin-no-only-tests": "^3.1.0",
|
||||
"eslint-plugin-perfectionist": "^2.11.0",
|
||||
"eslint-plugin-perfectionist": "^3.0.0",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"eslint-plugin-regexp": "^2.6.0",
|
||||
"eslint-plugin-unicorn": "^54.0.0",
|
||||
"eslint-plugin-unused-imports": "^4.0.0",
|
||||
"eslint-plugin-unused-imports": "^4.0.1",
|
||||
"eslint-plugin-vitest": "^0.5.4",
|
||||
"eslint-plugin-vue": "^9.27.0",
|
||||
"globals": "^15.8.0",
|
||||
|
@ -1,13 +1,10 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function perfectionist(): Promise<Linter.FlatConfig[]> {
|
||||
const [perfectionistNatural] = await Promise.all([
|
||||
// @ts-expect-error - no types
|
||||
import('eslint-plugin-perfectionist/configs/recommended-natural'),
|
||||
] as const);
|
||||
import perfectionistPlugin from 'eslint-plugin-perfectionist';
|
||||
|
||||
export async function perfectionist(): Promise<Linter.FlatConfig[]> {
|
||||
return [
|
||||
perfectionistNatural,
|
||||
perfectionistPlugin.configs['recommended-natural'],
|
||||
{
|
||||
rules: {
|
||||
'perfectionist/sort-exports': [
|
||||
@ -20,7 +17,7 @@ export async function perfectionist(): Promise<Linter.FlatConfig[]> {
|
||||
'perfectionist/sort-imports': [
|
||||
'error',
|
||||
{
|
||||
'custom-groups': {
|
||||
customGroups: {
|
||||
type: {
|
||||
vben: 'vben',
|
||||
vue: 'vue',
|
||||
@ -46,8 +43,8 @@ export async function perfectionist(): Promise<Linter.FlatConfig[]> {
|
||||
'object',
|
||||
'unknown',
|
||||
],
|
||||
'internal-pattern': ['#*', '#*/**'],
|
||||
'newlines-between': 'always',
|
||||
internalPattern: ['#*', '#*/**'],
|
||||
newlinesBetween: 'always',
|
||||
order: 'asc',
|
||||
type: 'natural',
|
||||
},
|
||||
@ -62,15 +59,15 @@ export async function perfectionist(): Promise<Linter.FlatConfig[]> {
|
||||
'perfectionist/sort-objects': [
|
||||
'error',
|
||||
{
|
||||
'custom-groups': {
|
||||
customGroups: {
|
||||
items: 'items',
|
||||
list: 'list',
|
||||
children: 'children',
|
||||
},
|
||||
groups: ['unknown', 'items', 'list', 'children'],
|
||||
'ignore-pattern': ['children'],
|
||||
ignorePattern: ['children'],
|
||||
order: 'asc',
|
||||
'partition-by-comment': 'Part:**',
|
||||
partitionByComment: 'Part:**',
|
||||
type: 'natural',
|
||||
},
|
||||
],
|
||||
@ -78,7 +75,7 @@ export async function perfectionist(): Promise<Linter.FlatConfig[]> {
|
||||
'error',
|
||||
{
|
||||
// Based on: https://vuejs.org/style-guide/rules-recommended.html#element-attribute-order
|
||||
'custom-groups': {
|
||||
customGroups: {
|
||||
/* eslint-disable perfectionist/sort-objects */
|
||||
DEFINITION: '*(is|:is|v-is)',
|
||||
LIST_RENDERING: 'v-for',
|
||||
|
@ -12,7 +12,6 @@
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "pnpm unbuild",
|
||||
"stub": "pnpm unbuild --stub"
|
||||
},
|
||||
"files": [
|
||||
@ -47,7 +46,7 @@
|
||||
"tailwindcss": "^3.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify/json": "^2.2.229",
|
||||
"@iconify/json": "^2.2.230",
|
||||
"@iconify/tailwind": "^1.1.1",
|
||||
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
|
||||
"@tailwindcss/typography": "^0.5.13",
|
||||
|
@ -30,8 +30,8 @@ const shadcnUiColors = {
|
||||
hover: 'hsl(var(--accent-hover))',
|
||||
},
|
||||
background: {
|
||||
DEFAULT: 'hsl(var(--background))',
|
||||
deep: 'hsl(var(--background-deep))',
|
||||
DEFAULT: 'hsl(var(--background))',
|
||||
},
|
||||
border: {
|
||||
DEFAULT: 'hsl(var(--border))',
|
||||
@ -50,8 +50,8 @@ const shadcnUiColors = {
|
||||
},
|
||||
|
||||
input: {
|
||||
DEFAULT: 'hsl(var(--input))',
|
||||
background: 'hsl(var(--input-background))',
|
||||
DEFAULT: 'hsl(var(--input))',
|
||||
},
|
||||
muted: {
|
||||
DEFAULT: 'hsl(var(--muted))',
|
||||
@ -95,8 +95,8 @@ const customColors = {
|
||||
foreground: 'hsl(var(--destructive-foreground))',
|
||||
},
|
||||
sidebar: {
|
||||
DEFAULT: 'hsl(var(--sidebar))',
|
||||
deep: 'hsl(var(--sidebar-deep))',
|
||||
DEFAULT: 'hsl(var(--sidebar))',
|
||||
},
|
||||
success: {
|
||||
...createColorsPalette('success'),
|
||||
|
@ -70,7 +70,7 @@ interface CommonPluginOptions {
|
||||
/** 构建模式 */
|
||||
mode?: string;
|
||||
/** 开启依赖分析 */
|
||||
visualizer?: PluginVisualizerOptions | boolean;
|
||||
visualizer?: boolean | PluginVisualizerOptions;
|
||||
}
|
||||
|
||||
interface ApplicationPluginOptions extends CommonPluginOptions {
|
||||
@ -110,7 +110,7 @@ interface ApplicationPluginOptions extends CommonPluginOptions {
|
||||
|
||||
interface LibraryPluginOptions extends CommonPluginOptions {
|
||||
/** 开启 dts 输出 */
|
||||
dts?: PluginOptions | boolean;
|
||||
dts?: boolean | PluginOptions;
|
||||
|
||||
/** 是否注入lib css */
|
||||
injectLibCss?: boolean;
|
||||
|
12
package.json
12
package.json
@ -66,23 +66,23 @@
|
||||
"@vben/vsh": "workspace:*",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"cross-env": "^7.0.3",
|
||||
"cspell": "^8.11.0",
|
||||
"cspell": "^8.12.1",
|
||||
"husky": "^9.1.1",
|
||||
"is-ci": "^3.0.1",
|
||||
"jsdom": "^24.1.0",
|
||||
"jsdom": "^24.1.1",
|
||||
"rimraf": "^6.0.1",
|
||||
"turbo": "^2.0.9",
|
||||
"typescript": "^5.5.3",
|
||||
"typescript": "^5.5.4",
|
||||
"unbuild": "^2.0.0",
|
||||
"vite": "^5.3.4",
|
||||
"vitest": "^2.0.3",
|
||||
"vue-tsc": "^2.0.26"
|
||||
"vitest": "^2.0.4",
|
||||
"vue-tsc": "^2.0.28"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20",
|
||||
"pnpm": ">=9"
|
||||
},
|
||||
"packageManager": "pnpm@9.5.0",
|
||||
"packageManager": "pnpm@9.6.0",
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"@ctrl/tinycolor": "^4.1.0",
|
||||
|
@ -1,7 +0,0 @@
|
||||
# @vben-core/forward
|
||||
|
||||
该目录内的包,可直接被app所引用,其是项目基础功能的一层抽象。允许轻微的副作用耦合,如`locales`的集成。
|
||||
|
||||
## 注意事项
|
||||
|
||||
- `forward` 内的包不允许相互引用,有相互引用的情况请考虑是否放到`packages/effects`下
|
@ -1,43 +0,0 @@
|
||||
{
|
||||
"name": "@vben-core/helpers",
|
||||
"version": "5.0.0",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
|
||||
"directory": "packages/@vben-core/forward/helpers"
|
||||
},
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "pnpm unbuild",
|
||||
"stub": "pnpm unbuild --stub"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"main": "./dist/index.mjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./src/index.ts",
|
||||
"development": "./src/index.ts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@vben-core/toolkit": "workspace:*",
|
||||
"@vben-core/typings": "workspace:*",
|
||||
"vue-router": "^4.4.0"
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
import { createPinia } from 'pinia';
|
||||
|
||||
interface InitStoreOptions {
|
||||
/**
|
||||
* @zh_CN 应用名,由于 @vben-core/stores 是公用的,后续可能有多个app,为了防止多个app缓存冲突,可在这里配置应用名,应用名将被用于持久化的前缀
|
||||
*/
|
||||
namespace: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @zh_CN 初始化pinia
|
||||
*/
|
||||
async function initStore(options: InitStoreOptions) {
|
||||
const { createPersistedState } = await import('pinia-plugin-persistedstate');
|
||||
const pinia = createPinia();
|
||||
const { namespace } = options;
|
||||
pinia.use(
|
||||
createPersistedState({
|
||||
// key $appName-$store.id
|
||||
key: (storeKey) => `${namespace}-${storeKey}`,
|
||||
storage: localStorage,
|
||||
}),
|
||||
);
|
||||
return pinia;
|
||||
}
|
||||
|
||||
export { initStore };
|
||||
|
||||
export type { InitStoreOptions };
|
@ -6,13 +6,12 @@
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
|
||||
"directory": "packages/@vben-core/shared/hooks"
|
||||
"directory": "packages/@core/hooks"
|
||||
},
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "pnpm unbuild",
|
||||
"stub": "pnpm unbuild --stub"
|
||||
"build": "pnpm unbuild"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
@ -37,14 +36,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@vben-core/constants": "workspace:*",
|
||||
"@vben-core/preferences": "workspace:*",
|
||||
"@vben-core/stores": "workspace:*",
|
||||
"@vben-core/toolkit": "workspace:*",
|
||||
"@vueuse/core": "^10.11.0",
|
||||
"radix-vue": "^1.9.2",
|
||||
"sortablejs": "^1.15.2",
|
||||
"vue": "^3.4.33",
|
||||
"vue-router": "^4.4.0"
|
||||
"vue": "^3.4.33"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/sortablejs": "^1.15.8"
|
||||
|
@ -1,9 +1,6 @@
|
||||
export * from './use-content-height';
|
||||
export * from './use-content-maximize';
|
||||
export * from './use-namespace';
|
||||
export * from './use-refresh';
|
||||
export * from './use-sortable';
|
||||
export * from './use-tabs';
|
||||
export {
|
||||
useEmitAsProps,
|
||||
useForwardExpose,
|
||||
|
@ -6,13 +6,12 @@
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
|
||||
"directory": "packages/@vben-core/forward/preferences"
|
||||
"directory": "packages/@core/preferences"
|
||||
},
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "pnpm unbuild",
|
||||
"stub": "pnpm unbuild --stub"
|
||||
"build": "pnpm unbuild"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
@ -1,11 +1,10 @@
|
||||
import type { DeepPartial } from '@vben-core/typings';
|
||||
|
||||
import type { Preferences } from './types';
|
||||
|
||||
import { preferencesManager } from './preferences';
|
||||
|
||||
// 偏好设置(带有层级关系)
|
||||
const preferences: Preferences = preferencesManager.getPreferences();
|
||||
const preferences: Preferences =
|
||||
preferencesManager.getPreferences.apply(preferencesManager);
|
||||
|
||||
// 更新偏好设置
|
||||
const updatePreferences =
|
||||
@ -18,13 +17,13 @@ const resetPreferences =
|
||||
const clearPreferencesCache =
|
||||
preferencesManager.clearCache.bind(preferencesManager);
|
||||
|
||||
function defineOverridesPreferences(preferences: DeepPartial<Preferences>) {
|
||||
return preferences;
|
||||
}
|
||||
// 初始化偏好设置
|
||||
const initPreferences =
|
||||
preferencesManager.initPreferences.bind(preferencesManager);
|
||||
|
||||
export {
|
||||
clearPreferencesCache,
|
||||
defineOverridesPreferences,
|
||||
initPreferences,
|
||||
preferences,
|
||||
preferencesManager,
|
||||
resetPreferences,
|
@ -1,7 +1,7 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { defaultPreferences } from './config';
|
||||
import { PreferenceManager, isDarkTheme } from './preferences';
|
||||
import { isDarkTheme, PreferenceManager } from './preferences';
|
||||
|
||||
describe('preferences', () => {
|
||||
let preferenceManager: PreferenceManager;
|
@ -1,10 +1,10 @@
|
||||
import type { DeepPartial } from '@vben-core/typings';
|
||||
|
||||
import type { Preferences } from './types';
|
||||
import type { InitialOptions, Preferences } from './types';
|
||||
|
||||
import { markRaw, reactive, readonly, watch } from 'vue';
|
||||
|
||||
import { StorageManager, isMacOs, merge } from '@vben-core/toolkit';
|
||||
import { isMacOs, merge, StorageManager } from '@vben-core/toolkit';
|
||||
|
||||
import {
|
||||
breakpointsTailwind,
|
||||
@ -19,11 +19,6 @@ const STORAGE_KEY = 'preferences';
|
||||
const STORAGE_KEY_LOCALE = `${STORAGE_KEY}-locale`;
|
||||
const STORAGE_KEY_THEME = `${STORAGE_KEY}-theme`;
|
||||
|
||||
interface initialOptions {
|
||||
namespace: string;
|
||||
overrides?: DeepPartial<Preferences>;
|
||||
}
|
||||
|
||||
function isDarkTheme(theme: string) {
|
||||
let dark = theme === 'dark';
|
||||
if (theme === 'auto') {
|
||||
@ -33,7 +28,7 @@ function isDarkTheme(theme: string) {
|
||||
}
|
||||
|
||||
class PreferenceManager {
|
||||
private cache: StorageManager | null = null;
|
||||
private cache: null | StorageManager = null;
|
||||
// private flattenedState: Flatten<Preferences>;
|
||||
private initialPreferences: Preferences = defaultPreferences;
|
||||
private isInitialized: boolean = false;
|
||||
@ -171,7 +166,7 @@ class PreferenceManager {
|
||||
* overrides 要覆盖的偏好设置
|
||||
* namespace 命名空间
|
||||
*/
|
||||
public async initPreferences({ namespace, overrides }: initialOptions) {
|
||||
public async initPreferences({ namespace, overrides }: InitialOptions) {
|
||||
// 是否初始化过
|
||||
if (this.isInitialized) {
|
||||
return;
|
||||
@ -237,4 +232,4 @@ class PreferenceManager {
|
||||
}
|
||||
|
||||
const preferencesManager = new PreferenceManager();
|
||||
export { PreferenceManager, isDarkTheme, preferencesManager };
|
||||
export { isDarkTheme, PreferenceManager, preferencesManager };
|
@ -4,6 +4,7 @@ import type {
|
||||
BreadcrumbStyleType,
|
||||
BuiltinThemeType,
|
||||
ContentCompactType,
|
||||
DeepPartial,
|
||||
LayoutHeaderModeType,
|
||||
LayoutType,
|
||||
LoginExpiredModeType,
|
||||
@ -232,11 +233,16 @@ interface Preferences {
|
||||
|
||||
type PreferencesKeys = keyof Preferences;
|
||||
|
||||
interface InitialOptions {
|
||||
namespace: string;
|
||||
overrides?: DeepPartial<Preferences>;
|
||||
}
|
||||
export type {
|
||||
AppPreferences,
|
||||
BreadcrumbPreferences,
|
||||
FooterPreferences,
|
||||
HeaderPreferences,
|
||||
InitialOptions,
|
||||
LogoPreferences,
|
||||
NavigationPreferences,
|
||||
Preferences,
|
@ -11,8 +11,7 @@
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "pnpm unbuild",
|
||||
"stub": "pnpm unbuild --stub"
|
||||
"build": "pnpm unbuild"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
@ -11,8 +11,7 @@
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "pnpm unbuild",
|
||||
"stub": "pnpm unbuild --stub"
|
||||
"build": "pnpm unbuild"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
@ -36,7 +35,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify/vue": "^4.1.2",
|
||||
"lucide-vue-next": "^0.411.0",
|
||||
"lucide-vue-next": "^0.414.0",
|
||||
"vue": "^3.4.33"
|
||||
}
|
||||
}
|
||||
|
@ -11,8 +11,7 @@
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "pnpm unbuild",
|
||||
"stub": "pnpm unbuild --stub"
|
||||
"build": "pnpm unbuild"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
@ -67,7 +67,7 @@ class StorageManager {
|
||||
* @param defaultValue 当项不存在或已过期时返回的默认值
|
||||
* @returns 值,如果项已过期或解析错误则返回默认值
|
||||
*/
|
||||
getItem<T>(key: string, defaultValue: T | null = null): T | null {
|
||||
getItem<T>(key: string, defaultValue: null | T = null): null | T {
|
||||
const fullKey = this.getFullKey(key);
|
||||
const itemStr = this.storage.getItem(fullKey);
|
||||
if (!itemStr) {
|
||||
|
@ -7,7 +7,7 @@ interface StorageValue<T> {
|
||||
|
||||
interface IStorageCache {
|
||||
clear(): void;
|
||||
getItem<T>(key: string): T | null;
|
||||
getItem<T>(key: string): null | T;
|
||||
key(index: number): null | string;
|
||||
length(): number;
|
||||
removeItem(key: string): void;
|
||||
|
@ -41,4 +41,4 @@ function isValidColor(color?: string) {
|
||||
return new TinyColor(color).isValid;
|
||||
}
|
||||
|
||||
export { TinyColor, convertToHsl, convertToHslCssVar, isValidColor };
|
||||
export { convertToHsl, convertToHslCssVar, isValidColor, TinyColor };
|
||||
|
@ -11,8 +11,7 @@
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "pnpm unbuild",
|
||||
"stub": "pnpm build --stub"
|
||||
"build": "pnpm unbuild"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
@ -39,7 +39,7 @@ type AnyFunction<T extends any[] = any[], R = void> =
|
||||
/**
|
||||
* T | null 包装
|
||||
*/
|
||||
type Nullable<T> = T | null;
|
||||
type Nullable<T> = null | T;
|
||||
|
||||
/**
|
||||
* T | Not null 包装
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { RouteRecordRaw, Router } from 'vue-router';
|
||||
import type { Router, RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import type { Component } from 'vue';
|
||||
|
||||
|
@ -103,11 +103,6 @@ interface VbenLayoutProps {
|
||||
* @default sidebar-nav
|
||||
*/
|
||||
layout?: LayoutType;
|
||||
/**
|
||||
* 侧边菜单折叠宽度
|
||||
* @default 48
|
||||
*/
|
||||
sideCollapseWidth?: number;
|
||||
/**
|
||||
* 侧边菜单折叠状态
|
||||
* @default false
|
||||
@ -153,6 +148,11 @@ interface VbenLayoutProps {
|
||||
* @default 210
|
||||
*/
|
||||
sidebarWidth?: number;
|
||||
/**
|
||||
* 侧边菜单折叠宽度
|
||||
* @default 48
|
||||
*/
|
||||
sideCollapseWidth?: number;
|
||||
/**
|
||||
* tab是否可见
|
||||
* @default true
|
||||
|
@ -38,7 +38,6 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
headerVisible: true,
|
||||
isMobile: false,
|
||||
layout: 'sidebar-nav',
|
||||
sideCollapseWidth: 60,
|
||||
sidebarCollapseShowTitle: false,
|
||||
sidebarExtraCollapsedWidth: 60,
|
||||
sidebarHidden: false,
|
||||
@ -46,6 +45,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
sidebarSemiDark: true,
|
||||
sidebarTheme: 'dark',
|
||||
sidebarWidth: 180,
|
||||
sideCollapseWidth: 60,
|
||||
tabbarEnable: true,
|
||||
tabbarHeight: 36,
|
||||
zIndex: 200,
|
||||
@ -130,7 +130,7 @@ const headerWrapperHeight = computed(() => {
|
||||
});
|
||||
|
||||
const getSideCollapseWidth = computed(() => {
|
||||
const { sideCollapseWidth, sidebarCollapseShowTitle, sidebarMixedWidth } =
|
||||
const { sidebarCollapseShowTitle, sidebarMixedWidth, sideCollapseWidth } =
|
||||
props;
|
||||
|
||||
return sidebarCollapseShowTitle || isSidebarMixedNav.value
|
||||
|
@ -7,13 +7,13 @@ import type {
|
||||
} from '../interface';
|
||||
|
||||
import {
|
||||
type VNodeArrayChildren,
|
||||
computed,
|
||||
nextTick,
|
||||
reactive,
|
||||
ref,
|
||||
toRef,
|
||||
useSlots,
|
||||
type VNodeArrayChildren,
|
||||
watch,
|
||||
watchEffect,
|
||||
} from 'vue';
|
||||
@ -22,7 +22,7 @@ import { useNamespace } from '@vben-core/hooks';
|
||||
import { Ellipsis } from '@vben-core/icons';
|
||||
import { isHttpUrl } from '@vben-core/toolkit';
|
||||
|
||||
import { UseResizeObserverReturn, useResizeObserver } from '@vueuse/core';
|
||||
import { useResizeObserver, UseResizeObserverReturn } from '@vueuse/core';
|
||||
|
||||
import {
|
||||
createMenuContext,
|
||||
@ -121,8 +121,8 @@ createMenuContext(
|
||||
handleMenuItemClick,
|
||||
handleSubMenuClick,
|
||||
isMenuPopup,
|
||||
openMenu,
|
||||
openedMenus,
|
||||
openMenu,
|
||||
props,
|
||||
removeMenuItem,
|
||||
removeSubMenu,
|
||||
@ -176,7 +176,7 @@ function calcSliceIndex() {
|
||||
}
|
||||
|
||||
function debounce(fn: () => void, wait = 33.34) {
|
||||
let timer: ReturnType<typeof setTimeout> | null;
|
||||
let timer: null | ReturnType<typeof setTimeout>;
|
||||
return () => {
|
||||
timer && clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
|
@ -44,7 +44,7 @@ const mouseInChild = ref(false);
|
||||
|
||||
const items = ref<MenuProvider['items']>({});
|
||||
const subMenus = ref<MenuProvider['subMenus']>({});
|
||||
const timer = ref<ReturnType<typeof setTimeout> | null>(null);
|
||||
const timer = ref<null | ReturnType<typeof setTimeout>>(null);
|
||||
|
||||
createSubMenuContext({
|
||||
addSubMenu,
|
||||
|
@ -105,8 +105,8 @@ interface MenuProvider {
|
||||
isMenuPopup: boolean;
|
||||
items: Record<string, MenuItemRegistered>;
|
||||
|
||||
openMenu: (path: string, parentLinks: string[]) => void;
|
||||
openedMenus: string[];
|
||||
openMenu: (path: string, parentLinks: string[]) => void;
|
||||
props: MenuProps;
|
||||
removeMenuItem: (item: MenuItemRegistered) => void;
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
"@vben-core/typings": "workspace:*",
|
||||
"@vueuse/core": "^10.11.0",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"lucide-vue-next": "^0.411.0",
|
||||
"lucide-vue-next": "^0.414.0",
|
||||
"radix-vue": "^1.9.2",
|
||||
"vue": "^3.4.33"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed, useSlots } from 'vue';
|
||||
import { computed, type HTMLAttributes, useSlots } from 'vue';
|
||||
|
||||
import { VbenTooltip } from '@vben-core/shadcn-ui/components/tooltip';
|
||||
import { ButtonVariants } from '@vben-core/shadcn-ui/components/ui/button';
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { HoverCardRootEmits, HoverCardRootProps } from 'radix-vue';
|
||||
|
||||
import { HTMLAttributes, computed } from 'vue';
|
||||
import { computed, HTMLAttributes } from 'vue';
|
||||
|
||||
import {
|
||||
HoverCard,
|
||||
|
@ -5,7 +5,7 @@ import type {
|
||||
PopoverRootProps,
|
||||
} from 'radix-vue';
|
||||
|
||||
import { HTMLAttributes, computed } from 'vue';
|
||||
import { computed, HTMLAttributes } from 'vue';
|
||||
|
||||
import {
|
||||
PopoverContent,
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { buttonVariants } from '@vben-core/shadcn-ui/components/ui/button';
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { buttonVariants } from '@vben-core/shadcn-ui/components/ui/button';
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -5,7 +5,7 @@ import { cn } from '@vben-core/toolkit';
|
||||
|
||||
import { AvatarRoot } from 'radix-vue';
|
||||
|
||||
import { type AvatarVariants, avatarVariant } from './avatar';
|
||||
import { avatarVariant, type AvatarVariants } from './avatar';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { type VariantProps, cva } from 'class-variance-authority';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
|
||||
export const avatarVariant = cva(
|
||||
'inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden',
|
||||
|
@ -1,4 +1,4 @@
|
||||
export * from './avatar';
|
||||
export { default as Avatar } from './Avatar.vue';
|
||||
export { default as AvatarFallback } from './AvatarFallback.vue';
|
||||
export { default as AvatarImage } from './AvatarImage.vue';
|
||||
export * from './avatar';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { type VariantProps, cva } from 'class-variance-authority';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
|
||||
export const badgeVariants = cva(
|
||||
'inline-flex items-center rounded-md border border-border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
||||
|
@ -1,3 +1,3 @@
|
||||
export { default as Badge } from './Badge.vue';
|
||||
|
||||
export * from './badge';
|
||||
|
||||
export { default as Badge } from './Badge.vue';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { type VariantProps, cva } from 'class-variance-authority';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
|
||||
export const buttonVariants = cva(
|
||||
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
||||
|
@ -1,3 +1,3 @@
|
||||
export { default as Button } from './Button.vue';
|
||||
|
||||
export * from './button';
|
||||
|
||||
export { default as Button } from './Button.vue';
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
|
||||
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
import { computed, type HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/toolkit';
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user