1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.install = install;
- exports.IconPark = void 0;
- var IconMap = _interopRequireWildcard(require("./map"));
- 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); }
- 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; }
- function toPascalCase(val) {
- return val.replace(/(^\w|-\w)/g, function (c) {
- return c.slice(-1).toUpperCase();
- });
- }
- var options = {
- name: 'icon-park',
- props: ['type', 'theme', 'size', 'spin', 'fill', 'strokeLinecap', 'strokeLinejoin', 'strokeWidth'],
- inheritAttrs: true,
- render: function render(h) {
- var type = toPascalCase(this.type);
- var theme = this.theme,
- size = this.size,
- fill = this.fill,
- strokeLinecap = this.strokeLinecap,
- strokeLinejoin = this.strokeLinejoin,
- strokeWidth = this.strokeWidth,
- spin = this.spin;
- if (!(type in IconMap)) {
- throw new Error("".concat(type, " is not a valid icon type name"));
- }
- return h(IconMap[type], {
- props: {
- theme: theme,
- size: size,
- fill: fill,
- strokeLinecap: strokeLinecap,
- strokeLinejoin: strokeLinejoin,
- strokeWidth: strokeWidth,
- spin: spin
- }
- });
- }
- };
- var IconPark = options;
- exports.IconPark = IconPark;
- function install(Vue, prefix) {
- Object.values(IconMap).forEach(function (icon) {
- Vue.component(prefix ? prefix + '-' + icon.name.slice(5) : icon.name, icon);
- });
- }
|