all.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.install = install;
  6. exports.IconPark = void 0;
  7. var IconMap = _interopRequireWildcard(require("./map"));
  8. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  9. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  10. function toPascalCase(val) {
  11. return val.replace(/(^\w|-\w)/g, function (c) {
  12. return c.slice(-1).toUpperCase();
  13. });
  14. }
  15. var options = {
  16. name: 'icon-park',
  17. props: ['type', 'theme', 'size', 'spin', 'fill', 'strokeLinecap', 'strokeLinejoin', 'strokeWidth'],
  18. inheritAttrs: true,
  19. render: function render(h) {
  20. var type = toPascalCase(this.type);
  21. var theme = this.theme,
  22. size = this.size,
  23. fill = this.fill,
  24. strokeLinecap = this.strokeLinecap,
  25. strokeLinejoin = this.strokeLinejoin,
  26. strokeWidth = this.strokeWidth,
  27. spin = this.spin;
  28. if (!(type in IconMap)) {
  29. throw new Error("".concat(type, " is not a valid icon type name"));
  30. }
  31. return h(IconMap[type], {
  32. props: {
  33. theme: theme,
  34. size: size,
  35. fill: fill,
  36. strokeLinecap: strokeLinecap,
  37. strokeLinejoin: strokeLinejoin,
  38. strokeWidth: strokeWidth,
  39. spin: spin
  40. }
  41. });
  42. }
  43. };
  44. var IconPark = options;
  45. exports.IconPark = IconPark;
  46. function install(Vue, prefix) {
  47. Object.values(IconMap).forEach(function (icon) {
  48. Vue.component(prefix ? prefix + '-' + icon.name.slice(5) : icon.name, icon);
  49. });
  50. }