@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
283 lines (282 loc) • 6.66 kB
TypeScript
/**
* Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ExtractPropTypes, PropType } from 'vue';
import { ModalButton } from './composition/type';
export type DragHandleType = HTMLElement | string;
export declare const modalProps: {
/**
* 允许点击蒙层关闭对话框
* @default false
*/
allowClickMaskToClose: {
type: BooleanConstructor;
default: boolean;
};
/**
* 关闭前事件
* @default () => { return true; }
*/
beforeClose: {
type: FunctionConstructor;
default: () => boolean;
};
/**
* 自定义样式,类名以空格隔开
* @default ''
*/
class: {
type: StringConstructor;
default: string;
};
/**
* 自定义蒙层样式,类名以空格隔开
* @default ''
*/
maskClass: {
type: StringConstructor;
default: string;
};
/**
* 窗口标题
*/
title: {
type: StringConstructor;
default: string;
};
/**
* 窗口宽度
* @default 500
*/
width: {
type: NumberConstructor;
default: number;
};
/**
* 窗口高度
* @default 320
*/
height: {
type: NumberConstructor;
default: number;
};
/**
* 底部按钮
*/
buttons: {
type: {
(arrayLength: number): ModalButton[];
(...items: ModalButton[]): ModalButton[];
new (arrayLength: number): ModalButton[];
new (...items: ModalButton[]): ModalButton[];
isArray(arg: any): arg is any[];
readonly prototype: any[];
from<T>(arrayLike: ArrayLike<T>): T[];
from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
of<T_4>(...items: T_4[]): T_4[];
readonly [Symbol.species]: ArrayConstructor;
};
default: never[];
};
/**
* 双向绑定属性是否显示窗口
* @default false
*/
modelValue: {
type: BooleanConstructor;
default: boolean;
};
/**
* 是否模态
* @default true
*/
mask: {
type: BooleanConstructor;
default: boolean;
};
/**
* 展示头部
* @default true
*/
showHeader: {
type: BooleanConstructor;
default: boolean;
};
/**
* 展示默认按钮
* @default true
*/
showButtons: {
type: BooleanConstructor;
default: boolean;
};
/**
* 自适应尺寸
* @default true
*/
fitContent: {
type: BooleanConstructor;
default: boolean;
};
/**
* 展示右上角关闭弹窗按钮
* @default true
*/
showCloseButton: {
type: BooleanConstructor;
default: boolean;
};
/**
* 是否在窗口右上角展示浮动关闭按钮
*/
showFloatingClose: {
type: BooleanConstructor;
default: boolean;
};
/**
* 展示右上角最大化按钮
* @default false
*/
showMaxButton: {
type: BooleanConstructor;
default: boolean;
};
minHeight: {
type: NumberConstructor;
};
maxHeight: {
type: NumberConstructor;
};
minWidth: {
type: NumberConstructor;
};
maxWidth: {
type: NumberConstructor;
};
containment: {
type: PropType<HTMLElement>;
default: null;
};
/**
* 可调整窗口尺寸
* @default false
*/
resizeable: {
type: BooleanConstructor;
default: boolean;
};
/**
* 可拖拽窗口
* @default false
*/
draggable: {
type: BooleanConstructor;
default: boolean;
};
/**
* 拖拽抓手,赋值css选择器
*/
dragHandle: {
type: PropType<DragHandleType>;
default: null;
};
/**
* 命令式调用属性,默认关闭按钮回调事件
*/
closedCallback: {
type: FunctionConstructor;
default: null;
};
openedCallback: {
type: FunctionConstructor;
default: null;
};
resizeHandle: {
type: FunctionConstructor;
default: null;
};
/**
* 命令式调用属性,默认插槽,返回VNode
*/
render: {
type: FunctionConstructor;
default: null;
};
/**
* 命令式调用属性,底部默认确定按钮回调事件
*/
acceptCallback: {
type: FunctionConstructor;
default: null;
};
/**
* 命令式调用属性,底部默认取消按钮回调事件
*/
rejectCallback: {
type: FunctionConstructor;
default: null;
};
enableEsc: {
type: BooleanConstructor;
default: boolean;
};
enableEnter: {
type: BooleanConstructor;
default: boolean;
};
dialogType: {
type: StringConstructor;
default: string;
};
src: {
type: StringConstructor;
default: string;
};
/**
* 底部区域高度,如果设置为0,则不显示底部区域
* @default 60
*/
footerHeight: {
type: NumberConstructor;
default: number;
};
position: {
type: StringConstructor;
default: string;
};
host: {
type: PropType<DragHandleType>;
default: string;
};
isMessager: {
type: BooleanConstructor;
default: boolean;
};
fullscreen: {
type: BooleanConstructor;
default: boolean;
};
maximized: {
type: BooleanConstructor;
default: boolean;
};
useTransform: {
type: BooleanConstructor;
default: boolean;
};
};
export type ModalProps = Partial<ExtractPropTypes<typeof modalProps>>;