dialog.mjs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import '../../../utils/index.mjs';
  2. import '../../../constants/index.mjs';
  3. import { dialogContentProps } from './dialog-content.mjs';
  4. import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
  5. import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
  6. import { isBoolean } from '@vueuse/core';
  7. const dialogProps = buildProps({
  8. ...dialogContentProps,
  9. appendToBody: {
  10. type: Boolean,
  11. default: false
  12. },
  13. beforeClose: {
  14. type: definePropType(Function)
  15. },
  16. destroyOnClose: {
  17. type: Boolean,
  18. default: false
  19. },
  20. closeOnClickModal: {
  21. type: Boolean,
  22. default: true
  23. },
  24. closeOnPressEscape: {
  25. type: Boolean,
  26. default: true
  27. },
  28. lockScroll: {
  29. type: Boolean,
  30. default: true
  31. },
  32. modal: {
  33. type: Boolean,
  34. default: true
  35. },
  36. openDelay: {
  37. type: Number,
  38. default: 0
  39. },
  40. closeDelay: {
  41. type: Number,
  42. default: 0
  43. },
  44. top: {
  45. type: String
  46. },
  47. modelValue: {
  48. type: Boolean,
  49. default: false
  50. },
  51. modalClass: String,
  52. width: {
  53. type: [String, Number]
  54. },
  55. zIndex: {
  56. type: Number
  57. },
  58. trapFocus: {
  59. type: Boolean,
  60. default: false
  61. }
  62. });
  63. const dialogEmits = {
  64. open: () => true,
  65. opened: () => true,
  66. close: () => true,
  67. closed: () => true,
  68. [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
  69. openAutoFocus: () => true,
  70. closeAutoFocus: () => true
  71. };
  72. export { dialogEmits, dialogProps };
  73. //# sourceMappingURL=dialog.mjs.map