etendo-ui-library 1.3.10 → 1.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,6 +33,7 @@ export declare const styles: {
33
33
  fontSize: number;
34
34
  outlineStyle: string;
35
35
  height: number;
36
+ flex: number;
36
37
  };
37
38
  inputContainerWrapper: {
38
39
  backgroundColor: string;
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.styles=exports.CALENDAR_HEIGHT=void 0;var _reactNative=require("react-native");var _colors=require("../../styles/colors");var _utilsTypes=require("../../helpers/utilsTypes");var CALENDAR_HEIGHT=exports.CALENDAR_HEIGHT=260;var styles=exports.styles=_reactNative.StyleSheet.create({container:{flex:1},datePickerButton:{borderWidth:1,borderColor:'gray',paddingVertical:_reactNative.Platform.OS===_utilsTypes.AppPlatform.web?8:20,paddingHorizontal:12,borderRadius:4,backgroundColor:'white',flexDirection:'row',justifyContent:'space-between',alignItems:'center'},inputWrapper:{flexDirection:'row',justifyContent:'space-between',alignItems:'center',paddingVertical:_reactNative.Platform.OS===_utilsTypes.AppPlatform.web?8:20,paddingHorizontal:16,backgroundColor:_colors.NEUTRAL_50},invalidDateInputWrapper:{borderColor:_colors.DESTRUCTIVE_100},disabledInput:{opacity:0.2},datePickerInput:{textAlign:'left',fontSize:18,outlineStyle:'none',height:20},inputContainerWrapper:{backgroundColor:'transparent',padding:6,height:_reactNative.Platform.OS!==_utilsTypes.AppPlatform.web?63:undefined,borderRadius:8},monthAndYearContainer:{flexDirection:'row',alignItems:'center',gap:8},monthAndYearContent:{flexDirection:'row',marginHorizontal:12,alignItems:'center',gap:8},inputWrapperFocused:{backgroundColor:_colors.QUATERNARY_50},invalidDateWrapperFocused:{backgroundColor:_colors.DESTRUCTIVE_10},calendarIcon:{width:24},modalContainer:{flex:1,justifyContent:'center',alignItems:'center',backgroundColor:'rgba(0,0,0,0.5)'},modalContent:{backgroundColor:_colors.NEUTRAL_50,borderRadius:8,elevation:5,width:_reactNative.Platform.OS===_utilsTypes.AppPlatform.web?'100%':'90%',borderWidth:1,borderColor:_colors.NEUTRAL_300},header:{flexDirection:'row',justifyContent:'space-between',alignItems:'center',paddingHorizontal:20,paddingTop:15,paddingBottom:10},monthText:{fontSize:16,color:_colors.PRIMARY_100},arrow:{fontSize:24,color:_colors.NEUTRAL_400},dayHeader:{flexDirection:'row',justifyContent:'space-between',paddingVertical:16},dayHeaderText:{width:'14.28%',textAlign:'center',color:'NEUTRAL_800'},notCurrentMonthStyle:{color:_colors.NEUTRAL_400},calendarContainer:{height:CALENDAR_HEIGHT,paddingHorizontal:10},dayItem:{width:'14.28%',justifyContent:'center',alignItems:'center',marginVertical:2},dayItemText:{padding:8,marginVertical:2,borderRadius:100,textAlign:'center',width:34,height:34},dayItemTextHover:{backgroundColor:_colors.NEUTRAL_200},todayItemTextHover:{backgroundColor:_colors.TERTIARY_70,borderWidth:1,borderColor:_colors.PRIMARY_100},selectedDayBackground:{backgroundColor:_colors.PRIMARY_100,borderRadius:100,padding:8,height:34,width:34,justifyContent:'center',alignItems:'center'},selectedDayText:{color:'white'},dayText:{color:'black'},currentDayBorder:{borderWidth:1,borderColor:_colors.PRIMARY_100,borderRadius:100,justifyContent:'center',alignItems:'center'},list:{height:CALENDAR_HEIGHT,paddingHorizontal:10,paddingVertical:5},item:{justifyContent:'center',padding:10,margin:2},yearText:{fontSize:16,width:40},selectedItem:{backgroundColor:_colors.TERTIARY_70,borderRadius:8},optionsContainer:{width:'100%',flexDirection:'row',justifyContent:'flex-end',marginTop:12,gap:4,padding:10},modalContentUpwards:{position:'absolute',bottom:70,boxShadow:'0px 0px 5px 0px rgba(0,0,0,0.2)'},disabledButtonStyle:{opacity:0.2}});
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.styles=exports.CALENDAR_HEIGHT=void 0;var _reactNative=require("react-native");var _colors=require("../../styles/colors");var _utilsTypes=require("../../helpers/utilsTypes");var CALENDAR_HEIGHT=exports.CALENDAR_HEIGHT=260;var styles=exports.styles=_reactNative.StyleSheet.create({container:{flex:1},datePickerButton:{borderWidth:1,borderColor:'gray',paddingVertical:_reactNative.Platform.OS===_utilsTypes.AppPlatform.web?8:20,paddingHorizontal:12,borderRadius:4,backgroundColor:'white',flexDirection:'row',justifyContent:'space-between',alignItems:'center'},inputWrapper:{flexDirection:'row',justifyContent:'space-between',alignItems:'center',paddingVertical:_reactNative.Platform.OS===_utilsTypes.AppPlatform.web?8:20,paddingHorizontal:16,backgroundColor:_colors.NEUTRAL_50},invalidDateInputWrapper:{borderColor:_colors.DESTRUCTIVE_100},disabledInput:{opacity:0.2},datePickerInput:{textAlign:'left',fontSize:18,outlineStyle:'none',height:20,flex:1},inputContainerWrapper:{backgroundColor:'transparent',padding:6,height:_reactNative.Platform.OS!==_utilsTypes.AppPlatform.web?63:undefined,borderRadius:8},monthAndYearContainer:{flexDirection:'row',alignItems:'center',gap:8},monthAndYearContent:{flexDirection:'row',marginHorizontal:12,alignItems:'center',gap:8},inputWrapperFocused:{backgroundColor:_colors.QUATERNARY_50},invalidDateWrapperFocused:{backgroundColor:_colors.DESTRUCTIVE_10},calendarIcon:{width:24},modalContainer:{flex:1,justifyContent:'center',alignItems:'center',backgroundColor:'rgba(0,0,0,0.5)'},modalContent:{backgroundColor:_colors.NEUTRAL_50,borderRadius:8,elevation:5,width:_reactNative.Platform.OS===_utilsTypes.AppPlatform.web?'100%':'90%',borderWidth:1,borderColor:_colors.NEUTRAL_300},header:{flexDirection:'row',justifyContent:'space-between',alignItems:'center',paddingHorizontal:20,paddingTop:15,paddingBottom:10},monthText:{fontSize:16,color:_colors.PRIMARY_100},arrow:{fontSize:24,color:_colors.NEUTRAL_400},dayHeader:{flexDirection:'row',justifyContent:'space-between',paddingVertical:16},dayHeaderText:{width:'14.28%',textAlign:'center',color:'NEUTRAL_800'},notCurrentMonthStyle:{color:_colors.NEUTRAL_400},calendarContainer:{height:CALENDAR_HEIGHT,paddingHorizontal:10},dayItem:{width:'14.28%',justifyContent:'center',alignItems:'center',marginVertical:2},dayItemText:{padding:8,marginVertical:2,borderRadius:100,textAlign:'center',width:34,height:34},dayItemTextHover:{backgroundColor:_colors.NEUTRAL_200},todayItemTextHover:{backgroundColor:_colors.TERTIARY_70,borderWidth:1,borderColor:_colors.PRIMARY_100},selectedDayBackground:{backgroundColor:_colors.PRIMARY_100,borderRadius:100,padding:8,height:34,width:34,justifyContent:'center',alignItems:'center'},selectedDayText:{color:'white'},dayText:{color:'black'},currentDayBorder:{borderWidth:1,borderColor:_colors.PRIMARY_100,borderRadius:100,justifyContent:'center',alignItems:'center'},list:{height:CALENDAR_HEIGHT,paddingHorizontal:10,paddingVertical:5},item:{justifyContent:'center',padding:10,margin:2},yearText:{fontSize:16,width:40},selectedItem:{backgroundColor:_colors.TERTIARY_70,borderRadius:8},optionsContainer:{width:'100%',flexDirection:'row',justifyContent:'flex-end',marginTop:12,gap:4,padding:10},modalContentUpwards:{position:'absolute',bottom:70,boxShadow:'0px 0px 5px 0px rgba(0,0,0,0.2)'},disabledButtonStyle:{opacity:0.2}});
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.validateDate=exports.transformDate=exports.parseLocalDateString=exports.isLeapYear=exports.getPlaceholderDateFormat=exports.getDaysInMonth=exports.generateYearList=exports.formatterDate=exports.buildMonth=void 0;var formatterDate=exports.formatterDate=function formatterDate(date,format){if(date!==undefined){var day=date.getDate().toString().padStart(2,'0');var month=(date.getMonth()+1).toString().padStart(2,'0');var year=date.getFullYear();if(format==='MM/DD/YYYY'){return month+"/"+day+"/"+year;}else if(format==='DD/MM/YYYY'){return day+"/"+month+"/"+year;}else{return month+"/"+day+"/"+year;}}return'';};var getPlaceholderDateFormat=exports.getPlaceholderDateFormat=function getPlaceholderDateFormat(dateFormat){return dateFormat==='MM/DD/YYYY'?'MM/DD/YYYY':'DD/MM/YYYY';};var parseLocalDateString=exports.parseLocalDateString=function parseLocalDateString(localDate,dateFormat){var parts=localDate.split('/');var year=parts[2];var month=dateFormat==='MM/DD/YYYY'?parts[0]-1:parts[1]-1;var day=dateFormat==='MM/DD/YYYY'?parts[1]:parts[0];return new Date(year,month,day);};var transformDate=exports.transformDate=function transformDate(dateString){var parts=dateString.split('/');var date=new Date(parts[2],parts[1]-1,parts[0],3,0,0);return date.toISOString();};var generateYearList=exports.generateYearList=function generateYearList(){return Array.from({length:200},function(_,i){return 1900+i;});};var isLeapYear=exports.isLeapYear=function isLeapYear(year){return year%4===0&&year%100!==0||year%400===0;};var getDaysInMonth=exports.getDaysInMonth=function getDaysInMonth(year,month){var daysInMonth=[31,isLeapYear(year)?29:28,31,30,31,30,31,31,30,31,30,31];return daysInMonth[month];};var buildMonth=exports.buildMonth=function buildMonth(year,month){var days=[];var firstDayOfMonth=new Date(year,month,1).getDay();var totalDays=getDaysInMonth(year,month);var previousMonth=month===0?11:month-1;var previousMonthYear=month===0?year-1:year;var previousMonthDays=getDaysInMonth(previousMonthYear,previousMonth);for(var i=firstDayOfMonth;i>0;i--){days.unshift(new Date(previousMonthYear,previousMonth,previousMonthDays-i+1));}for(var _day=1;_day<=totalDays;_day++){days.push(new Date(year,month,_day));}var nextMonth=month===11?0:month+1;var nextMonthYear=month===11?year+1:year;var day=1;while(days.length%7!==0){days.push(new Date(nextMonthYear,nextMonth,day++));}return days;};var validateDate=exports.validateDate=function validateDate(dateObject,text,format){if(isNaN(dateObject.getTime())||dateObject.getFullYear()<1000||dateObject.getFullYear()>9999){return false;}var parts=text.split('/');var day,month;if(format==='DD/MM/YYYY'){day=parseInt(parts[0],10);month=parseInt(parts[1],10);}else{day=parseInt(parts[1],10);month=parseInt(parts[0],10);}if(month<1||month>12||day<1||day>31){return false;}if((month===4||month===6||month===9||month===11)&&day>30){return false;}if(month===2){var isLeap=dateObject.getFullYear()%4===0&&(dateObject.getFullYear()%100!==0||dateObject.getFullYear()%400===0);if(day>(isLeap?29:28)){return false;}}return true;};
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.validateDate=exports.transformDate=exports.parseLocalDateString=exports.isLeapYear=exports.getPlaceholderDateFormat=exports.getDaysInMonth=exports.generateYearList=exports.formatterDate=exports.buildMonth=void 0;var formatterDate=exports.formatterDate=function formatterDate(date,format){if(date!==undefined){var day=date.getDate().toString().padStart(2,'0');var month=(date.getMonth()+1).toString().padStart(2,'0');var year=date.getFullYear();if(format==='MM/DD/YYYY'){return month+"/"+day+"/"+year;}else if(format==='DD/MM/YYYY'){return day+"/"+month+"/"+year;}else{return month+"/"+day+"/"+year;}}return'';};var getPlaceholderDateFormat=exports.getPlaceholderDateFormat=function getPlaceholderDateFormat(dateFormat){return dateFormat==='MM/DD/YYYY'?'MM/DD/YYYY':'DD/MM/YYYY';};var parseLocalDateString=exports.parseLocalDateString=function parseLocalDateString(localDate,dateFormat){var parts=localDate.split('/');var year=parts[2];var month=dateFormat==='MM/DD/YYYY'?parts[0]-1:parts[1]-1;var day=dateFormat==='MM/DD/YYYY'?parts[1]:parts[0];return new Date(year,month,day);};var transformDate=exports.transformDate=function transformDate(dateString){var parts=dateString.split('/');var date=new Date(parts[2],parts[1]-1,parts[0],3,0,0);return date.toISOString();};var generateYearList=exports.generateYearList=function generateYearList(){return Array.from({length:200},function(_,i){return 1900+i;});};var isLeapYear=exports.isLeapYear=function isLeapYear(year){return year%4===0&&year%100!==0||year%400===0;};var getDaysInMonth=exports.getDaysInMonth=function getDaysInMonth(year,month){var daysInMonth=[31,isLeapYear(year)?29:28,31,30,31,30,31,31,30,31,30,31];return daysInMonth[month];};var buildMonth=exports.buildMonth=function buildMonth(year,month){var days=[];var firstDayOfMonth=new Date(year,month,1).getDay();var totalDays=getDaysInMonth(year,month);var previousMonth=month===0?11:month-1;var previousMonthYear=month===0?year-1:year;var previousMonthDays=getDaysInMonth(previousMonthYear,previousMonth);for(var i=firstDayOfMonth;i>0;i--){days.push(new Date(previousMonthYear,previousMonth,previousMonthDays-i+1));}for(var _day=1;_day<=totalDays;_day++){days.push(new Date(year,month,_day));}var nextMonth=month===11?0:month+1;var nextMonthYear=month===11?year+1:year;var day=1;while(days.length%7!==0){days.push(new Date(nextMonthYear,nextMonth,day++));}return days;};var validateDate=exports.validateDate=function validateDate(dateObject,text,format){if(isNaN(dateObject.getTime())||dateObject.getFullYear()<1000||dateObject.getFullYear()>9999){return false;}var parts=text.split('/');var day,month;if(format==='DD/MM/YYYY'){day=parseInt(parts[0],10);month=parseInt(parts[1],10);}else{day=parseInt(parts[1],10);month=parseInt(parts[0],10);}if(month<1||month>12||day<1||day>31){return false;}if((month===4||month===6||month===9||month===11)&&day>30){return false;}if(month===2){var isLeap=dateObject.getFullYear()%4===0&&(dateObject.getFullYear()%100!==0||dateObject.getFullYear()%400===0);if(day>(isLeap?29:28)){return false;}}return true;};
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _Input=require("../Input.style");var _Input2=require("../Input.types");var _ShowPasswordIcon=require("../../../assets/images/icons/ShowPasswordIcon");var _HidePasswordIcon=require("../../../assets/images/icons/HidePasswordIcon");var _InputOptions=_interopRequireDefault(require("./InputOptions"));var _DatePicker=_interopRequireDefault(require("../../datepicker/DatePicker"));var _colors=require("../../../styles/colors");var _table_utils=require("../../../helpers/table_utils");var _this=this,_jsxFileName="/home/jenkins/agent/workspace/etendo_ui_library_develop/etendo_ui_library/src/components/input/components/InputField.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var InputField=function InputField(_ref){var type=_ref.type,configField=_ref.configField,styleField=_ref.styleField,value=_ref.value,disabled=_ref.disabled,placeholder=_ref.placeholder,placeholderPickerSearch=_ref.placeholderPickerSearch,maxLength=_ref.maxLength,keyboardType=_ref.keyboardType,dataPicker=_ref.dataPicker,displayKey=_ref.displayKey,showSearchInPicker=_ref.showSearchInPicker,_ref$backgroundColor=_ref.backgroundColor,backgroundColor=_ref$backgroundColor===void 0?_colors.NEUTRAL_0:_ref$backgroundColor,showOptionsAmount=_ref.showOptionsAmount,_ref$height=_ref.height,height=_ref$height===void 0?40:_ref$height,onPress=_ref.onPress,onSubmit=_ref.onSubmit,onChangeText=_ref.onChangeText,onOptionSelected=_ref.onOptionSelected,onFocus=_ref.onFocus,onBlur=_ref.onBlur,language=_ref.language,dateFormat=_ref.dateFormat,showCalendar=_ref.showCalendar;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isFocus=_useState2[0],setIsFocus=_useState2[1];var _useState3=(0,_react.useState)(true),_useState4=(0,_slicedToArray2.default)(_useState3,2),showPassword=_useState4[0],setShowPassword=_useState4[1];var _useState5=(0,_react.useState)(false),_useState6=(0,_slicedToArray2.default)(_useState5,2),showOptions=_useState6[0],setShowOptions=_useState6[1];var _useState7=(0,_react.useState)([]),_useState8=(0,_slicedToArray2.default)(_useState7,2),dataOptionsFilter=_useState8[0],setDataOptionsFilter=_useState8[1];var _useState9=(0,_react.useState)(''),_useState10=(0,_slicedToArray2.default)(_useState9,2),filterValue=_useState10[0],setFilterValue=_useState10[1];var _useState11=(0,_react.useState)(false),_useState12=(0,_slicedToArray2.default)(_useState11,2),optionsTop=_useState12[0],setOptionsTop=_useState12[1];var _useState13=(0,_react.useState)({top:0,left:0,width:0,height:0}),_useState14=(0,_slicedToArray2.default)(_useState13,2),positionModal=_useState14[0],setPositionModal=_useState14[1];var windowHeight=_reactNative.Dimensions.get('window').height;var refComponent=(0,_react.useRef)(null);var regex=/^[0-9.,]+$/g;if(configField!=null&&configField.isDatePicker){return _react.default.createElement(_DatePicker.default,{dateFormat:dateFormat,language:language,styleField:styleField,onChangeText:onChangeText,value:value,showCalendar:showCalendar,disabled:disabled,__self:_this,__source:{fileName:_jsxFileName,lineNumber:72,columnNumber:7}});}var getStyleText=function getStyleText(){var style=[];if(value){style.push(styleField.textDefault);}else{style.push(styleField.textPlaceholder);}return style;};(0,_react.useEffect)(function(){if(dataPicker){setDataOptionsFilter(dataPicker);}},[dataPicker]);(0,_react.useEffect)(function(){if(showOptions){getTopLeft();}},[]);var getTopLeft=function getTopLeft(){if(refComponent.current){refComponent.current.measure(function(x,y,width,height,pageX,pageY){var calcDropdownTopLeft=pageY+height+_Input.styles.spaceInOptionsAndInput.height;var showFilterHeight=showSearchInPicker?_Input.styles.optionFilterContainer.height:0;var optionsHeight=_Input.styles.optionContainer.height+_Input.styles.optionContainer.marginTop+showFilterHeight+_Input.styles.optionContainer.marginTop+_Input.styles.optionsContainer.borderWidth*2;var topPosition,bottomPosition;if(optionsHeight+calcDropdownTopLeft+_Input.styles.offSet.height>windowHeight){topPosition=pageY-optionsHeight;setOptionsTop(true);}else{topPosition=calcDropdownTopLeft;setOptionsTop(false);}bottomPosition=windowHeight-(topPosition+optionsHeight);setPositionModal({top:topPosition,bottom:bottomPosition,left:pageX,width:width,height:height});});}};var handleOnChangeFilterText=function handleOnChangeFilterText(filterText){setFilterValue(filterText);if(displayKey)setDataOptionsFilter(dataPicker.filter(function(item){return item[displayKey].toLocaleLowerCase().includes(filterText.toLocaleLowerCase());}));};var handleOnClose=function handleOnClose(){setShowOptions(false);setDataOptionsFilter(dataPicker);setFilterValue('');};var getKeyboardType=function getKeyboardType(keyboardType){if(keyboardType==='number'){return'numeric';}return'default';};var getOnChangeText=function getOnChangeText(text){if(onChangeText){if(keyboardType==='number'){if(text.match(regex)||(text==null?void 0:text.length)===0){onChangeText(text);}return;}onChangeText(text);}};var getFocusStyle=function getFocusStyle(){var style=[];if(!isFocus){style.push({borderColor:'transparent'});}return style;};var removePaddingField=function removePaddingField(){var style={};if(configField!=null&&configField.image){style={paddingRight:0};}return style;};var onPressFocus=function onPressFocus(event){onFocus(event);setIsFocus(true);};var onPressBlur=function onPressBlur(event){onBlur(event);setIsFocus(false);};var getImage=function getImage(image){var fillValue=disabled?_colors.NEUTRAL_400:undefined;if(type===_Input2.InputFieldVariant.TextInputPassword){var PasswordComponent=showPassword?_HidePasswordIcon.HidePasswordIcon:_ShowPasswordIcon.ShowPasswordIcon;return _react.default.createElement(PasswordComponent,{style:_Input.styles.inputImageSize,fill:fillValue,__self:_this,__source:{fileName:_jsxFileName,lineNumber:227,columnNumber:9}});}return _react.default.cloneElement(image,{fill:fillValue});};var handlePressImage=function handlePressImage(){if(type===_Input2.InputFieldVariant.TextInputPassword){setShowPassword(function(prevState){return!prevState;});}else{onSubmit==null?void 0:onSubmit();}};var handleOnPress=function handleOnPress(event){if(type===_Input2.InputFieldVariant.Picker){getTopLeft();setShowOptions(true);}if(onPress){onPress(event);}};var getText=function getText(){if(value){return value;}return placeholder;};var isAreaDisabled=function isAreaDisabled(){return disabled||configField.disabledSubmit||!onSubmit&&type!==_Input2.InputFieldVariant.TextInputPassword;};return _react.default.createElement(_reactNative.View,{style:[styleField.focus,getFocusStyle()],__self:_this,__source:{fileName:_jsxFileName,lineNumber:267,columnNumber:5}},_react.default.createElement(_reactNative.TouchableOpacity,{ref:refComponent,style:[styleField.field,removePaddingField(),{backgroundColor:backgroundColor},{height:height}],disabled:disabled||configField.disabledField,onPress:handleOnPress,__self:_this,__source:{fileName:_jsxFileName,lineNumber:268,columnNumber:7}},(configField==null?void 0:configField.type)===_Input2.InputFieldVariant.TextInput&&_react.default.createElement(_reactNative.TextInput,{editable:!disabled||!configField.disabledField,focusable:!disabled||!configField.disabledField,onBlur:onPressBlur,onFocus:onPressFocus,value:value,keyboardType:getKeyboardType(keyboardType),onChangeText:getOnChangeText,style:[getStyleText(),(0,_table_utils.disableOutline)(),styleField.textDefault],placeholder:placeholder,placeholderTextColor:_colors.NEUTRAL_600,maxLength:maxLength,secureTextEntry:type===_Input2.InputFieldVariant.TextInputPassword&&showPassword,onSubmitEditing:function onSubmitEditing(){return onSubmit==null?void 0:onSubmit();},__self:_this,__source:{fileName:_jsxFileName,lineNumber:279,columnNumber:11}}),(configField==null?void 0:configField.type)==='text'&&_react.default.createElement(_reactNative.Text,{numberOfLines:1,ellipsizeMode:"tail",style:[getStyleText(),(0,_table_utils.disableOutline)(),styleField.textDefault],__self:_this,__source:{fileName:_jsxFileName,lineNumber:298,columnNumber:11}},getText()),(configField==null?void 0:configField.image)&&_react.default.createElement(_reactNative.TouchableOpacity,{onPress:handlePressImage,style:_Input.styles.buttonContainerInputField,disabled:isAreaDisabled(),__self:_this,__source:{fileName:_jsxFileName,lineNumber:306,columnNumber:11}},getImage(configField.image)),_react.default.createElement(_InputOptions.default,{optionsTop:optionsTop,showOptionsAmount:showOptionsAmount,onOptionSelected:onOptionSelected,showOptions:showOptions,positionModal:positionModal,data:dataOptionsFilter,onClose:handleOnClose,onChangeFilterText:handleOnChangeFilterText,filterValue:filterValue,displayKey:displayKey,showSearchInPicker:showSearchInPicker,placeholderPickerSearch:placeholderPickerSearch,dataPicker:dataPicker,__self:_this,__source:{fileName:_jsxFileName,lineNumber:313,columnNumber:9}})));};var _default=exports.default=InputField;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _Input=require("../Input.style");var _Input2=require("../Input.types");var _ShowPasswordIcon=require("../../../assets/images/icons/ShowPasswordIcon");var _HidePasswordIcon=require("../../../assets/images/icons/HidePasswordIcon");var _InputOptions=_interopRequireDefault(require("./InputOptions"));var _DatePicker=_interopRequireDefault(require("../../datepicker/DatePicker"));var _colors=require("../../../styles/colors");var _table_utils=require("../../../helpers/table_utils");var _this=this,_jsxFileName="/home/jenkins/agent/workspace/etendo_ui_library_develop/etendo_ui_library/src/components/input/components/InputField.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var InputField=function InputField(_ref){var type=_ref.type,configField=_ref.configField,styleField=_ref.styleField,value=_ref.value,disabled=_ref.disabled,placeholder=_ref.placeholder,placeholderPickerSearch=_ref.placeholderPickerSearch,maxLength=_ref.maxLength,keyboardType=_ref.keyboardType,dataPicker=_ref.dataPicker,displayKey=_ref.displayKey,showSearchInPicker=_ref.showSearchInPicker,_ref$backgroundColor=_ref.backgroundColor,backgroundColor=_ref$backgroundColor===void 0?_colors.NEUTRAL_0:_ref$backgroundColor,showOptionsAmount=_ref.showOptionsAmount,_ref$height=_ref.height,height=_ref$height===void 0?40:_ref$height,onPress=_ref.onPress,onSubmit=_ref.onSubmit,onChangeText=_ref.onChangeText,onOptionSelected=_ref.onOptionSelected,onFocus=_ref.onFocus,onBlur=_ref.onBlur,language=_ref.language,dateFormat=_ref.dateFormat,showCalendar=_ref.showCalendar;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isFocus=_useState2[0],setIsFocus=_useState2[1];var _useState3=(0,_react.useState)(true),_useState4=(0,_slicedToArray2.default)(_useState3,2),showPassword=_useState4[0],setShowPassword=_useState4[1];var _useState5=(0,_react.useState)(false),_useState6=(0,_slicedToArray2.default)(_useState5,2),showOptions=_useState6[0],setShowOptions=_useState6[1];var _useState7=(0,_react.useState)([]),_useState8=(0,_slicedToArray2.default)(_useState7,2),dataOptionsFilter=_useState8[0],setDataOptionsFilter=_useState8[1];var _useState9=(0,_react.useState)(''),_useState10=(0,_slicedToArray2.default)(_useState9,2),filterValue=_useState10[0],setFilterValue=_useState10[1];var _useState11=(0,_react.useState)(false),_useState12=(0,_slicedToArray2.default)(_useState11,2),optionsTop=_useState12[0],setOptionsTop=_useState12[1];var _useState13=(0,_react.useState)({top:0,left:0,width:0,height:0}),_useState14=(0,_slicedToArray2.default)(_useState13,2),positionModal=_useState14[0],setPositionModal=_useState14[1];var windowHeight=_reactNative.Dimensions.get('window').height;var refComponent=(0,_react.useRef)(null);var regex=/^[0-9.,]+$/g;var getStyleText=function getStyleText(){var style=[];if(value){style.push(styleField.textDefault);}else{style.push(styleField.textPlaceholder);}return style;};(0,_react.useEffect)(function(){if(showOptions){getTopLeft();}},[]);var getTopLeft=function getTopLeft(){if(refComponent.current){refComponent.current.measure(function(x,y,width,height,pageX,pageY){var calcDropdownTopLeft=pageY+height+_Input.styles.spaceInOptionsAndInput.height;var showFilterHeight=showSearchInPicker?_Input.styles.optionFilterContainer.height:0;var optionsHeight=_Input.styles.optionContainer.height+_Input.styles.optionContainer.marginTop+showFilterHeight+_Input.styles.optionContainer.marginTop+_Input.styles.optionsContainer.borderWidth*2;var topPosition,bottomPosition;if(optionsHeight+calcDropdownTopLeft+_Input.styles.offSet.height>windowHeight){topPosition=pageY-optionsHeight;setOptionsTop(true);}else{topPosition=calcDropdownTopLeft;setOptionsTop(false);}bottomPosition=windowHeight-(topPosition+optionsHeight);setPositionModal({top:topPosition,bottom:bottomPosition,left:pageX,width:width,height:height});});}};var handleOnChangeFilterText=function handleOnChangeFilterText(filterText){setFilterValue(filterText);if(displayKey)setDataOptionsFilter(dataPicker.filter(function(item){return item[displayKey].toLocaleLowerCase().includes(filterText.toLocaleLowerCase());}));};var handleOnClose=function handleOnClose(){setShowOptions(false);setDataOptionsFilter(dataPicker);setFilterValue('');};var getKeyboardType=function getKeyboardType(keyboardType){if(keyboardType==='number'){return'numeric';}return'default';};var getOnChangeText=function getOnChangeText(text){if(onChangeText){if(keyboardType==='number'){if(text.match(regex)||(text==null?void 0:text.length)===0){onChangeText(text);}return;}onChangeText(text);}};var getFocusStyle=function getFocusStyle(){var style=[];if(!isFocus){style.push({borderColor:'transparent'});}return style;};var removePaddingField=function removePaddingField(){var style={};if(configField!=null&&configField.image){style={paddingRight:0};}return style;};var onPressFocus=function onPressFocus(event){onFocus(event);setIsFocus(true);};var onPressBlur=function onPressBlur(event){onBlur(event);setIsFocus(false);};var getImage=function getImage(image){var fillValue=disabled?_colors.NEUTRAL_400:undefined;if(type===_Input2.InputFieldVariant.TextInputPassword){var PasswordComponent=showPassword?_HidePasswordIcon.HidePasswordIcon:_ShowPasswordIcon.ShowPasswordIcon;return _react.default.createElement(PasswordComponent,{style:_Input.styles.inputImageSize,fill:fillValue,__self:_this,__source:{fileName:_jsxFileName,lineNumber:207,columnNumber:9}});}return _react.default.cloneElement(image,{fill:fillValue});};var handlePressImage=function handlePressImage(){if(type===_Input2.InputFieldVariant.TextInputPassword){setShowPassword(function(prevState){return!prevState;});}else{onSubmit==null?void 0:onSubmit();}};var handleOnPress=function handleOnPress(event){if(type===_Input2.InputFieldVariant.Picker){getTopLeft();setShowOptions(true);}if(onPress){onPress(event);}};var getText=function getText(){if(value){return value;}return placeholder;};var isAreaDisabled=function isAreaDisabled(){return disabled||configField.disabledSubmit||!onSubmit&&type!==_Input2.InputFieldVariant.TextInputPassword;};return _react.default.createElement(_reactNative.View,{style:[styleField.focus,getFocusStyle()],__self:_this,__source:{fileName:_jsxFileName,lineNumber:247,columnNumber:5}},configField!=null&&configField.isDatePicker?_react.default.createElement(_DatePicker.default,{dateFormat:dateFormat,language:language,styleField:styleField,onChangeText:onChangeText,value:value,showCalendar:showCalendar,disabled:disabled,__self:_this,__source:{fileName:_jsxFileName,lineNumber:249,columnNumber:9}}):_react.default.createElement(_reactNative.TouchableOpacity,{ref:refComponent,style:[styleField.field,removePaddingField(),{backgroundColor:backgroundColor},{height:height}],disabled:disabled||configField.disabledField,onPress:handleOnPress,__self:_this,__source:{fileName:_jsxFileName,lineNumber:259,columnNumber:9}},(configField==null?void 0:configField.type)===_Input2.InputFieldVariant.TextInput&&_react.default.createElement(_reactNative.TextInput,{editable:!disabled||!configField.disabledField,focusable:!disabled||!configField.disabledField,onBlur:onPressBlur,onFocus:onPressFocus,value:value,keyboardType:getKeyboardType(keyboardType),onChangeText:getOnChangeText,style:[getStyleText(),(0,_table_utils.disableOutline)(),styleField.textDefault],placeholder:placeholder,placeholderTextColor:_colors.NEUTRAL_600,maxLength:maxLength,secureTextEntry:type===_Input2.InputFieldVariant.TextInputPassword&&showPassword,onSubmitEditing:function onSubmitEditing(){return onSubmit==null?void 0:onSubmit();},__self:_this,__source:{fileName:_jsxFileName,lineNumber:270,columnNumber:13}}),(configField==null?void 0:configField.type)==='text'&&_react.default.createElement(_reactNative.Text,{numberOfLines:1,ellipsizeMode:"tail",style:[getStyleText(),(0,_table_utils.disableOutline)(),styleField.textDefault],__self:_this,__source:{fileName:_jsxFileName,lineNumber:289,columnNumber:13}},getText()),(configField==null?void 0:configField.image)&&_react.default.createElement(_reactNative.TouchableOpacity,{onPress:handlePressImage,style:_Input.styles.buttonContainerInputField,disabled:isAreaDisabled(),__self:_this,__source:{fileName:_jsxFileName,lineNumber:301,columnNumber:13}},getImage(configField.image)),_react.default.createElement(_InputOptions.default,{optionsTop:optionsTop,showOptionsAmount:showOptionsAmount,onOptionSelected:onOptionSelected,showOptions:showOptions,positionModal:positionModal,data:dataOptionsFilter,onClose:handleOnClose,onChangeFilterText:handleOnChangeFilterText,filterValue:filterValue,displayKey:displayKey,showSearchInPicker:showSearchInPicker,placeholderPickerSearch:placeholderPickerSearch,dataPicker:dataPicker,__self:_this,__source:{fileName:_jsxFileName,lineNumber:308,columnNumber:11}})));};var _default=exports.default=InputField;
@@ -33,6 +33,7 @@ export declare const styles: {
33
33
  fontSize: number;
34
34
  outlineStyle: string;
35
35
  height: number;
36
+ flex: number;
36
37
  };
37
38
  inputContainerWrapper: {
38
39
  backgroundColor: string;
@@ -39,7 +39,8 @@ export var styles = StyleSheet.create({
39
39
  textAlign: 'left',
40
40
  fontSize: 18,
41
41
  outlineStyle: 'none',
42
- height: 20
42
+ height: 20,
43
+ flex: 1
43
44
  },
44
45
  inputContainerWrapper: {
45
46
  backgroundColor: 'transparent',
@@ -69,7 +69,7 @@ export var buildMonth = function buildMonth(year, month) {
69
69
 
70
70
  // Fill days from previous month
71
71
  for (var i = firstDayOfMonth; i > 0; i--) {
72
- days.unshift(new Date(previousMonthYear, previousMonth, previousMonthDays - i + 1));
72
+ days.push(new Date(previousMonthYear, previousMonth, previousMonthDays - i + 1));
73
73
  }
74
74
 
75
75
  // Add days of current month
@@ -77,17 +77,6 @@ var InputField = function InputField(_ref) {
77
77
  var windowHeight = Dimensions.get('window').height;
78
78
  var refComponent = useRef(null);
79
79
  var regex = /^[0-9.,]+$/g;
80
- if (configField !== null && configField !== void 0 && configField.isDatePicker) {
81
- return /*#__PURE__*/React.createElement(DatePicker, {
82
- dateFormat: dateFormat,
83
- language: language,
84
- styleField: styleField,
85
- onChangeText: onChangeText,
86
- value: value,
87
- showCalendar: showCalendar,
88
- disabled: disabled
89
- });
90
- }
91
80
  var getStyleText = function getStyleText() {
92
81
  var style = [];
93
82
  if (value) {
@@ -97,11 +86,6 @@ var InputField = function InputField(_ref) {
97
86
  }
98
87
  return style;
99
88
  };
100
- useEffect(function () {
101
- if (dataPicker) {
102
- setDataOptionsFilter(dataPicker);
103
- }
104
- }, [dataPicker]);
105
89
  useEffect(function () {
106
90
  if (showOptions) {
107
91
  getTopLeft();
@@ -228,7 +212,15 @@ var InputField = function InputField(_ref) {
228
212
  };
229
213
  return /*#__PURE__*/React.createElement(View, {
230
214
  style: [styleField.focus, getFocusStyle()]
231
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
215
+ }, configField !== null && configField !== void 0 && configField.isDatePicker ? /*#__PURE__*/React.createElement(DatePicker, {
216
+ dateFormat: dateFormat,
217
+ language: language,
218
+ styleField: styleField,
219
+ onChangeText: onChangeText,
220
+ value: value,
221
+ showCalendar: showCalendar,
222
+ disabled: disabled
223
+ }) : /*#__PURE__*/React.createElement(TouchableOpacity, {
232
224
  ref: refComponent,
233
225
  style: [styleField.field, removePaddingField(), {
234
226
  backgroundColor: backgroundColor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "etendo-ui-library",
3
- "version": "1.3.10",
3
+ "version": "1.3.12",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "android": "react-native run-android",