bootstrap-sweetalert.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. (function (global, factory) {
  2. if (typeof define === "function" && define.amd) {
  3. define("/Plugin/bootstrap-sweetalert", ["exports", "Plugin"], factory);
  4. } else if (typeof exports !== "undefined") {
  5. factory(exports, require("Plugin"));
  6. } else {
  7. var mod = {
  8. exports: {}
  9. };
  10. factory(mod.exports, global.Plugin);
  11. global.PluginBootstrapSweetalert = mod.exports;
  12. }
  13. })(this, function (_exports, _Plugin2) {
  14. "use strict";
  15. Object.defineProperty(_exports, "__esModule", {
  16. value: true
  17. });
  18. _exports.default = void 0;
  19. _Plugin2 = babelHelpers.interopRequireDefault(_Plugin2);
  20. var NAME = 'sweetalert';
  21. var Sweetalert =
  22. /*#__PURE__*/
  23. function (_Plugin) {
  24. babelHelpers.inherits(Sweetalert, _Plugin);
  25. function Sweetalert() {
  26. babelHelpers.classCallCheck(this, Sweetalert);
  27. return babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Sweetalert).apply(this, arguments));
  28. }
  29. babelHelpers.createClass(Sweetalert, [{
  30. key: "getName",
  31. value: function getName() {
  32. return NAME;
  33. }
  34. }, {
  35. key: "render",
  36. value: function render() {
  37. this.$el.data('sweetalertWrapApi', this);
  38. }
  39. }, {
  40. key: "show",
  41. value: function show() {
  42. if (typeof swal === 'undefined') {
  43. return;
  44. }
  45. swal(this.options);
  46. }
  47. }], [{
  48. key: "api",
  49. value: function api() {
  50. return 'click|show';
  51. }
  52. }]);
  53. return Sweetalert;
  54. }(_Plugin2.default);
  55. _Plugin2.default.register(NAME, Sweetalert);
  56. var _default = Sweetalert;
  57. _exports.default = _default;
  58. });