"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const transpile_1 = require("../../transpile");
const utils_1 = require("../utils");
const capitalize = (str) => {
    return str ? str.split('-')
        .map(s => s.charAt(0).toUpperCase() + s.substring(1))
        .join('') : str;
};
exports.default = {
    pre: (element, context) => {
        const componentName = capitalize(element.getAttribute('componentname'));
        return `<Wmx${componentName} ${(0, transpile_1.transformAttrs)(element, context, utils_1.inferTypeAndParseProperty)}>`;
    },
    post: (element, context) => {
        const componentName = capitalize(element.getAttribute('componentname'));
        return `</Wmx${componentName}>`;
    },
    imports: (element, context) => {
        const componentName = capitalize(element.getAttribute('componentname'));
        return [{
                name: `Wmx${capitalize(componentName)}`,
                from: `@wavemaker/wmx-component/${element.getAttribute('componentname')}/index.wmx.js`
            }];
    },
    xcomponents: (element, context) => [element.getAttribute('componentname')]
};
//# sourceMappingURL=xcomponent.transformer.js.map