Notify.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. var __defProp = Object.defineProperty;
  2. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  3. var __getOwnPropNames = Object.getOwnPropertyNames;
  4. var __hasOwnProp = Object.prototype.hasOwnProperty;
  5. var __export = (target, all) => {
  6. for (var name2 in all)
  7. __defProp(target, name2, { get: all[name2], enumerable: true });
  8. };
  9. var __copyProps = (to, from, except, desc) => {
  10. if (from && typeof from === "object" || typeof from === "function") {
  11. for (let key of __getOwnPropNames(from))
  12. if (!__hasOwnProp.call(to, key) && key !== except)
  13. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  14. }
  15. return to;
  16. };
  17. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  18. var stdin_exports = {};
  19. __export(stdin_exports, {
  20. default: () => stdin_default
  21. });
  22. module.exports = __toCommonJS(stdin_exports);
  23. var import_vue = require("vue");
  24. var import_vue2 = require("vue");
  25. var import_utils = require("../utils");
  26. var import_popup = require("../popup");
  27. var import_shared = require("../popup/shared");
  28. const [name, bem] = (0, import_utils.createNamespace)("notify");
  29. const notifyProps = (0, import_utils.extend)({}, import_shared.popupSharedProps, {
  30. type: (0, import_utils.makeStringProp)("danger"),
  31. color: String,
  32. message: import_utils.numericProp,
  33. position: (0, import_utils.makeStringProp)("top"),
  34. className: import_utils.unknownProp,
  35. background: String,
  36. lockScroll: Boolean
  37. });
  38. var stdin_default = (0, import_vue2.defineComponent)({
  39. name,
  40. props: notifyProps,
  41. emits: ["update:show"],
  42. setup(props, {
  43. emit,
  44. slots
  45. }) {
  46. const updateShow = (show) => emit("update:show", show);
  47. return () => (0, import_vue.createVNode)(import_popup.Popup, {
  48. "show": props.show,
  49. "class": [bem([props.type]), props.className],
  50. "style": {
  51. color: props.color,
  52. background: props.background
  53. },
  54. "overlay": false,
  55. "position": props.position,
  56. "duration": 0.2,
  57. "lockScroll": props.lockScroll,
  58. "onUpdate:show": updateShow
  59. }, {
  60. default: () => [slots.default ? slots.default() : props.message]
  61. });
  62. }
  63. });