popconfirm.mjs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. import { buildProps } from "../../../utils/vue/props/runtime.mjs";
  2. import { iconPropType } from "../../../utils/vue/icon.mjs";
  3. import { useTooltipContentProps } from "../../tooltip/src/content.mjs";
  4. import { useTooltipTriggerProps } from "../../tooltip/src/trigger.mjs";
  5. import { buttonTypes } from "../../button/src/button.mjs";
  6. import { QuestionFilled } from "@element-plus/icons-vue";
  7. //#region ../../packages/components/popconfirm/src/popconfirm.ts
  8. /**
  9. * @deprecated Removed after 3.0.0, Use `PopconfirmProps` instead.
  10. */
  11. const popconfirmProps = buildProps({
  12. /**
  13. * @description Title
  14. */
  15. title: String,
  16. /**
  17. * @description Confirm button text
  18. */
  19. confirmButtonText: String,
  20. /**
  21. * @description Cancel button text
  22. */
  23. cancelButtonText: String,
  24. /**
  25. * @description Confirm button type
  26. */
  27. confirmButtonType: {
  28. type: String,
  29. values: buttonTypes,
  30. default: "primary"
  31. },
  32. /**
  33. * @description Cancel button type
  34. */
  35. cancelButtonType: {
  36. type: String,
  37. values: buttonTypes,
  38. default: "text"
  39. },
  40. /**
  41. * @description Icon Component
  42. */
  43. icon: {
  44. type: iconPropType,
  45. default: () => QuestionFilled
  46. },
  47. /**
  48. * @description Icon color
  49. */
  50. iconColor: {
  51. type: String,
  52. default: "#f90"
  53. },
  54. /**
  55. * @description is hide Icon
  56. */
  57. hideIcon: Boolean,
  58. /**
  59. * @description delay of disappear, in millisecond
  60. */
  61. hideAfter: {
  62. type: Number,
  63. default: 200
  64. },
  65. /**
  66. * @description Tooltip theme, built-in theme: `dark` / `light`
  67. */
  68. effect: {
  69. ...useTooltipContentProps.effect,
  70. default: "light"
  71. },
  72. /**
  73. * @description whether popconfirm is teleported to the body
  74. */
  75. teleported: useTooltipContentProps.teleported,
  76. /**
  77. * @description when popconfirm inactive and `persistent` is `false` , popconfirm will be destroyed
  78. */
  79. persistent: useTooltipContentProps.persistent,
  80. /**
  81. * @description popconfirm width, min width 150px
  82. */
  83. width: {
  84. type: [String, Number],
  85. default: 150
  86. },
  87. virtualTriggering: useTooltipTriggerProps.virtualTriggering,
  88. virtualRef: useTooltipTriggerProps.virtualRef
  89. });
  90. const popconfirmEmits = {
  91. /**
  92. * @description triggers when click confirm button
  93. */
  94. confirm: (e) => e instanceof MouseEvent,
  95. /**
  96. * @description triggers when click cancel button
  97. */
  98. cancel: (e) => e instanceof MouseEvent
  99. };
  100. //#endregion
  101. export { popconfirmEmits, popconfirmProps };
  102. //# sourceMappingURL=popconfirm.mjs.map