registry.js 1.1 KB

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. var __rest = (this && this.__rest) || function (s, e) {
  3. var t = {};
  4. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  5. t[p] = s[p];
  6. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  7. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  8. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  9. t[p[i]] = s[p[i]];
  10. }
  11. return t;
  12. };
  13. Object.defineProperty(exports, "__esModule", { value: true });
  14. exports.register = exports.shapeMaps = void 0;
  15. const x6_1 = require("@antv/x6");
  16. exports.shapeMaps = {};
  17. function register(config) {
  18. const { shape, component, inherit } = config, others = __rest(config, ["shape", "component", "inherit"]);
  19. if (!shape) {
  20. throw new Error('should specify shape in config');
  21. }
  22. exports.shapeMaps[shape] = {
  23. component,
  24. };
  25. x6_1.Graph.registerNode(shape, Object.assign({ inherit: inherit || 'vue-shape' }, others), true);
  26. }
  27. exports.register = register;
  28. //# sourceMappingURL=registry.js.map