UNPKG

ant-design-x-vue

Version:

Craft AI-driven interfaces effortlessly

50 lines (49 loc) 1.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AntDesignXVueResolver = AntDesignXVueResolver; /** * set of components that are contained in the package */ var primitiveNames = new Set([ 'Attachments', 'Bubble', 'Conversations', 'Prompts', 'Sender', 'Suggestion', 'Theme', 'ThoughtChain', 'Welcome', ]); function isAntdXVueComponent(name) { return primitiveNames.has(name); } // currently unnecessary to add side effects // function getSideEffects( // componentName: string, // options: AntDesignXResolverOptions = {} // ) { // const { importStyle = true, packageName = 'ant-design-x-vue' } = options // if (!importStyle) return // return // } function AntDesignXVueResolver(options) { if (options === void 0) { options = {}; } var _a = options.prefix, prefix = _a === void 0 ? 'AX' : _a, _b = options.packageName, packageName = _b === void 0 ? 'ant-design-x-vue' : _b, _c = options.exclude, exclude = _c === void 0 ? [] : _c; var resolverInfo = { type: 'component', resolve: function (name) { if (!name.startsWith(prefix)) return; var componentName = name.slice(prefix.length); if (!isAntdXVueComponent(componentName) || exclude.includes(componentName)) return; return { name: componentName, from: packageName, as: "".concat(prefix).concat(componentName) }; } }; return resolverInfo.resolve; }