fix: when opening the tool separately, there is no need to pass the toolbar-tools slot (#4841)

pull/48/MERGE
Vben 2024-11-09 14:07:41 +08:00 committed by GitHub
parent 9cf0573921
commit 2c6edafeb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 66 additions and 30 deletions

View File

@ -320,7 +320,7 @@ useVbenForm 返回的第二个参数,是一个对象,包含了一些表单
```ts ```ts
export interface ActionButtonOptions { export interface ActionButtonOptions {
/** 样式 */ /** 样式 */
class?: any; class?: ClassType;
/** 是否禁用 */ /** 是否禁用 */
disabled?: boolean; disabled?: boolean;
/** 是否加载中 */ /** 是否加载中 */

View File

@ -67,7 +67,7 @@ import { SvgTestIcon } from '@vben/icons';
</template> </template>
``` ```
## Tailwind CSS 图标 <Badge text="不推荐" type="danger"/> ## Tailwind CSS 图标
### 使用 ### 使用

View File

@ -30,4 +30,6 @@ interface BasicUserInfo {
username: string; username: string;
} }
export type { BasicOption, BasicUserInfo, SelectOption, TabOption }; type ClassType = Array<object | string> | object | string;
export type { BasicOption, BasicUserInfo, ClassType, SelectOption, TabOption };

View File

@ -40,6 +40,7 @@
"@vben-core/composables": "workspace:*", "@vben-core/composables": "workspace:*",
"@vben-core/shadcn-ui": "workspace:*", "@vben-core/shadcn-ui": "workspace:*",
"@vben-core/shared": "workspace:*", "@vben-core/shared": "workspace:*",
"@vben-core/typings": "workspace:*",
"@vee-validate/zod": "catalog:", "@vee-validate/zod": "catalog:",
"@vueuse/core": "catalog:", "@vueuse/core": "catalog:",
"vee-validate": "catalog:", "vee-validate": "catalog:",

View File

@ -1,4 +1,5 @@
import type { VbenButtonProps } from '@vben-core/shadcn-ui'; import type { VbenButtonProps } from '@vben-core/shadcn-ui';
import type { ClassType } from '@vben-core/typings';
import type { FieldOptions, FormContext, GenericObject } from 'vee-validate'; import type { FieldOptions, FormContext, GenericObject } from 'vee-validate';
import type { ZodTypeAny } from 'zod'; import type { ZodTypeAny } from 'zod';
@ -303,7 +304,7 @@ export interface VbenFormProps<
/** /**
* class * class
*/ */
actionWrapperClass?: any; actionWrapperClass?: ClassType;
/** /**
* *
*/ */

View File

@ -41,6 +41,7 @@
"@vben-core/icons": "workspace:*", "@vben-core/icons": "workspace:*",
"@vben-core/shadcn-ui": "workspace:*", "@vben-core/shadcn-ui": "workspace:*",
"@vben-core/shared": "workspace:*", "@vben-core/shared": "workspace:*",
"@vben-core/typings": "workspace:*",
"@vueuse/core": "catalog:", "@vueuse/core": "catalog:",
"vue": "catalog:" "vue": "catalog:"
} }

View File

@ -1,3 +1,5 @@
import type { ClassType } from '@vben-core/typings';
import type { DrawerApi } from './drawer-api'; import type { DrawerApi } from './drawer-api';
import type { Component, Ref } from 'vue'; import type { Component, Ref } from 'vue';
@ -7,7 +9,7 @@ export interface DrawerProps {
* *
*/ */
cancelText?: string; cancelText?: string;
class?: any; class?: ClassType;
/** /**
* *
* @default true * @default true
@ -45,11 +47,17 @@ export interface DrawerProps {
/** /**
* *
*/ */
footerClass?: any; footerClass?: ClassType;
/**
*
* @default true
*/
header?: boolean;
/** /**
* *
*/ */
headerClass?: any; headerClass?: ClassType;
/** /**
* *
* @default false * @default false

View File

@ -57,6 +57,7 @@ const {
description, description,
footer: showFooter, footer: showFooter,
footerClass, footerClass,
header: showHeader,
headerClass, headerClass,
loading: showLoading, loading: showLoading,
modal, modal,
@ -131,6 +132,7 @@ function handleFocusOutside(e: Event) {
@pointer-down-outside="pointerDownOutside" @pointer-down-outside="pointerDownOutside"
> >
<SheetHeader <SheetHeader
v-show="showHeader"
:class=" :class="
cn( cn(
'!flex flex-row items-center justify-between border-b px-6 py-5', '!flex flex-row items-center justify-between border-b px-6 py-5',

View File

@ -1,4 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import type { import type {
AvatarFallbackProps, AvatarFallbackProps,
AvatarImageProps, AvatarImageProps,
@ -11,9 +12,9 @@ import { Avatar, AvatarFallback, AvatarImage } from '../../ui';
interface Props extends AvatarRootProps, AvatarFallbackProps, AvatarImageProps { interface Props extends AvatarRootProps, AvatarFallbackProps, AvatarImageProps {
alt?: string; alt?: string;
class?: any; class?: ClassType;
dot?: boolean; dot?: boolean;
dotClass?: any; dotClass?: ClassType;
} }
defineOptions({ defineOptions({

View File

@ -1,4 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import type { import type {
ContextMenuContentProps, ContextMenuContentProps,
ContextMenuRootEmits, ContextMenuRootEmits,
@ -22,11 +23,11 @@ import {
const props = defineProps< const props = defineProps<
{ {
class?: any; class?: ClassType;
contentClass?: any; contentClass?: ClassType;
contentProps?: ContextMenuContentProps; contentProps?: ContextMenuContentProps;
handlerData?: Record<string, any>; handlerData?: Record<string, any>;
itemClass?: any; itemClass?: ClassType;
menus: (data: any) => IContextMenuItem[]; menus: (data: any) => IContextMenuItem[];
} & ContextMenuRootProps } & ContextMenuRootProps
>(); >();

View File

@ -1,4 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import type { import type {
HoverCardContentProps, HoverCardContentProps,
HoverCardRootEmits, HoverCardRootEmits,
@ -12,8 +13,8 @@ import { useForwardPropsEmits } from 'radix-vue';
import { HoverCard, HoverCardContent, HoverCardTrigger } from '../../ui'; import { HoverCard, HoverCardContent, HoverCardTrigger } from '../../ui';
interface Props extends HoverCardRootProps { interface Props extends HoverCardRootProps {
class?: any; class?: ClassType;
contentClass?: any; contentClass?: ClassType;
contentProps?: HoverCardContentProps; contentProps?: HoverCardContentProps;
} }

View File

@ -1,4 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import type { import type {
PopoverContentProps, PopoverContentProps,
PopoverRootEmits, PopoverRootEmits,
@ -16,8 +17,8 @@ import {
} from '../../ui'; } from '../../ui';
interface Props extends PopoverRootProps { interface Props extends PopoverRootProps {
class?: any; class?: ClassType;
contentClass?: any; contentClass?: ClassType;
contentProps?: PopoverContentProps; contentProps?: PopoverContentProps;
} }

View File

@ -1,4 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import { cn } from '@vben-core/shared/utils'; import { cn } from '@vben-core/shared/utils';
@ -6,9 +8,9 @@ import { cn } from '@vben-core/shared/utils';
import { ScrollArea, ScrollBar } from '../../ui'; import { ScrollArea, ScrollBar } from '../../ui';
interface Props { interface Props {
class?: any; class?: ClassType;
horizontal?: boolean; horizontal?: boolean;
scrollBarClass?: any; scrollBarClass?: ClassType;
shadow?: boolean; shadow?: boolean;
shadowBorder?: boolean; shadowBorder?: boolean;
shadowBottom?: boolean; shadowBottom?: boolean;

View File

@ -1,4 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import type { TooltipContentProps } from 'radix-vue'; import type { TooltipContentProps } from 'radix-vue';
import type { StyleValue } from 'vue'; import type { StyleValue } from 'vue';
@ -11,7 +12,7 @@ import {
} from '../../ui'; } from '../../ui';
interface Props { interface Props {
contentClass?: any; contentClass?: ClassType;
contentStyle?: StyleValue; contentStyle?: StyleValue;
delayDuration?: number; delayDuration?: number;
side?: TooltipContentProps['side']; side?: TooltipContentProps['side'];

View File

@ -1,4 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ClassType } from '@vben-core/typings';
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import { cn } from '@vben-core/shared/utils'; import { cn } from '@vben-core/shared/utils';
@ -18,8 +20,8 @@ import DialogOverlay from './DialogOverlay.vue';
const props = withDefaults( const props = withDefaults(
defineProps< defineProps<
{ {
class?: any; class?: ClassType;
closeClass?: any; closeClass?: ClassType;
modal?: boolean; modal?: boolean;
open?: boolean; open?: boolean;
showClose?: boolean; showClose?: boolean;

View File

@ -1,3 +1,5 @@
import type { ClassType } from '@vben/types';
import type { CSSProperties } from 'vue'; import type { CSSProperties } from 'vue';
export interface CaptchaData { export interface CaptchaData {
@ -72,7 +74,7 @@ export interface PointSelectionCaptchaProps
} }
export interface SliderCaptchaProps { export interface SliderCaptchaProps {
class?: any; class?: ClassType;
/** /**
* @description * @description
* @default {} * @default {}

View File

@ -87,3 +87,11 @@
.vxe-table-custom--checkbox-option:hover { .vxe-table-custom--checkbox-option:hover {
background: none !important; background: none !important;
} }
.vxe-toolbar {
padding-top: 0;
}
.vxe-tools--operate:not(:has(button)) {
margin-left: 0;
}

View File

@ -1,4 +1,4 @@
import type { DeepPartial } from '@vben/types'; import type { ClassType, DeepPartial } from '@vben/types';
import type { VbenFormProps } from '@vben-core/form-ui'; import type { VbenFormProps } from '@vben-core/form-ui';
import type { import type {
VxeGridListeners, VxeGridListeners,
@ -30,11 +30,11 @@ export interface VxeGridProps {
/** /**
* class * class
*/ */
class?: any; class?: ClassType;
/** /**
* vxe-grid class * vxe-grid class
*/ */
gridClass?: any; gridClass?: ClassType;
/** /**
* vxe-grid * vxe-grid
*/ */

View File

@ -137,10 +137,6 @@ const options = computed(() => {
mergedOptions.proxyConfig.autoLoad = false; mergedOptions.proxyConfig.autoLoad = false;
} }
if (!showToolbar.value && mergedOptions.toolbarConfig) {
mergedOptions.toolbarConfig.enabled = false;
}
if (mergedOptions.pagerConfig) { if (mergedOptions.pagerConfig) {
const mobileLayouts = [ const mobileLayouts = [
'PrevJump', 'PrevJump',

View File

@ -87,7 +87,7 @@ function changeLoading() {
<Button class="mr-2" type="primary" @click="changeLoading"> <Button class="mr-2" type="primary" @click="changeLoading">
显示loading 显示loading
</Button> </Button>
<Button class="mr-2" type="primary" @click="changeStripe"> <Button type="primary" @click="changeStripe">
{{ showStripe ? '隐藏' : '显示' }}斑马纹 {{ showStripe ? '隐藏' : '显示' }}斑马纹
</Button> </Button>
</template> </template>

View File

@ -1292,6 +1292,9 @@ importers:
'@vben-core/shared': '@vben-core/shared':
specifier: workspace:* specifier: workspace:*
version: link:../../base/shared version: link:../../base/shared
'@vben-core/typings':
specifier: workspace:*
version: link:../../base/typings
'@vee-validate/zod': '@vee-validate/zod':
specifier: 'catalog:' specifier: 'catalog:'
version: 4.14.7(vue@3.5.12(typescript@5.6.3)) version: 4.14.7(vue@3.5.12(typescript@5.6.3))
@ -1370,6 +1373,9 @@ importers:
'@vben-core/shared': '@vben-core/shared':
specifier: workspace:* specifier: workspace:*
version: link:../../base/shared version: link:../../base/shared
'@vben-core/typings':
specifier: workspace:*
version: link:../../base/typings
'@vueuse/core': '@vueuse/core':
specifier: 'catalog:' specifier: 'catalog:'
version: 11.2.0(vue@3.5.12(typescript@5.6.3)) version: 11.2.0(vue@3.5.12(typescript@5.6.3))