2022-03-26 14:52:54 +00:00
|
|
|
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
|
2019-01-12 03:33:27 +00:00
|
|
|
import PropTypes from '../_util/vue-types';
|
2018-03-05 11:05:23 +00:00
|
|
|
|
2022-04-14 01:54:45 +00:00
|
|
|
export function dialogPropTypes() {
|
2018-03-05 11:05:23 +00:00
|
|
|
return {
|
2022-03-26 14:52:54 +00:00
|
|
|
keyboard: { type: Boolean, default: undefined },
|
|
|
|
mask: { type: Boolean, default: undefined },
|
|
|
|
afterClose: Function,
|
|
|
|
closable: { type: Boolean, default: undefined },
|
|
|
|
maskClosable: { type: Boolean, default: undefined },
|
|
|
|
visible: { type: Boolean, default: undefined },
|
|
|
|
destroyOnClose: { type: Boolean, default: undefined },
|
2018-03-05 11:05:23 +00:00
|
|
|
mousePosition: PropTypes.shape({
|
2022-03-26 14:52:54 +00:00
|
|
|
x: Number,
|
|
|
|
y: Number,
|
2018-03-05 11:05:23 +00:00
|
|
|
}).loose,
|
|
|
|
title: PropTypes.any,
|
|
|
|
footer: PropTypes.any,
|
2022-03-26 14:52:54 +00:00
|
|
|
transitionName: String,
|
|
|
|
maskTransitionName: String,
|
2018-03-05 11:05:23 +00:00
|
|
|
animation: PropTypes.any,
|
|
|
|
maskAnimation: PropTypes.any,
|
2022-03-26 14:52:54 +00:00
|
|
|
wrapStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
|
|
|
bodyStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
|
|
|
maskStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
|
|
|
prefixCls: String,
|
|
|
|
wrapClassName: String,
|
2022-04-14 01:54:45 +00:00
|
|
|
rootClassName: String,
|
2022-03-26 14:52:54 +00:00
|
|
|
width: [String, Number],
|
|
|
|
height: [String, Number],
|
|
|
|
zIndex: Number,
|
2018-03-05 11:05:23 +00:00
|
|
|
bodyProps: PropTypes.any,
|
|
|
|
maskProps: PropTypes.any,
|
|
|
|
wrapProps: PropTypes.any,
|
2019-08-29 14:50:53 +00:00
|
|
|
getContainer: PropTypes.any,
|
2022-03-26 14:52:54 +00:00
|
|
|
dialogStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
|
|
|
dialogClass: String,
|
2018-10-29 12:49:38 +00:00
|
|
|
closeIcon: PropTypes.any,
|
2022-03-26 14:52:54 +00:00
|
|
|
forceRender: { type: Boolean, default: undefined },
|
|
|
|
getOpenCount: Function as PropType<() => number>,
|
2019-12-09 14:23:40 +00:00
|
|
|
// https://github.com/ant-design/ant-design/issues/19771
|
|
|
|
// https://github.com/react-component/dialog/issues/95
|
2022-03-26 14:52:54 +00:00
|
|
|
focusTriggerAfterClose: { type: Boolean, default: undefined },
|
|
|
|
onClose: Function as PropType<(e: MouseEvent | KeyboardEvent) => void>,
|
|
|
|
modalRender: Function,
|
2019-01-12 03:33:27 +00:00
|
|
|
};
|
2018-03-05 11:05:23 +00:00
|
|
|
}
|
2022-01-06 08:08:53 +00:00
|
|
|
export type IDialogChildProps = Partial<ExtractPropTypes<ReturnType<typeof dialogPropTypes>>>;
|
|
|
|
export default dialogPropTypes;
|