function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }

/*
export function handleYearClick(year,onSelectMonth) {
    onSelectMonth && onSelectMonth(year);
}
export function handleYearClick(year,onSelectYear) {
    onSelectYear && onSelectYear(year);
}
export function handleUpdateLocalYear(viewedYear){
    viewedYear = parseInt(viewedYear) || 0;
    setTimeout(() => {
      this.setState({ localYear: viewedYear });
    }, 150);
}

export function getYearDetails(yearLength) {
    const dateObj = new Date();
    const year = dateObj.getFullYear();
  
    if (yearLength === 2) {
      return {
        startPoint: 0,
        endPoint: 49,
        currentYear: year
      };
    }
  
    return {
      startPoint: 2000,
      endPoint: 2050,
      currentYear: year
    };
  }
  
const monthNamesData = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec'
];

function getYears() {
const years = [];
const { startPoint, endPoint } = getYearDetails();

for (let i = startPoint; i <= endPoint; i++) {
    years.push(i);
}

return years;
}
export default (props)=>{
    let {onSelectMonth,onSelectYear,viewedYear}=props
    let [localYear,updateLocalYear]=React.useState(0)
    useEffect(() => {
        viewedYear = parseInt(viewedYear) || 0;

        let { viewedYear: oldViewedYear } = prevProps;
        oldViewedYear = parseInt(oldViewedYear) || 0;

        if (viewedYear !== oldViewedYear) {
        //this.handleScrollToYear(this.props);
        handleUpdateLocalYear(viewedYear);
        updateLocalYear(viewedYear)
        }
    },[localYear]);
    let renderProps = {
        getPublicMethod:this.getPublicMethods,
        handleYearClick:(e,year)=>handleYearClick(year,onSelectYear),
        handleMonthClick:(e,month)=>handleMonthClick(month,onSelectMonth),
        localYear,
        monthNamesData,
        years:()=>(getYears())
    };
    let { renderComponent, ...basicProps} = props;
    return <SkeletonThemeWrapper basicProps={basicProps} renderProps={renderProps} component={renderComponent} />;
}

*/
import React from "react";
import YearviewBehaviour from "./Yearview.behaviour";
import YearviewSkeleton from "./Yearview.skeleton";
import YearviewPropTypes, { defaultProps, propsDescription } from "./Yearview.propTypes";
import componentGroups from "../../../docs-utils/componentGroups";
import componentCategories from "../../../docs-utils/componentCategories"; //import constantProps from "./Yearview.constantProps";

export default function Yearview(props) {
  return /*#__PURE__*/React.createElement(YearviewBehaviour, _extends({}, props, {
    renderComponent: YearviewSkeleton
  }));
}
Yearview.propTypes = YearviewPropTypes;
Yearview.defaultProps = defaultProps;
Yearview.propsDescription = propsDescription; //Yearview.constantProps=constantProps;

if (false) {
  Yearview.docs = {
    componentGroup: componentGroups.Components,
    folderName: componentCategories.UCL
  };
}