template.defaults.imports.isMaxLength = function(maxlength){
    if(!isNaN(maxlength) && maxlength > 0){
        return true;
    }
    else{
        return false;
    }
};
template.defaults.imports.inputTitle = function(maxlength, char2Modal){
    if(!isNaN(maxlength) && maxlength > 0 && char2Modal){
        return '最多输入'+Math.floor(maxlength/2)+'个中文字符或者'+maxlength+'个英文数字字符';
    }
    else{
        return '';
    }
};
const JDInputMaxTpl = `<input id="{{iptId}}" value="{{value}}" placeholder="{{placeholder}}" {{if maxlength | isMaxLength }}maxlength="{{maxlength}}" title="{{maxlength | inputTitle char2Modal}}"{{/if}} class="{{typeClass}} cd-jd-input"></input>`;
export {JDInputMaxTpl};