switchery.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. (function (global, factory) {
  2. if (typeof define === "function" && define.amd) {
  3. define("/Plugin/switchery", ["exports", "Plugin", "Config"], factory);
  4. } else if (typeof exports !== "undefined") {
  5. factory(exports, require("Plugin"), require("Config"));
  6. } else {
  7. var mod = {
  8. exports: {}
  9. };
  10. factory(mod.exports, global.Plugin, global.Config);
  11. global.PluginSwitchery = mod.exports;
  12. }
  13. })(this, function (_exports, _Plugin2, _Config) {
  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 = 'switchery';
  21. var SwitcheryPlugin =
  22. /*#__PURE__*/
  23. function (_Plugin) {
  24. babelHelpers.inherits(SwitcheryPlugin, _Plugin);
  25. function SwitcheryPlugin() {
  26. babelHelpers.classCallCheck(this, SwitcheryPlugin);
  27. return babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(SwitcheryPlugin).apply(this, arguments));
  28. }
  29. babelHelpers.createClass(SwitcheryPlugin, [{
  30. key: "getName",
  31. value: function getName() {
  32. return NAME;
  33. }
  34. }, {
  35. key: "render",
  36. value: function render() {
  37. if (typeof Switchery === 'undefined') {
  38. return;
  39. }
  40. new Switchery(this.$el[0], this.options);
  41. }
  42. }], [{
  43. key: "getDefaults",
  44. value: function getDefaults() {
  45. return {
  46. color: (0, _Config.colors)('primary', 600)
  47. };
  48. }
  49. }]);
  50. return SwitcheryPlugin;
  51. }(_Plugin2.default);
  52. _Plugin2.default.register(NAME, SwitcheryPlugin);
  53. var _default = SwitcheryPlugin;
  54. _exports.default = _default;
  55. });