transition.mjs 772 B

123456789101112131415161718192021222324252627282930
  1. // Utilities
  2. import { h, mergeProps, Transition } from 'vue';
  3. import { propsFactory } from "../util/index.mjs"; // Types
  4. export const makeTransitionProps = propsFactory({
  5. transition: {
  6. type: [Boolean, String, Object],
  7. default: 'fade-transition',
  8. validator: val => val !== true
  9. }
  10. }, 'transition');
  11. export const MaybeTransition = (props, _ref) => {
  12. let {
  13. slots
  14. } = _ref;
  15. const {
  16. transition,
  17. disabled,
  18. ...rest
  19. } = props;
  20. const {
  21. component = Transition,
  22. ...customProps
  23. } = typeof transition === 'object' ? transition : {};
  24. return h(component, mergeProps(typeof transition === 'string' ? {
  25. name: disabled ? '' : transition
  26. } : customProps, rest, {
  27. disabled
  28. }), slots);
  29. };
  30. //# sourceMappingURL=transition.mjs.map