chore: format code

This commit is contained in:
vben
2024-06-08 19:49:06 +08:00
parent d584d4cf4e
commit 7bcd7746ca
187 changed files with 775 additions and 587 deletions

View File

@@ -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 生成菜单列表

View File

@@ -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 };

View File

@@ -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> = {

View File

@@ -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();

View File

@@ -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`;

View File

@@ -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() {

View File

@@ -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;

View File

@@ -1,5 +1,4 @@
import type { MenuRecordRaw } from '@vben-core/typings';
import type { RouteRecordRaw } from 'vue-router';
import { acceptHMRUpdate, defineStore } from 'pinia';

View File

@@ -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';

View File

@@ -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

View File

@@ -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 }) {

View File

@@ -72,6 +72,10 @@ interface RouteMeta {
* 路由是否已经加载过
*/
loaded?: boolean;
/**
* 菜单可以看到但是访问会被重定向到403
*/
menuVisibleWithForbidden?: boolean;
/**
* 用于路由->菜单排序
*/
@@ -80,6 +84,7 @@ interface RouteMeta {
* 外链-跳转路径
*/
target?: string;
/**
* 标题名称
*/

View File

@@ -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 {}
}

View File

@@ -2,7 +2,6 @@
import type { ContentCompactType } from '@vben-core/typings';
import type { CSSProperties } from 'vue';
import { computed } from 'vue';
interface Props {

View File

@@ -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 {
/**
* 背景颜色

View File

@@ -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 {
/**
* 背景颜色

View File

@@ -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 {

View File

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

View File

@@ -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,

View File

@@ -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 {}

View File

@@ -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' });

View File

@@ -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({

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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');
/**

View File

@@ -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';

View File

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

View File

@@ -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;

View File

@@ -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' });

View File

@@ -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>();

View File

@@ -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;

View File

@@ -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;

View File

@@ -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'];

View File

@@ -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';

View File

@@ -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;

View File

@@ -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<
{

View File

@@ -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' });

View File

@@ -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' });

View File

@@ -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<
{

View File

@@ -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;

View File

@@ -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';

View File

@@ -1,8 +1,8 @@
<script setup lang="ts">
import { computed } from 'vue';
import type { InputProps } from './interface';
import { computed } from 'vue';
defineOptions({
inheritAttrs: false,
});

View File

@@ -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 {

View File

@@ -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,

View File

@@ -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<

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
>();

View File

@@ -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(

View File

@@ -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'];
}>();

View File

@@ -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>(),
{

View File

@@ -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'];
}>();

View File

@@ -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 {

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
>();

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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<
{

View File

@@ -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

View File

@@ -1,11 +1,13 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
DialogDescription,
type DialogDescriptionProps,
useForwardProps,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogDescriptionProps

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
DialogClose,
DialogContent,
@@ -9,7 +10,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

View File

@@ -1,8 +1,10 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { DialogTitle, type DialogTitleProps, useForwardProps } from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { DialogTitle, type DialogTitleProps, useForwardProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogTitleProps
>();

View File

@@ -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 {
DropdownMenuCheckboxItem,
@@ -8,7 +9,8 @@ import {
DropdownMenuItemIndicator,
useForwardPropsEmits,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuCheckboxItemProps

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuContent,
type DropdownMenuContentEmits,
@@ -7,7 +8,8 @@ import {
DropdownMenuPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & DropdownMenuContentProps>(),

View File

@@ -1,11 +1,13 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuItem,
type DropdownMenuItemProps,
useForwardProps,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class']; inset?: boolean } & DropdownMenuItemProps

View File

@@ -1,11 +1,13 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuLabel,
type DropdownMenuLabelProps,
useForwardProps,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class']; inset?: boolean } & DropdownMenuLabelProps

View File

@@ -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 {
DropdownMenuItemIndicator,
@@ -8,7 +9,8 @@ import {
type DropdownMenuRadioItemProps,
useForwardPropsEmits,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuRadioItemProps

View File

@@ -1,10 +1,12 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuSeparator,
type DropdownMenuSeparatorProps,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{

View File

@@ -1,12 +1,14 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuSubContent,
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

View File

@@ -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 {
DropdownMenuSubTrigger,
type DropdownMenuSubTriggerProps,
useForwardProps,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuSubTriggerProps

View File

@@ -1,12 +1,14 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
HoverCardContent,
type HoverCardContentProps,
HoverCardPortal,
useForwardProps,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & HoverCardContentProps>(),

View File

@@ -1,12 +1,14 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
PinInputRoot,
type PinInputRootEmits,
type PinInputRootProps,
useForwardPropsEmits,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & PinInputRootProps

View File

@@ -1,8 +1,10 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { Primitive, type PrimitiveProps, useForwardProps } from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { Primitive, type PrimitiveProps, useForwardProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & PrimitiveProps
>();

View File

@@ -1,11 +1,13 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
PinInputInput,
type PinInputInputProps,
useForwardProps,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & PinInputInputProps

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
PopoverContent,
type PopoverContentEmits,
@@ -7,7 +8,8 @@ import {
PopoverPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
defineOptions({
inheritAttrs: false,

View File

@@ -1,12 +1,14 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
ScrollAreaCorner,
ScrollAreaRoot,
type ScrollAreaRootProps,
ScrollAreaViewport,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
import ScrollBar from './ScrollBar.vue';

View File

@@ -1,11 +1,13 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
ScrollAreaScrollbar,
type ScrollAreaScrollbarProps,
ScrollAreaThumb,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & ScrollAreaScrollbarProps>(),

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
SelectContent,
type SelectContentEmits,
@@ -8,7 +9,8 @@ import {
SelectViewport,
useForwardPropsEmits,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
import { SelectScrollDownButton, SelectScrollUpButton } from '.';

View File

@@ -1,8 +1,10 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { SelectGroup, type SelectGroupProps } from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { SelectGroup, type SelectGroupProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectGroupProps
>();

View File

@@ -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 {
SelectItem,
@@ -8,7 +9,8 @@ import {
SelectItemText,
useForwardProps,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectItemProps

View File

@@ -1,9 +1,10 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
import { SelectLabel, type SelectLabelProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectLabelProps
>();

View File

@@ -1,12 +1,14 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import { ChevronDownIcon } from '@radix-icons/vue';
import {
SelectScrollDownButton,
type SelectScrollDownButtonProps,
useForwardProps,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectScrollDownButtonProps

View File

@@ -1,12 +1,14 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import { ChevronUpIcon } from '@radix-icons/vue';
import {
SelectScrollUpButton,
type SelectScrollUpButtonProps,
useForwardProps,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectScrollUpButtonProps

View File

@@ -1,8 +1,10 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { SelectSeparator, type SelectSeparatorProps } from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { SelectSeparator, type SelectSeparatorProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectSeparatorProps
>();

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import { CaretSortIcon } from '@radix-icons/vue';
import {
SelectIcon,
@@ -7,7 +8,8 @@ import {
type SelectTriggerProps,
useForwardProps,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectTriggerProps

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
DialogContent,
type DialogContentEmits,
@@ -8,7 +9,8 @@ import {
DialogPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
import { type SheetVariants, sheetVariants } from './sheet';

View File

@@ -1,8 +1,10 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { DialogDescription, type DialogDescriptionProps } from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { DialogDescription, type DialogDescriptionProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogDescriptionProps
>();

View File

@@ -1,8 +1,10 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { DialogTitle, type DialogTitleProps } from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { DialogTitle, type DialogTitleProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogTitleProps
>();

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { type HTMLAttributes, computed } from 'vue';
import {
SwitchRoot,
type SwitchRootEmits,
@@ -7,7 +8,8 @@ import {
SwitchThumb,
useForwardPropsEmits,
} from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SwitchRootProps

View File

@@ -1,8 +1,10 @@
<script setup lang="ts">
import { cn } from '#/lib/utils';
import { TabsContent, type TabsContentProps } from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { TabsContent, type TabsContentProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & TabsContentProps
>();

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