UNPKG

@elliemae/ds-wysiwygeditor

Version:

Ellie Mae - Dim Sum - WYSIWYG Editor

54 lines (48 loc) 1.71 kB
var _this = undefined; var fields = ['Lender Name ­ «315»', 'Lender Address ­ «319»', 'Lender City ­ «313»', 'Lender State ­ «321»', 'Lender Zip ­ «323»', 'Borrower First Name ­ «4000»', 'Borrower Last Name ­ «4002»', 'Total Loan Amount ­ «2»', 'Loan Term ­ «4»', 'Loan to Value ­ «976»', 'Monthly Payment ­ «912»', 'Interest Rate ­ «3»', 'Loan Originator Name ­ «1612»', 'Loan Originator Email ­ «3968»', 'Loan Originator Phone ­ «1823»', 'NMLS Loan Originator ID ­ «3238»']; /** * Returns the fields names * * @param customFields */ var getFields = function getFields() { var customFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : fields; return customFields.map(function (opt, index) { return { id: "".concat(opt, "_").concat(index), // icon: 'ADD', label: "".concat(opt), onClick: opt.indexOf('«') !== -1 ? function () { return _this.onOptionClick(_this.getFieldCode(opt)); } : null, type: opt === '' ? 'separator' : null }; }); }; /** * Returns a field's name * * @param field */ var getFieldName = function getFieldName(field) { var codeIndex = field.indexOf('«'); return field.substring(0, codeIndex); }; /** * Returns a field's id. E.g: «456» * * @param field */ var getFieldCode = function getFieldCode(field) { var codeIndex = field.indexOf('«'); return field.substring(codeIndex); }; var customFields = { fields: fields, getFields: getFields, getFieldName: getFieldName, getFieldCode: getFieldCode }; export default customFields; export { fields, getFieldCode, getFieldName, getFields }; //# sourceMappingURL=customFields.js.map