Notify.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  3. exports.__esModule = true;
  4. exports.default = void 0;
  5. var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
  6. var _babelHelperVueJsxMergeProps = _interopRequireDefault(require("@vue/babel-helper-vue-jsx-merge-props"));
  7. var _utils = require("../utils");
  8. var _functional = require("../utils/functional");
  9. var _popup = require("../mixins/popup");
  10. var _popup2 = _interopRequireDefault(require("../popup"));
  11. // Utils
  12. // Mixins
  13. // Components
  14. var _createNamespace = (0, _utils.createNamespace)('notify'),
  15. createComponent = _createNamespace[0],
  16. bem = _createNamespace[1];
  17. function Notify(h, props, slots, ctx) {
  18. var style = {
  19. color: props.color,
  20. background: props.background
  21. };
  22. return h(_popup2.default, (0, _babelHelperVueJsxMergeProps.default)([{
  23. "attrs": {
  24. "value": props.value,
  25. "position": "top",
  26. "overlay": false,
  27. "duration": 0.2,
  28. "lockScroll": false
  29. },
  30. "style": style,
  31. "class": [bem([props.type]), props.className]
  32. }, (0, _functional.inherit)(ctx, true)]), [(slots.default == null ? void 0 : slots.default()) || props.message]);
  33. }
  34. Notify.props = (0, _extends2.default)({}, _popup.popupMixinProps, {
  35. color: String,
  36. message: [Number, String],
  37. duration: [Number, String],
  38. className: null,
  39. background: String,
  40. getContainer: [String, Function],
  41. type: {
  42. type: String,
  43. default: 'danger'
  44. }
  45. });
  46. var _default = createComponent(Notify);
  47. exports.default = _default;