interface.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import PropTypes from '../_util/vue-types';
  2. function returnEmptyString() {
  3. return '';
  4. }
  5. function returnDocument(element) {
  6. if (element) {
  7. return element.ownerDocument;
  8. }
  9. return window.document;
  10. }
  11. export function noop() {}
  12. export const triggerProps = () => ({
  13. action: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).def([]),
  14. showAction: PropTypes.any.def([]),
  15. hideAction: PropTypes.any.def([]),
  16. getPopupClassNameFromAlign: PropTypes.any.def(returnEmptyString),
  17. onPopupVisibleChange: Function,
  18. afterPopupVisibleChange: PropTypes.func.def(noop),
  19. popup: PropTypes.any,
  20. arrow: PropTypes.bool.def(true),
  21. popupStyle: {
  22. type: Object,
  23. default: undefined
  24. },
  25. prefixCls: PropTypes.string.def('rc-trigger-popup'),
  26. popupClassName: PropTypes.string.def(''),
  27. popupPlacement: String,
  28. builtinPlacements: PropTypes.object,
  29. popupTransitionName: String,
  30. popupAnimation: PropTypes.any,
  31. mouseEnterDelay: PropTypes.number.def(0),
  32. mouseLeaveDelay: PropTypes.number.def(0.1),
  33. zIndex: Number,
  34. focusDelay: PropTypes.number.def(0),
  35. blurDelay: PropTypes.number.def(0.15),
  36. getPopupContainer: Function,
  37. getDocument: PropTypes.func.def(returnDocument),
  38. forceRender: {
  39. type: Boolean,
  40. default: undefined
  41. },
  42. destroyPopupOnHide: {
  43. type: Boolean,
  44. default: false
  45. },
  46. mask: {
  47. type: Boolean,
  48. default: false
  49. },
  50. maskClosable: {
  51. type: Boolean,
  52. default: true
  53. },
  54. // onPopupAlign: PropTypes.func.def(noop),
  55. popupAlign: PropTypes.object.def(() => ({})),
  56. popupVisible: {
  57. type: Boolean,
  58. default: undefined
  59. },
  60. defaultPopupVisible: {
  61. type: Boolean,
  62. default: false
  63. },
  64. maskTransitionName: String,
  65. maskAnimation: String,
  66. stretch: String,
  67. alignPoint: {
  68. type: Boolean,
  69. default: undefined
  70. },
  71. autoDestroy: {
  72. type: Boolean,
  73. default: false
  74. },
  75. mobile: Object,
  76. getTriggerDOMNode: Function
  77. });