chore: format code
parent
d584d4cf4e
commit
7bcd7746ca
|
@ -1,6 +1,7 @@
|
|||
import type { UserApiType } from '@/apis/types';
|
||||
import type { UserInfo } from '@vben/types';
|
||||
|
||||
import type { UserApiType } from '@/apis/types';
|
||||
|
||||
import { request } from '@/forward';
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
<script lang="ts" setup>
|
||||
import 'dayjs/locale/zh-cn';
|
||||
|
||||
import { preferences, usePreferences } from '@vben-core/preferences';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { GlobalProvider } from '@vben/common-ui';
|
||||
import { preferences, usePreferences } from '@vben-core/preferences';
|
||||
|
||||
import { ConfigProvider, theme } from 'ant-design-vue';
|
||||
import zhCN from 'ant-design-vue/es/locale/zh_CN';
|
||||
import dayjs from 'dayjs';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import 'dayjs/locale/zh-cn';
|
||||
|
||||
defineOptions({ name: 'App' });
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import '@vben/styles';
|
||||
import { createApp } from 'vue';
|
||||
|
||||
import { setupI18n } from '@vben/locales';
|
||||
import '@vben/styles';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
|
||||
import { setupStore } from '@/store';
|
||||
import { setupI18n } from '@vben/locales';
|
||||
import { createApp } from 'vue';
|
||||
|
||||
import App from './app.vue';
|
||||
import { router } from './router';
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<script lang="ts" setup>
|
||||
import type { NotificationItem } from '@vben/common-ui';
|
||||
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
import { useAccessStore } from '@vben-core/stores';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { Notification, UserDropdown } from '@vben/common-ui';
|
||||
import { IcRoundCreditScore, MdiDriveDocument, MdiGithub } from '@vben/icons';
|
||||
import { BasicLayout } from '@vben/layouts';
|
||||
import { $t } from '@vben/locales';
|
||||
import { openWindow } from '@vben/utils';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
import { useAccessStore } from '@vben-core/stores';
|
||||
|
||||
// https://avatar.vercel.sh/vercel.svg?text=Vaa
|
||||
// https://avatar.vercel.sh/1
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import { generatorMenus, generatorRoutes } from '@vben-core/helpers';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
import { useAccessStore } from '@vben-core/stores';
|
||||
import type { RouteLocationNormalized, Router } from 'vue-router';
|
||||
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
import { $t } from '@vben/locales';
|
||||
import { startProgress, stopProgress } from '@vben/utils';
|
||||
import { generatorMenus, generatorRoutes } from '@vben-core/helpers';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
import { useAccessStore } from '@vben-core/stores';
|
||||
|
||||
import { useTitle } from '@vueuse/core';
|
||||
|
||||
import { dynamicRoutes } from '@/router/routes';
|
||||
|
@ -81,15 +82,16 @@ function setupAccessGuard(router: Router) {
|
|||
// 生成路由表
|
||||
// 当前登录用户拥有的角色标识列表
|
||||
const userRoles = accessStore.getUserRoles;
|
||||
const routes = await generatorRoutes(dynamicRoutes, userRoles);
|
||||
const accessibleRoutes = await generatorRoutes(dynamicRoutes, userRoles);
|
||||
// 动态添加到router实例内
|
||||
routes.forEach((route) => router.addRoute(route));
|
||||
accessibleRoutes.forEach((route) => router.addRoute(route));
|
||||
|
||||
const menus = await generatorMenus(routes, router);
|
||||
// 生成菜单
|
||||
const menus = await generatorMenus(accessibleRoutes, router);
|
||||
|
||||
// 保存菜单信息和路由信息
|
||||
accessStore.setAccessMenus(menus);
|
||||
accessStore.setAccessRoutes(routes);
|
||||
accessStore.setAccessRoutes(accessibleRoutes);
|
||||
const redirectPath = (from.query.redirect ?? to.path) as string;
|
||||
|
||||
return {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import type { RouteRecordName, RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { traverseTreeValues } from '@vben/utils';
|
||||
import { createRouter, createWebHashHistory } from 'vue-router';
|
||||
|
||||
import { traverseTreeValues } from '@vben/utils';
|
||||
|
||||
import { createRouterGuard } from './guard';
|
||||
import { routes } from './routes';
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { AuthPageLayoutType } from '@/layouts';
|
||||
import { Fallback } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
|
||||
import { AuthPageLayoutType } from '@/layouts';
|
||||
|
||||
import Login from '@/views/_essential/authentication/login.vue';
|
||||
|
||||
/** 基本路由,这些路由是必须存在的 */
|
||||
const essentialRoutes: RouteRecordRaw[] = [
|
||||
const essentialsRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
component: AuthPageLayoutType,
|
||||
meta: {
|
||||
|
@ -69,7 +69,7 @@ const essentialRoutes: RouteRecordRaw[] = [
|
|||
},
|
||||
// 错误页
|
||||
{
|
||||
component: Fallback,
|
||||
component: () => import('@/views/_essential/fallback/not-found.vue'),
|
||||
meta: {
|
||||
hideInBreadcrumb: true,
|
||||
hideInMenu: true,
|
||||
|
@ -82,4 +82,4 @@ const essentialRoutes: RouteRecordRaw[] = [
|
|||
},
|
||||
];
|
||||
|
||||
export { essentialRoutes };
|
||||
export { essentialsRoutes };
|
|
@ -1,8 +1,9 @@
|
|||
import { preferences } from '@vben-core/preferences';
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { BasicLayout, IFrameView } from '@/layouts';
|
||||
import { VBEN_GITHUB_URL } from '@vben/constants';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
|
||||
import { BasicLayout, IFrameView } from '@/layouts';
|
||||
import { $t } from '@vben/locales/helper';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { mergeRouteModules } from '@vben-core/helpers';
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { essentialRoutes } from './_essential';
|
||||
import { mergeRouteModules } from '@vben-core/helpers';
|
||||
|
||||
import { essentialsRoutes } from './_essentials';
|
||||
|
||||
const dynamicRouteFiles = import.meta.glob('./dynamic/**/*.ts', {
|
||||
eager: true,
|
||||
|
@ -23,6 +24,6 @@ const staticRoutes: RouteRecordRaw[] = mergeRouteModules(staticRouteFiles);
|
|||
const externalRoutes: RouteRecordRaw[] = mergeRouteModules(externalRouteFiles);
|
||||
|
||||
/** 路由列表,由基本路由+静态路由组成 */
|
||||
const routes: RouteRecordRaw[] = [...essentialRoutes, ...staticRoutes];
|
||||
const routes: RouteRecordRaw[] = [...essentialsRoutes, ...staticRoutes];
|
||||
|
||||
export { dynamicRoutes, externalRoutes, routes };
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import type { InitStoreOptions } from '@vben-core/stores';
|
||||
|
||||
import { initStore } from '@vben-core/stores';
|
||||
|
||||
import type { App } from 'vue';
|
||||
|
||||
import { initStore } from '@vben-core/stores';
|
||||
|
||||
/**
|
||||
* @zh_CN 初始化pinia
|
||||
* @param app vue app 实例
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import type { LoginCodeParams } from '@vben/common-ui';
|
||||
|
||||
import { AuthenticationCodeLogin } from '@vben/common-ui';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { AuthenticationCodeLogin } from '@vben/common-ui';
|
||||
|
||||
defineOptions({ name: 'CodeLogin' });
|
||||
|
||||
const loading = ref(false);
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { AuthenticationForgetPassword } from '@vben/common-ui';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { AuthenticationForgetPassword } from '@vben/common-ui';
|
||||
|
||||
defineOptions({ name: 'ForgetPassword' });
|
||||
|
||||
const loading = ref(false);
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
<script lang="ts" setup>
|
||||
import type { LoginAndRegisterParams } from '@vben/common-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { AuthenticationLogin } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { useRequest } from '@vben-core/request';
|
||||
import { useAccessStore } from '@vben-core/stores';
|
||||
|
||||
import { getUserInfo, userLogin } from '@/apis';
|
||||
import { AuthenticationLogin } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { notification } from 'ant-design-vue';
|
||||
import { computed } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
defineOptions({ name: 'Login' });
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import type { LoginAndRegisterParams } from '@vben/common-ui';
|
||||
|
||||
import { AuthenticationRegister } from '@vben/common-ui';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { AuthenticationRegister } from '@vben/common-ui';
|
||||
|
||||
defineOptions({ name: 'Register' });
|
||||
|
||||
const loading = ref(false);
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { Fallback } from '@vben/common-ui';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Fallback />
|
||||
</template>
|
|
@ -41,9 +41,9 @@
|
|||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-i": "^2.29.1",
|
||||
"eslint-plugin-jsdoc": "^48.2.7",
|
||||
"eslint-plugin-jsdoc": "^48.2.8",
|
||||
"eslint-plugin-jsonc": "^2.16.0",
|
||||
"eslint-plugin-n": "^17.7.0",
|
||||
"eslint-plugin-n": "^17.8.0",
|
||||
"eslint-plugin-no-only-tests": "^3.1.0",
|
||||
"eslint-plugin-perfectionist": "^2.10.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
|
|
|
@ -22,31 +22,38 @@ export async function perfectionist(): Promise<Linter.FlatConfig[]> {
|
|||
{
|
||||
'custom-groups': {
|
||||
type: {
|
||||
vben: 'vue',
|
||||
vue: ['vue', 'vue-*', '@vue*'],
|
||||
vben: 'vben',
|
||||
vue: 'vue',
|
||||
},
|
||||
value: {
|
||||
vben: 'vben',
|
||||
vue: ['@vben-*', '@vben-core/*'],
|
||||
vben: ['@vben*', '@vben/*', '@vben-core/*'],
|
||||
vue: ['vue', 'vue-*', '@vue*'],
|
||||
},
|
||||
},
|
||||
groups: [
|
||||
'side-effect',
|
||||
'type',
|
||||
'vue',
|
||||
['external-type', 'builtin-type', 'type'],
|
||||
['parent-type', 'sibling-type', 'index-type'],
|
||||
['internal-type'],
|
||||
'builtin',
|
||||
'vue',
|
||||
'vben',
|
||||
'external',
|
||||
'internal-type',
|
||||
'internal',
|
||||
['parent', 'sibling', 'index'],
|
||||
'side-effect',
|
||||
'side-effect-style',
|
||||
'style',
|
||||
'object',
|
||||
'unknown',
|
||||
'type',
|
||||
['parent-type', 'sibling-type', 'index-type'],
|
||||
],
|
||||
'internal-pattern': ['@/layouts/**', '@/router/**', '@/views/**'],
|
||||
'internal-pattern': [
|
||||
'@/layouts/**',
|
||||
'@/apis/**',
|
||||
'@/forward/**',
|
||||
'@/router/**',
|
||||
'@/views/**',
|
||||
'#/**',
|
||||
],
|
||||
'newlines-between': 'always',
|
||||
order: 'asc',
|
||||
type: 'natural',
|
||||
|
|
|
@ -54,12 +54,12 @@
|
|||
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
|
||||
"@tailwindcss/typography": "^0.5.13",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"cssnano": "^7.0.1",
|
||||
"cssnano": "^7.0.2",
|
||||
"postcss": "^8.4.38",
|
||||
"postcss-antd-fixes": "^0.2.0",
|
||||
"postcss-import": "^16.1.0",
|
||||
"postcss-preset-env": "^9.5.14",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"tailwindcss": "^3.4.4",
|
||||
"tailwindcss-animate": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -2,10 +2,11 @@ import type { Config } from 'tailwindcss';
|
|||
|
||||
import path from 'node:path';
|
||||
|
||||
import { fs, getPackagesSync } from '@vben/node-utils';
|
||||
|
||||
import { addDynamicIconSelectors } from '@iconify/tailwind';
|
||||
import formsPlugin from '@tailwindcss/forms';
|
||||
import typographyPlugin from '@tailwindcss/typography';
|
||||
import { fs, getPackagesSync } from '@vben/node-utils';
|
||||
import animate from 'tailwindcss-animate';
|
||||
|
||||
import { enterAnimationPlugin } from './plugins/entry';
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import type { UserConfig } from 'vite';
|
||||
|
||||
import type { DefineApplicationOptions } from '../typing';
|
||||
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
import { defineConfig, loadEnv, mergeConfig } from 'vite';
|
||||
|
@ -7,8 +9,6 @@ import { defineConfig, loadEnv, mergeConfig } from 'vite';
|
|||
import { getApplicationConditionPlugins } from '../plugins';
|
||||
import { getCommonConfig } from './common';
|
||||
|
||||
import type { DefineApplicationOptions } from '../typing';
|
||||
|
||||
function defineApplicationConfig(options: DefineApplicationOptions = {}) {
|
||||
return defineConfig(async ({ command, mode }) => {
|
||||
const { application = {}, vite = {} } = options;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import type { DefineConfig } from '../typing';
|
||||
|
||||
import { existsSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
|
||||
import { defineApplicationConfig } from './application';
|
||||
import { defineLibraryConfig } from './library';
|
||||
|
||||
import type { DefineConfig } from '../typing';
|
||||
|
||||
export * from './application';
|
||||
export * from './library';
|
||||
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
import type { UserConfig } from 'vite';
|
||||
|
||||
import type { DefineLibraryOptions } from '../typing';
|
||||
|
||||
import { readPackageJSON } from '@vben/node-utils';
|
||||
|
||||
import { defineConfig, mergeConfig } from 'vite';
|
||||
|
||||
import { getLibraryConditionPlugins } from '../plugins';
|
||||
import { getCommonConfig } from './common';
|
||||
|
||||
import type { DefineLibraryOptions } from '../typing';
|
||||
|
||||
function defineLibraryConfig(options: DefineLibraryOptions = {}) {
|
||||
return defineConfig(async ({ command, mode }) => {
|
||||
const root = process.cwd();
|
||||
|
|
|
@ -3,6 +3,7 @@ import {
|
|||
generatorContentHash,
|
||||
readPackageJSON,
|
||||
} from '@vben/node-utils';
|
||||
|
||||
import { type PluginOption } from 'vite';
|
||||
|
||||
import { getEnvConfig } from '../utils/env';
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
import type { PluginOption } from 'vite';
|
||||
|
||||
import type {
|
||||
ApplicationPluginOptions,
|
||||
CommonPluginOptions,
|
||||
ConditionPlugin,
|
||||
LibraryPluginOptions,
|
||||
} from '../typing';
|
||||
|
||||
import { join } from 'node:path';
|
||||
|
||||
import viteVueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||
import { getPackage } from '@vben/node-utils';
|
||||
|
||||
import viteVueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||
import viteVue from '@vitejs/plugin-vue';
|
||||
import viteVueJsx from '@vitejs/plugin-vue-jsx';
|
||||
import { visualizer as viteVisualizerPlugin } from 'rollup-plugin-visualizer';
|
||||
|
@ -19,13 +27,6 @@ import { viteExtraAppConfigPlugin } from './extra-app-config';
|
|||
import { viteImportMapPlugin } from './importmap';
|
||||
import { viteInjectAppLoadingPlugin } from './inject-app-loading';
|
||||
|
||||
import type {
|
||||
ApplicationPluginOptions,
|
||||
CommonPluginOptions,
|
||||
ConditionPlugin,
|
||||
LibraryPluginOptions,
|
||||
} from '../typing';
|
||||
|
||||
/**
|
||||
* 获取条件成立的 vite 插件
|
||||
* @param conditionPlugins
|
||||
|
|
|
@ -2,6 +2,7 @@ import { join } from 'node:path';
|
|||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import { fs } from '@vben/node-utils';
|
||||
|
||||
import { type PluginOption } from 'vite';
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
.loading.hidden {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transition: all 1s ease-out;
|
||||
transition: all 0.6s ease-out;
|
||||
}
|
||||
|
||||
.loading .dots {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
.loading.hidden {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transition: all 1s ease-out;
|
||||
transition: all 0.6s ease-out;
|
||||
}
|
||||
|
||||
.dark .loading {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { join } from 'node:path';
|
||||
|
||||
import { fs } from '@vben/node-utils';
|
||||
|
||||
import dotenv from 'dotenv';
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
"@changesets/cli": "^2.27.5",
|
||||
"@ls-lint/ls-lint": "^2.2.3",
|
||||
"@types/jsdom": "^21.1.7",
|
||||
"@types/node": "^20.14.1",
|
||||
"@types/node": "^20.14.2",
|
||||
"@vben/commitlint-config": "workspace:*",
|
||||
"@vben/eslint-config": "workspace:*",
|
||||
"@vben/lint-staged-config": "workspace:*",
|
||||
|
@ -76,7 +76,7 @@
|
|||
"node": ">=18.7.0",
|
||||
"pnpm": ">=8.5.0"
|
||||
},
|
||||
"packageManager": "pnpm@9.1.4",
|
||||
"packageManager": "pnpm@9.2.0",
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"@ctrl/tinycolor": "4.1.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { ExRouteRecordRaw, MenuRecordRaw } from '@vben-core/typings';
|
||||
import type { RouteRecordRaw, Router } from 'vue-router';
|
||||
|
||||
import { mapTree } from '@vben-core/toolkit';
|
||||
import type { RouteRecordRaw, Router } from 'vue-router';
|
||||
|
||||
/**
|
||||
* 根据 routes 生成菜单列表
|
||||
|
|
|
@ -1,16 +1,30 @@
|
|||
import { filterTree } from '@vben-core/toolkit';
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { filterTree, mapTree } from '@vben-core/toolkit';
|
||||
/**
|
||||
* 动态生成路由
|
||||
*/
|
||||
async function generatorRoutes(
|
||||
routes: RouteRecordRaw[],
|
||||
roles: string[],
|
||||
forbiddenPage?: RouteRecordRaw['component'],
|
||||
): Promise<RouteRecordRaw[]> {
|
||||
// 根据角色标识过滤路由表,判断当前用户是否拥有指定权限
|
||||
return filterTree(routes, (route) => {
|
||||
const finalRoutes = filterTree(routes, (route) => {
|
||||
return hasVisible(route) && hasAuthority(route, roles);
|
||||
});
|
||||
|
||||
if (!forbiddenPage) {
|
||||
return finalRoutes;
|
||||
}
|
||||
|
||||
// 如果有禁止访问的页面,将禁止访问的页面替换为403页面
|
||||
return mapTree(finalRoutes, (route) => {
|
||||
if (menuHasVisibleWithForbidden(route)) {
|
||||
route.component = forbiddenPage;
|
||||
}
|
||||
return route;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,9 +38,10 @@ function hasAuthority(route: RouteRecordRaw, access: string[]) {
|
|||
if (!authority) {
|
||||
return true;
|
||||
}
|
||||
return access.some((value) => {
|
||||
return authority.includes(value);
|
||||
});
|
||||
return (
|
||||
access.some((value) => authority.includes(value)) ||
|
||||
menuHasVisibleWithForbidden(route)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,4 +52,12 @@ function hasVisible(route?: RouteRecordRaw) {
|
|||
return !route?.meta?.hideInMenu;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断路由是否在菜单中显示,但是访问会被重定向到403
|
||||
* @param route
|
||||
*/
|
||||
function menuHasVisibleWithForbidden(route: RouteRecordRaw) {
|
||||
return !!route.meta?.menuVisibleWithForbidden;
|
||||
}
|
||||
|
||||
export { generatorRoutes, hasAuthority, hasVisible };
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import type { RouteModuleType } from './merge-route-modules';
|
||||
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { mergeRouteModules } from './merge-route-modules';
|
||||
|
||||
import type { RouteModuleType } from './merge-route-modules';
|
||||
|
||||
describe('mergeRouteModules', () => {
|
||||
it('should merge route modules correctly', () => {
|
||||
const routeModules: Record<string, RouteModuleType> = {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import type { Flatten } from '@vben-core/typings';
|
||||
|
||||
import { preferencesManager } from './preferences';
|
||||
|
||||
import type { Preferences } from './types';
|
||||
|
||||
import { preferencesManager } from './preferences';
|
||||
|
||||
// 偏好设置(带有层级关系)
|
||||
const preferences: Preferences = preferencesManager.getPreferences();
|
||||
|
||||
|
|
|
@ -4,6 +4,10 @@ import type {
|
|||
FlattenObjectKeys,
|
||||
} from '@vben-core/typings';
|
||||
|
||||
import type { Preferences } from './types';
|
||||
|
||||
import { markRaw, reactive, watch } from 'vue';
|
||||
|
||||
import { StorageManager } from '@vben-core/cache';
|
||||
import { flattenObject, nestedObject } from '@vben-core/helpers';
|
||||
import { convertToHslCssVar, merge } from '@vben-core/toolkit';
|
||||
|
@ -14,12 +18,9 @@ import {
|
|||
useCssVar,
|
||||
useDebounceFn,
|
||||
} from '@vueuse/core';
|
||||
import { markRaw, reactive, watch } from 'vue';
|
||||
|
||||
import { defaultPreferences } from './config';
|
||||
|
||||
import type { Preferences } from './types';
|
||||
|
||||
const STORAGE_KEY = 'preferences';
|
||||
const STORAGE_KEY_LOCALE = `${STORAGE_KEY}-locale`;
|
||||
const STORAGE_KEY_THEME = `${STORAGE_KEY}-theme`;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { diff } from '@vben-core/toolkit';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { diff } from '@vben-core/toolkit';
|
||||
|
||||
import { isDarkTheme, preferencesManager } from './preferences';
|
||||
|
||||
function usePreferences() {
|
||||
|
|
|
@ -6,6 +6,8 @@ import type {
|
|||
InternalAxiosRequestConfig,
|
||||
} from 'axios';
|
||||
|
||||
import type { MakeAuthorizationFn, RequestClientOptions } from './types';
|
||||
|
||||
import { merge } from '@vben-core/toolkit';
|
||||
|
||||
import axios from 'axios';
|
||||
|
@ -15,8 +17,6 @@ import { FileDownloader } from './modules/downloader';
|
|||
import { InterceptorManager } from './modules/interceptor';
|
||||
import { FileUploader } from './modules/uploader';
|
||||
|
||||
import type { MakeAuthorizationFn, RequestClientOptions } from './types';
|
||||
|
||||
class RequestClient {
|
||||
private instance: AxiosInstance;
|
||||
private makeAuthorization: MakeAuthorizationFn | undefined;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { MenuRecordRaw } from '@vben-core/typings';
|
||||
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { acceptHMRUpdate, defineStore } from 'pinia';
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
|
||||
import { createPinia, setActivePinia } from 'pinia';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
|
||||
import { useTabsStore } from './tabs';
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import { startProgress, stopProgress } from '@vben-core/toolkit';
|
||||
import { TabItem } from '@vben-core/typings';
|
||||
import type { RouteRecordNormalized, Router } from 'vue-router';
|
||||
|
||||
import { acceptHMRUpdate, defineStore } from 'pinia';
|
||||
import { toRaw } from 'vue';
|
||||
|
||||
import { startProgress, stopProgress } from '@vben-core/toolkit';
|
||||
import { TabItem } from '@vben-core/typings';
|
||||
|
||||
import { acceptHMRUpdate, defineStore } from 'pinia';
|
||||
|
||||
/**
|
||||
* @zh_CN 克隆路由,防止路由被修改
|
||||
* @param route
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Icon } from '@iconify/vue';
|
||||
import { defineComponent, h } from 'vue';
|
||||
|
||||
import { Icon } from '@iconify/vue';
|
||||
|
||||
function createIcon(name: string) {
|
||||
return defineComponent({
|
||||
setup(props, { attrs }) {
|
||||
|
|
|
@ -72,6 +72,10 @@ interface RouteMeta {
|
|||
* 路由是否已经加载过
|
||||
*/
|
||||
loaded?: boolean;
|
||||
/**
|
||||
* 菜单可以看到,但是访问会被重定向到403
|
||||
*/
|
||||
menuVisibleWithForbidden?: boolean;
|
||||
/**
|
||||
* 用于路由->菜单排序
|
||||
*/
|
||||
|
@ -80,6 +84,7 @@ interface RouteMeta {
|
|||
* 外链-跳转路径
|
||||
*/
|
||||
target?: string;
|
||||
|
||||
/**
|
||||
* 标题名称
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'vue-router';
|
||||
|
||||
import type { RouteMeta as IRouteMeta } from '@vben-core/typings';
|
||||
|
||||
import 'vue-router';
|
||||
|
||||
declare module 'vue-router' {
|
||||
interface RouteMeta extends IRouteMeta {}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import type { ContentCompactType } from '@vben-core/typings';
|
||||
|
||||
import type { CSSProperties } from 'vue';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import { useNamespace } from '@vben-core/toolkit';
|
||||
|
||||
import type { CSSProperties } from 'vue';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useNamespace } from '@vben-core/toolkit';
|
||||
|
||||
interface Props {
|
||||
/**
|
||||
* 背景颜色
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import type { CSSProperties } from 'vue';
|
||||
import { computed, useSlots } from 'vue';
|
||||
|
||||
import { IcRoundMenu } from '@vben-core/iconify';
|
||||
import { VbenIconButton } from '@vben-core/shadcn-ui';
|
||||
|
||||
import type { CSSProperties } from 'vue';
|
||||
|
||||
import { computed, useSlots } from 'vue';
|
||||
|
||||
interface Props {
|
||||
/**
|
||||
* 背景颜色
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import { ScrollArea } from '@vben-core/shadcn-ui';
|
||||
import { useNamespace } from '@vben-core/toolkit';
|
||||
|
||||
import type { CSSProperties } from 'vue';
|
||||
|
||||
// import { onClickOutside } from '@vueuse/core';
|
||||
import { computed, ref, shallowRef, useSlots, watchEffect } from 'vue';
|
||||
|
||||
import { ScrollArea } from '@vben-core/shadcn-ui';
|
||||
import { useNamespace } from '@vben-core/toolkit';
|
||||
|
||||
import { SideCollapseButton, SidePinButton } from './widgets';
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import type { CSSProperties } from 'vue';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import type { CSSProperties } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
import { useMouse, useScroll, useThrottleFn } from '@vueuse/core';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
import {
|
||||
LayoutContent,
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<script lang="ts" setup>
|
||||
import { VbenIcon, VbenMenuBadge, VbenTooltip } from '@vben-core/shadcn-ui';
|
||||
import { useNamespace } from '@vben-core/toolkit';
|
||||
import type { MenuItemProps, MenuItemRegistered } from '../interface';
|
||||
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, useSlots } from 'vue';
|
||||
|
||||
import { useMenu, useMenuContext, useSubMenuContext } from '../hooks';
|
||||
import { VbenIcon, VbenMenuBadge, VbenTooltip } from '@vben-core/shadcn-ui';
|
||||
import { useNamespace } from '@vben-core/toolkit';
|
||||
|
||||
import type { MenuItemProps, MenuItemRegistered } from '../interface';
|
||||
import { useMenu, useMenuContext, useSubMenuContext } from '../hooks';
|
||||
|
||||
interface Props extends MenuItemProps {}
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<script lang="ts" setup>
|
||||
import { IcRoundMoreHoriz } from '@vben-core/iconify';
|
||||
import { isHttpUrl, useNamespace } from '@vben-core/toolkit';
|
||||
import type {
|
||||
MenuItemClicked,
|
||||
MenuItemRegistered,
|
||||
MenuProps,
|
||||
MenuProvider,
|
||||
} from '../interface';
|
||||
|
||||
import { UseResizeObserverReturn, useResizeObserver } from '@vueuse/core';
|
||||
import {
|
||||
type VNodeArrayChildren,
|
||||
computed,
|
||||
|
@ -15,6 +18,11 @@ import {
|
|||
watchEffect,
|
||||
} from 'vue';
|
||||
|
||||
import { IcRoundMoreHoriz } from '@vben-core/iconify';
|
||||
import { isHttpUrl, useNamespace } from '@vben-core/toolkit';
|
||||
|
||||
import { UseResizeObserverReturn, useResizeObserver } from '@vueuse/core';
|
||||
|
||||
import {
|
||||
createMenuContext,
|
||||
createSubMenuContext,
|
||||
|
@ -23,13 +31,6 @@ import {
|
|||
import { flattedChildren } from '../utils';
|
||||
import SubMenu from './sub-menu.vue';
|
||||
|
||||
import type {
|
||||
MenuItemClicked,
|
||||
MenuItemRegistered,
|
||||
MenuProps,
|
||||
MenuProvider,
|
||||
} from '../interface';
|
||||
|
||||
interface Props extends MenuProps {}
|
||||
|
||||
defineOptions({ name: 'Menu' });
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import type { MenuRecordRaw } from '@vben-core/typings';
|
||||
|
||||
import type { NormalMenuProps } from './normal-menu';
|
||||
|
||||
import { VbenIcon } from '@vben-core/shadcn-ui';
|
||||
import { useNamespace } from '@vben-core/toolkit';
|
||||
|
||||
import type { NormalMenuProps } from './normal-menu';
|
||||
|
||||
interface Props extends NormalMenuProps {}
|
||||
|
||||
defineOptions({
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<script lang="ts" setup>
|
||||
import type { MenuItemProps } from '../interface';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import {
|
||||
IcRoundChevronRight,
|
||||
IcRoundKeyboardArrowDown,
|
||||
|
@ -6,12 +10,8 @@ import {
|
|||
import { VbenIcon } from '@vben-core/shadcn-ui';
|
||||
import { useNamespace } from '@vben-core/toolkit';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useMenuContext } from '../hooks';
|
||||
|
||||
import type { MenuItemProps } from '../interface';
|
||||
|
||||
interface Props extends MenuItemProps {
|
||||
isMenuMore: boolean;
|
||||
isTopLevelMenuSubmenu: boolean;
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
<script lang="ts" setup>
|
||||
import type { HoverCardContentProps } from '@vben-core/shadcn-ui';
|
||||
|
||||
import { VbenHoverCard } from '@vben-core/shadcn-ui';
|
||||
import { useNamespace } from '@vben-core/toolkit';
|
||||
import type {
|
||||
MenuItemRegistered,
|
||||
MenuProvider,
|
||||
SubMenuProps,
|
||||
} from '../interface';
|
||||
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue';
|
||||
|
||||
import { VbenHoverCard } from '@vben-core/shadcn-ui';
|
||||
import { useNamespace } from '@vben-core/toolkit';
|
||||
|
||||
import {
|
||||
createSubMenuContext,
|
||||
useMenu,
|
||||
|
@ -16,12 +22,6 @@ import {
|
|||
import CollapseTransition from './collapse-transition.vue';
|
||||
import SubMenuContent from './sub-menu-content.vue';
|
||||
|
||||
import type {
|
||||
MenuItemRegistered,
|
||||
MenuProvider,
|
||||
SubMenuProps,
|
||||
} from '../interface';
|
||||
|
||||
interface Props extends SubMenuProps {
|
||||
isSubMenuMore?: boolean;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import type { MenuProvider, SubMenuProvider } from '../interface';
|
||||
|
||||
import { getCurrentInstance, inject, provide } from 'vue';
|
||||
|
||||
import { findComponentUpward } from '../utils';
|
||||
|
||||
import type { MenuProvider, SubMenuProvider } from '../interface';
|
||||
|
||||
const menuContextKey = Symbol('menuContext');
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import type { MenuRecordRaw } from '@vben-core/typings';
|
||||
|
||||
import { VbenMenuBadge } from '@vben-core/shadcn-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { VbenMenuBadge } from '@vben-core/shadcn-ui';
|
||||
|
||||
import { MenuItem, SubMenu as SubMenuComp } from './components';
|
||||
// eslint-disable-next-line import/no-self-import
|
||||
import SubMenu from './sub-menu.vue';
|
||||
|
|
|
@ -4,7 +4,6 @@ import type {
|
|||
VNodeChild,
|
||||
VNodeNormalizedChildren,
|
||||
} from 'vue';
|
||||
|
||||
import { isVNode } from 'vue';
|
||||
|
||||
type VNodeChildAtom = Exclude<VNodeChild, Array<any>>;
|
||||
|
|
|
@ -6,9 +6,9 @@ import type {
|
|||
} from 'radix-vue';
|
||||
|
||||
import type { HTMLAttributes } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { Avatar, AvatarFallback, AvatarImage } from '#/components/ui/avatar';
|
||||
import { computed } from 'vue';
|
||||
|
||||
interface Props extends AvatarRootProps, AvatarFallbackProps, AvatarImageProps {
|
||||
alt?: string;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<script lang="ts" setup>
|
||||
import { IcRoundArrowUpward } from '@vben-core/iconify';
|
||||
import type { BacktopProps } from './backtop';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { IcRoundArrowUpward } from '@vben-core/iconify';
|
||||
|
||||
import { VbenButton } from '../button';
|
||||
import { useBackTop } from './use-backtop';
|
||||
|
||||
import type { BacktopProps } from './backtop';
|
||||
|
||||
interface Props extends BacktopProps {}
|
||||
|
||||
defineOptions({ name: 'BackTop' });
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { useEventListener, useThrottleFn } from '@vueuse/core';
|
||||
import type { BacktopProps } from './backtop';
|
||||
|
||||
import { onMounted, ref, shallowRef } from 'vue';
|
||||
|
||||
import type { BacktopProps } from './backtop';
|
||||
import { useEventListener, useThrottleFn } from '@vueuse/core';
|
||||
|
||||
export const useBackTop = (props: BacktopProps) => {
|
||||
const el = shallowRef<HTMLElement>();
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { VbenIcon } from '../icon';
|
||||
|
||||
import type { IBreadcrumb } from './interface';
|
||||
|
||||
import { VbenIcon } from '../icon';
|
||||
|
||||
interface Props {
|
||||
breadcrumbs: IBreadcrumb[];
|
||||
showIcon?: boolean;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<script lang="ts" setup>
|
||||
import type { IBreadcrumb } from './interface';
|
||||
|
||||
import { IcRoundKeyboardArrowDown } from '@vben-core/iconify';
|
||||
|
||||
import {
|
||||
|
@ -18,8 +20,6 @@ import {
|
|||
|
||||
import { VbenIcon } from '../';
|
||||
|
||||
import type { IBreadcrumb } from './interface';
|
||||
|
||||
interface Props {
|
||||
breadcrumbs: IBreadcrumb[];
|
||||
showIcon?: boolean;
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { MdiLoading } from '@vben-core/iconify';
|
||||
|
||||
import type { HTMLAttributes } from 'vue';
|
||||
import { Primitive, type PrimitiveProps } from 'radix-vue';
|
||||
|
||||
import { type ButtonVariants, buttonVariants } from '#/components/ui/button';
|
||||
import { cn } from '#/lib/utils';
|
||||
import { Primitive, type PrimitiveProps } from 'radix-vue';
|
||||
import { computed } from 'vue';
|
||||
|
||||
interface Props extends PrimitiveProps {
|
||||
class?: HTMLAttributes['class'];
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed, useSlots } from 'vue';
|
||||
|
||||
import { type PrimitiveProps } from 'radix-vue';
|
||||
|
||||
import { VbenTooltip } from '#/components/tooltip';
|
||||
import { ButtonVariants } from '#/components/ui/button';
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type PrimitiveProps } from 'radix-vue';
|
||||
import { type HTMLAttributes, computed, useSlots } from 'vue';
|
||||
|
||||
import VbenButton from './button.vue';
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
|
||||
|
||||
import { Checkbox } from '#/components/ui/checkbox';
|
||||
import { useForwardPropsEmits } from 'radix-vue';
|
||||
|
||||
import { Checkbox } from '#/components/ui/checkbox';
|
||||
|
||||
const props = defineProps<
|
||||
{
|
||||
name: string;
|
||||
|
|
|
@ -5,7 +5,12 @@ import type {
|
|||
ContextMenuRootProps,
|
||||
} from 'radix-vue';
|
||||
|
||||
import type { IContextMenuItem } from './interface';
|
||||
|
||||
import type { HTMLAttributes } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useForwardPropsEmits } from 'radix-vue';
|
||||
|
||||
import {
|
||||
ContextMenu,
|
||||
|
@ -15,10 +20,6 @@ import {
|
|||
ContextMenuShortcut,
|
||||
ContextMenuTrigger,
|
||||
} from '#/components/ui/context-menu';
|
||||
import { useForwardPropsEmits } from 'radix-vue';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import type { IContextMenuItem } from './interface';
|
||||
|
||||
const props = defineProps<
|
||||
{
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<script lang="ts" setup>
|
||||
import type {
|
||||
DropdownMenuProps,
|
||||
VbenDropdownMenuItem as IDropdownMenuItem,
|
||||
} from './interface';
|
||||
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
|
@ -8,11 +13,6 @@ import {
|
|||
DropdownMenuTrigger,
|
||||
} from '#/components/ui/dropdown-menu';
|
||||
|
||||
import type {
|
||||
DropdownMenuProps,
|
||||
VbenDropdownMenuItem as IDropdownMenuItem,
|
||||
} from './interface';
|
||||
|
||||
interface Props extends DropdownMenuProps {}
|
||||
|
||||
defineOptions({ name: 'DropdownMenu' });
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<script lang="ts" setup>
|
||||
import type { DropdownMenuProps } from './interface';
|
||||
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
|
@ -7,8 +9,6 @@ import {
|
|||
DropdownMenuTrigger,
|
||||
} from '#/components/ui/dropdown-menu';
|
||||
|
||||
import type { DropdownMenuProps } from './interface';
|
||||
|
||||
interface Props extends DropdownMenuProps {}
|
||||
|
||||
defineOptions({ name: 'DropdownRadioMenu' });
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
<script setup lang="ts">
|
||||
import type { HoverCardRootEmits, HoverCardRootProps } from 'radix-vue';
|
||||
|
||||
import { HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { HoverCardContentProps, useForwardPropsEmits } from 'radix-vue';
|
||||
|
||||
import {
|
||||
HoverCard,
|
||||
HoverCardContent,
|
||||
HoverCardTrigger,
|
||||
} from '#/components/ui/hover-card';
|
||||
import { HoverCardContentProps, useForwardPropsEmits } from 'radix-vue';
|
||||
import { HTMLAttributes, computed } from 'vue';
|
||||
|
||||
const props = defineProps<
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import { type Component, computed } from 'vue';
|
||||
|
||||
import { Icon, IconDefault } from '@vben-core/iconify';
|
||||
import { isHttpUrl, isObject, isString } from '@vben-core/toolkit';
|
||||
|
||||
import { type Component, computed } from 'vue';
|
||||
|
||||
const props = defineProps<{
|
||||
// 没有是否显示默认图标
|
||||
fallback?: boolean;
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useSlots } from 'vue';
|
||||
|
||||
import {
|
||||
IcOutlineVisibility,
|
||||
IcOutlineVisibilityOff,
|
||||
} from '@vben-core/iconify';
|
||||
|
||||
import { type InputProps, VbenInput } from '#/components/input/index';
|
||||
import { useForwardProps } from 'radix-vue';
|
||||
import { ref, useSlots } from 'vue';
|
||||
|
||||
import { type InputProps, VbenInput } from '#/components/input/index';
|
||||
|
||||
import PasswordStrength from './password-strength.vue';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
import type { InputProps } from './interface';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
defineOptions({
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import type { MenuRecordBadgeRaw } from '@vben-core/typings';
|
||||
|
||||
import { isValidColor } from '@vben-core/toolkit';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { isValidColor } from '@vben-core/toolkit';
|
||||
|
||||
import BadgeDot from './menu-badge-dot.vue';
|
||||
|
||||
interface Props extends MenuRecordBadgeRaw {
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import type { PinInputProps } from './interface';
|
||||
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
import { VbenButton } from '#/components/button';
|
||||
import {
|
||||
PinInput,
|
||||
PinInputGroup,
|
||||
PinInputInput,
|
||||
} from '#/components/ui/pin-input';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
import type { PinInputProps } from './interface';
|
||||
|
||||
defineOptions({
|
||||
inheritAttrs: false,
|
||||
|
|
|
@ -5,13 +5,15 @@ import type {
|
|||
PopoverRootProps,
|
||||
} from 'radix-vue';
|
||||
|
||||
import { HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { useForwardPropsEmits } from 'radix-vue';
|
||||
|
||||
import {
|
||||
PopoverContent,
|
||||
Popover as PopoverRoot,
|
||||
PopoverTrigger,
|
||||
} from '#/components/ui/popover';
|
||||
import { useForwardPropsEmits } from 'radix-vue';
|
||||
import { HTMLAttributes, computed } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
import { Tabs, TabsContent, TabsList } from '#/components/ui/tabs';
|
||||
import { TabsTrigger } from 'radix-vue';
|
||||
import type { SegmentedItem } from './interface';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import TabsIndicator from './tabs-indicator.vue';
|
||||
import { TabsTrigger } from 'radix-vue';
|
||||
|
||||
import type { SegmentedItem } from './interface';
|
||||
import { Tabs, TabsContent, TabsList } from '#/components/ui/tabs';
|
||||
|
||||
import TabsIndicator from './tabs-indicator.vue';
|
||||
|
||||
interface Props {
|
||||
defaultValue?: string;
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import {
|
||||
TabsIndicator,
|
||||
type TabsIndicatorProps,
|
||||
useForwardProps,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & TabsIndicatorProps
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, useSlots } from 'vue';
|
||||
|
||||
import { Cross2Icon } from '@radix-icons/vue';
|
||||
|
||||
import { VbenButton, VbenIconButton } from '#/components/button';
|
||||
import { ScrollArea } from '#/components/ui/scroll-area';
|
||||
import {
|
||||
|
@ -11,8 +15,6 @@ import {
|
|||
SheetTitle,
|
||||
SheetTrigger,
|
||||
} from '#/components/ui/sheet';
|
||||
import { Cross2Icon } from '@radix-icons/vue';
|
||||
import { computed, useSlots } from 'vue';
|
||||
|
||||
interface Props {
|
||||
cancelText?: string;
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import { TooltipContentProps } from 'radix-vue';
|
||||
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipProvider,
|
||||
TooltipTrigger,
|
||||
} from '#/components/ui/tooltip';
|
||||
import { TooltipContentProps } from 'radix-vue';
|
||||
|
||||
interface Props {
|
||||
delayDuration?: number;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { AlertDialogAction, type AlertDialogActionProps } from 'radix-vue';
|
||||
|
||||
import { buttonVariants } from '#/components/ui/button';
|
||||
import { cn } from '#/lib/utils';
|
||||
import { AlertDialogAction, type AlertDialogActionProps } from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & AlertDialogActionProps
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { AlertDialogCancel, type AlertDialogCancelProps } from 'radix-vue';
|
||||
|
||||
import { buttonVariants } from '#/components/ui/button';
|
||||
import { cn } from '#/lib/utils';
|
||||
import { AlertDialogCancel, type AlertDialogCancelProps } from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & AlertDialogCancelProps
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import {
|
||||
AlertDialogContent,
|
||||
type AlertDialogContentEmits,
|
||||
|
@ -8,7 +9,8 @@ import {
|
|||
AlertDialogPortal,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & AlertDialogContentProps
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import {
|
||||
AlertDialogDescription,
|
||||
type AlertDialogDescriptionProps,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & AlertDialogDescriptionProps
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { AlertDialogTitle, type AlertDialogTitleProps } from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { AlertDialogTitle, type AlertDialogTitleProps } from 'radix-vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & AlertDialogTitleProps
|
||||
>();
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
import { AvatarRoot } from 'radix-vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
import { type AvatarVariants, avatarVariant } from './avatar';
|
||||
|
||||
const props = withDefaults(
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import type { HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
import { DotsHorizontalIcon } from '@radix-icons/vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class'];
|
||||
}>();
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import type { HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
import { Primitive, type PrimitiveProps } from 'radix-vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{ class?: HTMLAttributes['class'] } & PrimitiveProps>(),
|
||||
{
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import type { HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
import { ChevronRightIcon } from '@radix-icons/vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class'];
|
||||
}>();
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
import { Primitive, type PrimitiveProps } from 'radix-vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
import { type ButtonVariants, buttonVariants } from './button';
|
||||
|
||||
interface Props extends PrimitiveProps {
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
<script setup lang="ts">
|
||||
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { CheckIcon } from '@radix-icons/vue';
|
||||
import {
|
||||
CheckboxIndicator,
|
||||
CheckboxRoot,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & CheckboxRootProps
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { CheckIcon } from '@radix-icons/vue';
|
||||
import {
|
||||
ContextMenuCheckboxItem,
|
||||
|
@ -8,7 +9,8 @@ import {
|
|||
ContextMenuItemIndicator,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & ContextMenuCheckboxItemProps
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import {
|
||||
ContextMenuContent,
|
||||
type ContextMenuContentEmits,
|
||||
|
@ -7,7 +8,8 @@ import {
|
|||
ContextMenuPortal,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & ContextMenuContentProps
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import {
|
||||
ContextMenuItem,
|
||||
type ContextMenuItemEmits,
|
||||
type ContextMenuItemProps,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class']; inset?: boolean } & ContextMenuItemProps
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { ContextMenuLabel, type ContextMenuLabelProps } from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { ContextMenuLabel, type ContextMenuLabelProps } from 'radix-vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class']; inset?: boolean } & ContextMenuLabelProps
|
||||
>();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { DotFilledIcon } from '@radix-icons/vue';
|
||||
import {
|
||||
ContextMenuItemIndicator,
|
||||
|
@ -8,7 +9,8 @@ import {
|
|||
type ContextMenuRadioItemProps,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & ContextMenuRadioItemProps
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import {
|
||||
ContextMenuSeparator,
|
||||
type ContextMenuSeparatorProps,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & ContextMenuSeparatorProps
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import {
|
||||
ContextMenuSubContent,
|
||||
type DropdownMenuSubContentEmits,
|
||||
type DropdownMenuSubContentProps,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & DropdownMenuSubContentProps
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { ChevronRightIcon } from '@radix-icons/vue';
|
||||
import {
|
||||
ContextMenuSubTrigger,
|
||||
type ContextMenuSubTriggerProps,
|
||||
useForwardProps,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { cn } from '#/lib/utils';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { Cross2Icon } from '@radix-icons/vue';
|
||||
import {
|
||||
DialogClose,
|
||||
|
@ -10,7 +11,8 @@ import {
|
|||
DialogPortal,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
import { type HTMLAttributes, computed } from 'vue';
|
||||
|
||||
import { cn } from '#/lib/utils';
|
||||
|
||||
const props = defineProps<
|
||||
{ class?: HTMLAttributes['class'] } & DialogContentProps
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue