import XEUtils from 'xe-utils';
export function getOnName(type) {
    return XEUtils.kebabCase(type);
}
export function getModelEvent(renderOpts) {
    switch (renderOpts.name) {
        case 'VxeInput':
        case 'VxeTextarea':
        case 'VxeNumberInput':
        case 'VxePasswordInput':
        case 'VxeSelect':
        case 'VxeTreeSelect':
        case 'VxeTableSelect':
        case 'VxeDatePicker':
        case 'VxeDateRangePicker':
        case 'VxeIconPicker':
        case 'VxeColorPicker':
        case 'VxeSlider':
        case 'VxeUpload':
            return 'modelValue';
        case 'select':
            return 'change';
    }
    return 'input';
}
export function getChangeEvent(renderOpts) {
    switch (renderOpts.name) {
        case 'input':
        case 'textarea':
        case 'VxeInput':
        case 'VxeTextarea':
        case '$input': // 已废弃
        case '$textarea': // 已废弃
            return 'input';
    }
    return 'change';
}
export function getSlotVNs(vns) {
    if (XEUtils.isArray(vns)) {
        return vns;
    }
    return vns ? [vns] : [];
}
export function getEventCaseName(_vm, name) {
    const caseName = XEUtils.camelCase(name);
    if (caseName === name) {
        return name;
    }
    const _events = _vm ? _vm._events : null;
    return _events && _events[caseName] ? caseName : name;
}
