Notify.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import _extends from "@babel/runtime/helpers/esm/extends";
  2. import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
  3. // Utils
  4. import { createNamespace } from '../utils';
  5. import { inherit } from '../utils/functional'; // Mixins
  6. import { popupMixinProps } from '../mixins/popup'; // Components
  7. import Popup from '../popup'; // Types
  8. var _createNamespace = createNamespace('notify'),
  9. createComponent = _createNamespace[0],
  10. bem = _createNamespace[1];
  11. function Notify(h, props, slots, ctx) {
  12. var style = {
  13. color: props.color,
  14. background: props.background
  15. };
  16. return h(Popup, _mergeJSXProps([{
  17. "attrs": {
  18. "value": props.value,
  19. "position": "top",
  20. "overlay": false,
  21. "duration": 0.2,
  22. "lockScroll": false
  23. },
  24. "style": style,
  25. "class": [bem([props.type]), props.className]
  26. }, inherit(ctx, true)]), [(slots.default == null ? void 0 : slots.default()) || props.message]);
  27. }
  28. Notify.props = _extends({}, popupMixinProps, {
  29. color: String,
  30. message: [Number, String],
  31. duration: [Number, String],
  32. className: null,
  33. background: String,
  34. getContainer: [String, Function],
  35. type: {
  36. type: String,
  37. default: 'danger'
  38. }
  39. });
  40. export default createComponent(Notify);