UNPKG

@shopgate/engage

Version:
4 lines 1.35 kB
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{i18n,SHOP_SETTING_REGISTRATION_MODE_SIMPLE,SHOP_SETTING_REGISTRATION_MODE_EXTENDED}from'@shopgate/engage/core';/** * Generates form configuration. * @returns {Object} */var generateFormConfig=function generateFormConfig(_ref){var _ref$registrationMode=_ref.registrationMode,registrationMode=_ref$registrationMode===void 0?SHOP_SETTING_REGISTRATION_MODE_EXTENDED:_ref$registrationMode;return{fields:_extends({},registrationMode===SHOP_SETTING_REGISTRATION_MODE_SIMPLE?{firstName:{type:'text',label:"".concat(i18n.text('checkout.pickup_contact.form.firstName')," *"),required:true},lastName:{type:'text',label:"".concat(i18n.text('checkout.pickup_contact.form.lastName')," *"),required:true}}:null,{emailAddress:{type:'email',label:"".concat(i18n.text('checkout.pickup_contact.form.emailAddress')," *"),required:true},password:{type:'password',label:i18n.text('checkout.pickup_contact.form.password'),required:true},passwordConfirm:{type:'password',label:i18n.text('checkout.pickup_contact.form.passwordConfirm'),required:true}})};};export default generateFormConfig;