Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin
This commit is contained in:
commit
330a8a1d70
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben/web-ele",
|
"name": "@vben/web-ele",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"homepage": "https://vben.pro",
|
"homepage": "https://vben.pro",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben/web-naive",
|
"name": "@vben/web-naive",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"homepage": "https://vben.pro",
|
"homepage": "https://vben.pro",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben/docs",
|
"name": "@vben/docs",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "vitepress build",
|
"build": "vitepress build",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben/commitlint-config",
|
"name": "@vben/commitlint-config",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben/stylelint-config",
|
"name": "@vben/stylelint-config",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben/node-utils",
|
"name": "@vben/node-utils",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben/tailwind-config",
|
"name": "@vben/tailwind-config",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben/tsconfig",
|
"name": "@vben/tsconfig",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben/vite-config",
|
"name": "@vben/vite-config",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vben-admin-pro",
|
"name": "vben-admin-pro",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"monorepo",
|
"monorepo",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben-core/design",
|
"name": "@vben-core/design",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben-core/icons",
|
"name": "@vben-core/icons",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben-core/shared",
|
"name": "@vben-core/shared",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben-core/typings",
|
"name": "@vben-core/typings",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben-core/composables",
|
"name": "@vben-core/composables",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben-core/preferences",
|
"name": "@vben-core/preferences",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben-core/layout-ui",
|
"name": "@vben-core/layout-ui",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben-core/menu-ui",
|
"name": "@vben-core/menu-ui",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
export { default as Menu } from './menu.vue';
|
export { default as Menu } from './menu.vue';
|
||||||
|
export { default as MenuBadge } from './menu-badge.vue';
|
||||||
export { default as MenuItem } from './menu-item.vue';
|
export { default as MenuItem } from './menu-item.vue';
|
||||||
export { default as SubMenu } from './sub-menu.vue';
|
export { default as SubMenu } from './sub-menu.vue';
|
||||||
|
@ -4,8 +4,9 @@ import type { MenuItemProps, MenuItemRegistered } from '../types';
|
|||||||
import { computed, onBeforeUnmount, onMounted, reactive, useSlots } from 'vue';
|
import { computed, onBeforeUnmount, onMounted, reactive, useSlots } from 'vue';
|
||||||
|
|
||||||
import { useNamespace } from '@vben-core/composables';
|
import { useNamespace } from '@vben-core/composables';
|
||||||
import { VbenIcon, VbenMenuBadge, VbenTooltip } from '@vben-core/shadcn-ui';
|
import { VbenIcon, VbenTooltip } from '@vben-core/shadcn-ui';
|
||||||
|
|
||||||
|
import { MenuBadge } from '../components';
|
||||||
import { useMenu, useMenuContext, useSubMenuContext } from '../hooks';
|
import { useMenu, useMenuContext, useSubMenuContext } from '../hooks';
|
||||||
|
|
||||||
interface Props extends MenuItemProps {}
|
interface Props extends MenuItemProps {}
|
||||||
@ -108,7 +109,7 @@ onBeforeUnmount(() => {
|
|||||||
<slot name="title"></slot>
|
<slot name="title"></slot>
|
||||||
</VbenTooltip>
|
</VbenTooltip>
|
||||||
<div v-show="!showTooltip" :class="[e('content')]">
|
<div v-show="!showTooltip" :class="[e('content')]">
|
||||||
<VbenMenuBadge
|
<MenuBadge
|
||||||
v-if="rootMenu.props.mode !== 'horizontal'"
|
v-if="rootMenu.props.mode !== 'horizontal'"
|
||||||
class="right-2"
|
class="right-2"
|
||||||
v-bind="props"
|
v-bind="props"
|
||||||
|
@ -3,9 +3,7 @@ import type { MenuRecordRaw } from '@vben-core/typings';
|
|||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { VbenMenuBadge } from '@vben-core/shadcn-ui';
|
import { MenuBadge, MenuItem, SubMenu as SubMenuComp } from './components';
|
||||||
|
|
||||||
import { MenuItem, SubMenu as SubMenuComp } from './components';
|
|
||||||
// eslint-disable-next-line import/no-self-import
|
// eslint-disable-next-line import/no-self-import
|
||||||
import SubMenu from './sub-menu.vue';
|
import SubMenu from './sub-menu.vue';
|
||||||
|
|
||||||
@ -54,7 +52,7 @@ const hasChildren = computed(() => {
|
|||||||
:path="menu.path"
|
:path="menu.path"
|
||||||
>
|
>
|
||||||
<template #content>
|
<template #content>
|
||||||
<VbenMenuBadge
|
<MenuBadge
|
||||||
:badge="menu.badge"
|
:badge="menu.badge"
|
||||||
:badge-type="menu.badgeType"
|
:badge-type="menu.badgeType"
|
||||||
:badge-variants="menu.badgeVariants"
|
:badge-variants="menu.badgeVariants"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben-core/shadcn-ui",
|
"name": "@vben-core/shadcn-ui",
|
||||||
"version": "5.3.2",
|
"version": "5.4.0",
|
||||||
"#main": "./dist/index.mjs",
|
"#main": "./dist/index.mjs",
|
||||||
"#module": "./dist/index.mjs",
|
"#module": "./dist/index.mjs",
|
||||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||||
|
@ -7,7 +7,7 @@ import type {
|
|||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar';
|
import { Avatar, AvatarFallback, AvatarImage } from '../../ui';
|
||||||
|
|
||||||
interface Props extends AvatarRootProps, AvatarFallbackProps, AvatarImageProps {
|
interface Props extends AvatarRootProps, AvatarFallbackProps, AvatarImageProps {
|
||||||
alt?: string;
|
alt?: string;
|
||||||
|
@ -3,7 +3,6 @@ import type { BreadcrumbProps } from './types';
|
|||||||
|
|
||||||
import { ChevronDown } from '@vben-core/icons';
|
import { ChevronDown } from '@vben-core/icons';
|
||||||
|
|
||||||
import { VbenIcon } from '../icon';
|
|
||||||
import {
|
import {
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
BreadcrumbItem,
|
BreadcrumbItem,
|
||||||
@ -11,13 +10,12 @@ import {
|
|||||||
BreadcrumbList,
|
BreadcrumbList,
|
||||||
BreadcrumbPage,
|
BreadcrumbPage,
|
||||||
BreadcrumbSeparator,
|
BreadcrumbSeparator,
|
||||||
} from '../ui/breadcrumb';
|
|
||||||
import {
|
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
DropdownMenuContent,
|
DropdownMenuContent,
|
||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '../ui/dropdown-menu';
|
} from '../../ui';
|
||||||
|
import { VbenIcon } from '../icon';
|
||||||
|
|
||||||
interface Props extends BreadcrumbProps {}
|
interface Props extends BreadcrumbProps {}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { AsTag } from 'radix-vue';
|
import type { AsTag } from 'radix-vue';
|
||||||
|
|
||||||
import type { ButtonVariants, ButtonVariantSize } from '../ui/button';
|
import type { ButtonVariants, ButtonVariantSize } from '../../ui';
|
||||||
|
|
||||||
import type { Component } from 'vue';
|
import type { Component } from 'vue';
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import { cn } from '@vben-core/shared/utils';
|
|||||||
|
|
||||||
import { Primitive } from 'radix-vue';
|
import { Primitive } from 'radix-vue';
|
||||||
|
|
||||||
import { buttonVariants } from '../ui/button';
|
import { buttonVariants } from '../../ui';
|
||||||
|
|
||||||
interface Props extends VbenButtonProps {}
|
interface Props extends VbenButtonProps {}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ButtonVariants } from '../ui/button';
|
import type { ButtonVariants } from '../../ui';
|
||||||
import type { VbenButtonProps } from './button';
|
import type { VbenButtonProps } from './button';
|
||||||
|
|
||||||
import { computed, useSlots } from 'vue';
|
import { computed, useSlots } from 'vue';
|
||||||
|
@ -5,7 +5,7 @@ import { useId } from 'vue';
|
|||||||
|
|
||||||
import { useForwardPropsEmits } from 'radix-vue';
|
import { useForwardPropsEmits } from 'radix-vue';
|
||||||
|
|
||||||
import { Checkbox } from '../ui/checkbox';
|
import { Checkbox } from '../../ui/checkbox';
|
||||||
|
|
||||||
const props = defineProps<CheckboxRootProps>();
|
const props = defineProps<CheckboxRootProps>();
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import {
|
|||||||
ContextMenuSeparator,
|
ContextMenuSeparator,
|
||||||
ContextMenuShortcut,
|
ContextMenuShortcut,
|
||||||
ContextMenuTrigger,
|
ContextMenuTrigger,
|
||||||
} from '../ui/context-menu';
|
} from '../../ui/context-menu';
|
||||||
|
|
||||||
const props = defineProps<
|
const props = defineProps<
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
DropdownMenuSeparator,
|
DropdownMenuSeparator,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '../ui/dropdown-menu';
|
} from '../../ui';
|
||||||
|
|
||||||
interface Props extends DropdownMenuProps {}
|
interface Props extends DropdownMenuProps {}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
DropdownMenuGroup,
|
DropdownMenuGroup,
|
||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '../ui/dropdown-menu';
|
} from '../../ui';
|
||||||
|
|
||||||
interface Props extends DropdownMenuProps {}
|
interface Props extends DropdownMenuProps {}
|
||||||
|
|
||||||
|
@ -9,11 +9,7 @@ import { computed } from 'vue';
|
|||||||
|
|
||||||
import { useForwardPropsEmits } from 'radix-vue';
|
import { useForwardPropsEmits } from 'radix-vue';
|
||||||
|
|
||||||
import {
|
import { HoverCard, HoverCardContent, HoverCardTrigger } from '../../ui';
|
||||||
HoverCard,
|
|
||||||
HoverCardContent,
|
|
||||||
HoverCardTrigger,
|
|
||||||
} from '../ui/hover-card';
|
|
||||||
|
|
||||||
interface Props extends HoverCardRootProps {
|
interface Props extends HoverCardRootProps {
|
||||||
class?: any;
|
class?: any;
|
||||||
|
@ -12,10 +12,7 @@ export * from './hover-card';
|
|||||||
export * from './icon';
|
export * from './icon';
|
||||||
export * from './input-captcha';
|
export * from './input-captcha';
|
||||||
export * from './input-password';
|
export * from './input-password';
|
||||||
export * from './link';
|
|
||||||
export * from './logo';
|
export * from './logo';
|
||||||
export * from './menu-badge';
|
|
||||||
export * from './pagination';
|
|
||||||
export * from './pin-input';
|
export * from './pin-input';
|
||||||
export * from './popover';
|
export * from './popover';
|
||||||
export * from './render-content';
|
export * from './render-content';
|
||||||
@ -24,34 +21,4 @@ export * from './segmented';
|
|||||||
export * from './select';
|
export * from './select';
|
||||||
export * from './spine-text';
|
export * from './spine-text';
|
||||||
export * from './spinner';
|
export * from './spinner';
|
||||||
export * from './swap';
|
|
||||||
export * from './tooltip';
|
export * from './tooltip';
|
||||||
export * from './ui/accordion';
|
|
||||||
export * from './ui/avatar';
|
|
||||||
export * from './ui/badge';
|
|
||||||
export * from './ui/breadcrumb';
|
|
||||||
export * from './ui/button';
|
|
||||||
export * from './ui/card';
|
|
||||||
export * from './ui/checkbox';
|
|
||||||
export * from './ui/dialog';
|
|
||||||
export * from './ui/dropdown-menu';
|
|
||||||
export * from './ui/form';
|
|
||||||
export * from './ui/hover-card';
|
|
||||||
export * from './ui/input';
|
|
||||||
export * from './ui/label';
|
|
||||||
export * from './ui/number-field';
|
|
||||||
export * from './ui/pagination';
|
|
||||||
export * from './ui/pin-input';
|
|
||||||
export * from './ui/popover';
|
|
||||||
export * from './ui/radio-group';
|
|
||||||
export * from './ui/scroll-area';
|
|
||||||
export * from './ui/select';
|
|
||||||
export * from './ui/separator';
|
|
||||||
export * from './ui/sheet';
|
|
||||||
export * from './ui/switch';
|
|
||||||
export * from './ui/tabs';
|
|
||||||
export * from './ui/textarea';
|
|
||||||
export * from './ui/toast';
|
|
||||||
export * from './ui/toggle';
|
|
||||||
export * from './ui/toggle-group';
|
|
||||||
export * from './ui/tooltip';
|
|
||||||
|
@ -4,7 +4,7 @@ import { ref, useSlots } from 'vue';
|
|||||||
import { Eye, EyeOff } from '@vben-core/icons';
|
import { Eye, EyeOff } from '@vben-core/icons';
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { Input } from '../ui/input';
|
import { Input } from '../../ui';
|
||||||
import PasswordStrength from './password-strength.vue';
|
import PasswordStrength from './password-strength.vue';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export { default as VbenLink } from './link.vue';
|
|
@ -1,28 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
|
||||||
|
|
||||||
import { Primitive, type PrimitiveProps } from 'radix-vue';
|
|
||||||
|
|
||||||
interface Props extends PrimitiveProps {
|
|
||||||
class?: any;
|
|
||||||
href: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
|
||||||
as: 'a',
|
|
||||||
class: '',
|
|
||||||
href: '',
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<Primitive
|
|
||||||
:as="as"
|
|
||||||
:as-child="asChild"
|
|
||||||
:class="cn('text-primary hover:text-primary-hover', props.class)"
|
|
||||||
:href="href"
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
<slot></slot>
|
|
||||||
</Primitive>
|
|
||||||
</template>
|
|
@ -1 +0,0 @@
|
|||||||
export { default as VbenMenuBadge } from './menu-badge.vue';
|
|
@ -1,2 +0,0 @@
|
|||||||
export type { PaginationProps as VbenPaginationProps } from './pagination';
|
|
||||||
export { default as VbenPagination } from './pagination.vue';
|
|
@ -1,41 +0,0 @@
|
|||||||
export interface PaginationProps {
|
|
||||||
/**
|
|
||||||
* 是否禁用
|
|
||||||
*/
|
|
||||||
disabled?: boolean;
|
|
||||||
/**
|
|
||||||
* 每页记录数选项
|
|
||||||
*/
|
|
||||||
pageSizeOptions?: number[];
|
|
||||||
/**
|
|
||||||
* 当 时true,始终显示第一页、最后一页和省略号
|
|
||||||
*/
|
|
||||||
showEdges?: boolean;
|
|
||||||
/**
|
|
||||||
* 显示当前页选择下拉框
|
|
||||||
*/
|
|
||||||
showRowsPerPage?: boolean;
|
|
||||||
/**
|
|
||||||
* 显示总条数文本
|
|
||||||
*/
|
|
||||||
showTotalText?: boolean;
|
|
||||||
/**
|
|
||||||
* 当前页面周围应显示的兄弟页面数量
|
|
||||||
*/
|
|
||||||
siblingCount?: number;
|
|
||||||
/**
|
|
||||||
* 组件尺寸
|
|
||||||
*/
|
|
||||||
size?: 'default' | 'large' | 'small';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 总条数
|
|
||||||
*/
|
|
||||||
total?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const SIZE_CLASS_MAP = {
|
|
||||||
default: 'size-8',
|
|
||||||
large: 'size-9',
|
|
||||||
small: 'size-7',
|
|
||||||
};
|
|
@ -1,121 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { computed, watch } from 'vue';
|
|
||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
|
||||||
|
|
||||||
import { Button } from '../ui/button';
|
|
||||||
import {
|
|
||||||
Pagination,
|
|
||||||
PaginationEllipsis,
|
|
||||||
PaginationFirst,
|
|
||||||
PaginationLast,
|
|
||||||
PaginationList,
|
|
||||||
PaginationListItem,
|
|
||||||
PaginationNext,
|
|
||||||
PaginationPrev,
|
|
||||||
} from '../ui/pagination';
|
|
||||||
import {
|
|
||||||
Select,
|
|
||||||
SelectContent,
|
|
||||||
SelectItem,
|
|
||||||
SelectTrigger,
|
|
||||||
SelectValue,
|
|
||||||
} from '../ui/select';
|
|
||||||
import { type PaginationProps, SIZE_CLASS_MAP } from './pagination';
|
|
||||||
|
|
||||||
interface Props extends PaginationProps {}
|
|
||||||
|
|
||||||
const {
|
|
||||||
disabled = false,
|
|
||||||
pageSizeOptions = [10, 20, 30, 50, 100, 200],
|
|
||||||
showEdges = true,
|
|
||||||
showRowsPerPage = true,
|
|
||||||
showTotalText = true,
|
|
||||||
siblingCount = 1,
|
|
||||||
size = 'small',
|
|
||||||
total = 500,
|
|
||||||
} = defineProps<Props>();
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
|
||||||
pageChange: [currentPage: number, pageSize: number];
|
|
||||||
}>();
|
|
||||||
const currentPage = defineModel<number>('currentPage', { default: 1 });
|
|
||||||
const itemPerPage = defineModel<number>('itemPerPage', { default: 20 });
|
|
||||||
|
|
||||||
const itemSize = computed(() => {
|
|
||||||
return SIZE_CLASS_MAP[size];
|
|
||||||
});
|
|
||||||
|
|
||||||
const options = computed(() => {
|
|
||||||
return pageSizeOptions.map((item) => ({
|
|
||||||
label: `${item} 条/页`,
|
|
||||||
value: `${item}`,
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleUpdateModelValue(value: string) {
|
|
||||||
itemPerPage.value = Number(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(
|
|
||||||
[() => itemPerPage.value, () => currentPage.value],
|
|
||||||
([itemPerPage, currentPage]) => {
|
|
||||||
emit('pageChange', currentPage, itemPerPage);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<Pagination
|
|
||||||
v-model:page="currentPage"
|
|
||||||
:disabled="disabled"
|
|
||||||
:items-per-page="itemPerPage"
|
|
||||||
:show-edges="showEdges"
|
|
||||||
:sibling-count="siblingCount"
|
|
||||||
:total="total"
|
|
||||||
>
|
|
||||||
<PaginationList
|
|
||||||
v-slot="{ items }"
|
|
||||||
class="flex w-full items-center justify-end gap-1"
|
|
||||||
>
|
|
||||||
<span v-if="showTotalText" class="mr-2">共 {{ total }} 条</span>
|
|
||||||
|
|
||||||
<Select
|
|
||||||
v-if="showRowsPerPage"
|
|
||||||
:model-value="`${itemPerPage}`"
|
|
||||||
@update:model-value="handleUpdateModelValue"
|
|
||||||
>
|
|
||||||
<SelectTrigger class="w-30 mr-auto h-8">
|
|
||||||
<SelectValue />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<template v-for="item in options" :key="item.value">
|
|
||||||
<SelectItem :value="item.value"> {{ item.label }} </SelectItem>
|
|
||||||
</template>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
|
|
||||||
<PaginationFirst :class="cn('size-8', itemSize)" />
|
|
||||||
<PaginationPrev :class="cn('size-8', itemSize)" />
|
|
||||||
<template v-for="(item, index) in items">
|
|
||||||
<PaginationListItem
|
|
||||||
v-if="item.type === 'page'"
|
|
||||||
:key="index"
|
|
||||||
:value="item.value"
|
|
||||||
as-child
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
:class="cn('size-8 p-0 shadow-none', itemSize)"
|
|
||||||
:variant="item.value === currentPage ? 'default' : 'outline'"
|
|
||||||
>
|
|
||||||
{{ item.value }}
|
|
||||||
</Button>
|
|
||||||
</PaginationListItem>
|
|
||||||
<PaginationEllipsis v-else :key="item.type" :index="index" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<PaginationNext :class="cn('size-8', itemSize)" />
|
|
||||||
<PaginationLast :class="cn('size-8', itemSize)" />
|
|
||||||
</PaginationList>
|
|
||||||
</Pagination>
|
|
||||||
</template>
|
|
@ -3,8 +3,8 @@ import type { PinInputProps } from './types';
|
|||||||
|
|
||||||
import { computed, onBeforeUnmount, ref, useId, watch } from 'vue';
|
import { computed, onBeforeUnmount, ref, useId, watch } from 'vue';
|
||||||
|
|
||||||
|
import { PinInput, PinInputGroup, PinInputInput } from '../../ui';
|
||||||
import { VbenButton } from '../button';
|
import { VbenButton } from '../button';
|
||||||
import { PinInput, PinInputGroup, PinInputInput } from '../ui/pin-input';
|
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
PopoverContent,
|
PopoverContent,
|
||||||
Popover as PopoverRoot,
|
Popover as PopoverRoot,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from '../ui/popover';
|
} from '../../ui';
|
||||||
|
|
||||||
interface Props extends PopoverRootProps {
|
interface Props extends PopoverRootProps {
|
||||||
class?: any;
|
class?: any;
|
||||||
|
@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
|
|||||||
|
|
||||||
import { cn } from '@vben-core/shared/utils';
|
import { cn } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { ScrollArea, ScrollBar } from '../ui/scroll-area';
|
import { ScrollArea, ScrollBar } from '../../ui';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
class?: any;
|
class?: any;
|
||||||
|
@ -5,7 +5,7 @@ import { computed } from 'vue';
|
|||||||
|
|
||||||
import { TabsTrigger } from 'radix-vue';
|
import { TabsTrigger } from 'radix-vue';
|
||||||
|
|
||||||
import { Tabs, TabsContent, TabsList } from '../ui/tabs';
|
import { Tabs, TabsContent, TabsList } from '../../ui';
|
||||||
import TabsIndicator from './tabs-indicator.vue';
|
import TabsIndicator from './tabs-indicator.vue';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
SelectItem,
|
SelectItem,
|
||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from '../ui/select';
|
} from '../../ui';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
class?: any;
|
class?: any;
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export { default as VbenSwap } from './swap.vue';
|
|
@ -1,126 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
interface Props {
|
|
||||||
/**
|
|
||||||
* @zh_CN 交换模式
|
|
||||||
*/
|
|
||||||
mode?: 'flip' | 'rotate';
|
|
||||||
/**
|
|
||||||
* @zh_CN 开启时的样式
|
|
||||||
*/
|
|
||||||
offClass?: string;
|
|
||||||
/**
|
|
||||||
* @zh_CN 关闭时的样式
|
|
||||||
*/
|
|
||||||
onClass?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
defineOptions({
|
|
||||||
name: 'Swap',
|
|
||||||
});
|
|
||||||
|
|
||||||
withDefaults(defineProps<Props>(), {
|
|
||||||
mode: 'rotate',
|
|
||||||
onClass: '',
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<label
|
|
||||||
:class="{
|
|
||||||
'swap-flip': mode === 'flip',
|
|
||||||
'swap-rotate': mode === 'rotate',
|
|
||||||
}"
|
|
||||||
class="swap"
|
|
||||||
>
|
|
||||||
<input class="hidden" type="checkbox" />
|
|
||||||
|
|
||||||
<div :class="onClass" class="swap-on">
|
|
||||||
<slot name="swap-on"></slot>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div :class="offClass" class="swap-off">
|
|
||||||
<slot name="swap-off"></slot>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.swap {
|
|
||||||
@apply relative inline-grid cursor-pointer select-none place-content-center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap > * {
|
|
||||||
@apply col-start-1 row-start-1 duration-300 ease-out;
|
|
||||||
|
|
||||||
transition-property: transform, opacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap-rotate .swap-on,
|
|
||||||
.swap-rotate .swap-indeterminate,
|
|
||||||
.swap-rotate input:indeterminate ~ .swap-on {
|
|
||||||
@apply rotate-45;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap-rotate input:checked ~ .swap-off,
|
|
||||||
.swap-active:where(.swap-rotate) .swap-off,
|
|
||||||
.swap-rotate input:indeterminate ~ .swap-off {
|
|
||||||
@apply -rotate-45;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap-rotate input:checked ~ .swap-on,
|
|
||||||
.swap-active:where(.swap-rotate) .swap-on,
|
|
||||||
.swap-rotate input:indeterminate ~ .swap-indeterminate {
|
|
||||||
@apply rotate-0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap-flip {
|
|
||||||
transform-style: preserve-3d;
|
|
||||||
perspective: 16em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap-flip .swap-on,
|
|
||||||
.swap-flip .swap-indeterminate,
|
|
||||||
.swap-flip input:indeterminate ~ .swap-on {
|
|
||||||
@apply opacity-100;
|
|
||||||
|
|
||||||
transform: rotateY(180deg);
|
|
||||||
backface-visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap-flip input:checked ~ .swap-off,
|
|
||||||
.swap-active:where(.swap-flip) .swap-off,
|
|
||||||
.swap-flip input:indeterminate ~ .swap-off {
|
|
||||||
@apply opacity-100;
|
|
||||||
|
|
||||||
transform: rotateY(-180deg);
|
|
||||||
backface-visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap-flip input:checked ~ .swap-on,
|
|
||||||
.swap-active:where(.swap-flip) .swap-on,
|
|
||||||
.swap-flip input:indeterminate ~ .swap-indeterminate {
|
|
||||||
transform: rotateY(0deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap input {
|
|
||||||
@apply appearance-none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap .swap-on,
|
|
||||||
.swap .swap-indeterminate,
|
|
||||||
.swap input:indeterminate ~ .swap-on {
|
|
||||||
@apply opacity-0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap input:checked ~ .swap-off,
|
|
||||||
.swap-active .swap-off,
|
|
||||||
.swap input:indeterminate ~ .swap-off {
|
|
||||||
@apply opacity-0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swap input:checked ~ .swap-on,
|
|
||||||
.swap-active .swap-on,
|
|
||||||
.swap input:indeterminate ~ .swap-indeterminate {
|
|
||||||
@apply opacity-100;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -8,7 +8,7 @@ import {
|
|||||||
TooltipContent,
|
TooltipContent,
|
||||||
TooltipProvider,
|
TooltipProvider,
|
||||||
TooltipTrigger,
|
TooltipTrigger,
|
||||||
} from '../ui/tooltip';
|
} from '../../ui';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
contentClass?: any;
|
contentClass?: any;
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
export * from './components';
|
export * from './components';
|
||||||
|
export * from './ui';
|
||||||
export { createContext, Slot, VisuallyHidden } from 'radix-vue';
|
export { createContext, Slot, VisuallyHidden } from 'radix-vue';
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user