Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tailwind-datepicker-react

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwind-datepicker-react - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

2

dist/Components/DatePicker.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _tailwindMerge=require("tailwind-merge");var _options=_interopRequireDefault(require("../Options"));var _datePickerPopup=_interopRequireDefault(require("./DatePickerPopup"));var _datePickerProvider=_interopRequireWildcard(require("./DatePickerProvider"));function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_defineProperty(target,key,source[key])})}return target}var DatePicker=function(param){var children=param.children,options=param.options,onChange=param.onChange,classNames=param.classNames,show=param.show,setShow=param.setShow,selectedDateState=param.selectedDateState;return _react.default.createElement("div",{className:(0,_tailwindMerge.twMerge)("w-full",classNames)},_react.default.createElement(_datePickerProvider.default,{options:options,onChange:onChange,show:show,setShow:setShow,selectedDateState:selectedDateState},_react.default.createElement(DatePickerMain,{options:options},children)))};var DatePickerMain=function(param){var customOptions=param.options,children=param.children;var options=_objectSpread({},_options.default,customOptions);var ref=(0,_react.useContext)(_datePickerProvider.DatePickerContext),setShow=ref.setShow,show=ref.show;var InputRef=(0,_react.useRef)(null);var DatePickerRef=(0,_react.useRef)(null);(0,_react.useEffect)(function(){var handleClickOutside=function(event){if(!((InputRef===null||InputRef===void 0?void 0:InputRef.current)&&(DatePickerRef===null||DatePickerRef===void 0?void 0:DatePickerRef.current)))return;if(!InputRef.current.contains(event.target)&&!DatePickerRef.current.contains(event.target)){setShow(false)}};document.addEventListener("mousedown",function(event){return handleClickOutside(event)});return function(){document.removeEventListener("mousedown",function(event){return handleClickOutside(event)})}},[DatePickerRef,InputRef,setShow]);return _react.default.createElement(_react.default.Fragment,null,children?children:_react.default.createElement("div",{className:"relative"},_react.default.createElement("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},_react.default.createElement(CalendarIcon,null)),_react.default.createElement(Input,{ref:InputRef,nameProp:options===null||options===void 0?void 0:options.inputNameProp})),show&&_react.default.createElement(_datePickerPopup.default,{ref:DatePickerRef}))};var Input=(0,_react.forwardRef)(function(props,ref){var _$ref;var _$ref1=(0,_react.useContext)(_datePickerProvider.DatePickerContext),setShow=_$ref1.setShow,selectedDate=_$ref1.selectedDate,showSelectedDate=_$ref1.showSelectedDate,options=_$ref1.options,getFormattedDate=_$ref1.getFormattedDate;return _react.default.createElement("input",{ref:ref,type:"text",name:props.nameProp||"date",id:"date",className:(0,_tailwindMerge.twMerge)("pl-9 pr-2.5 py-2.5 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",options===null||options===void 0?void 0:(_$ref=options.theme)===null||_$ref===void 0?void 0:_$ref.input),placeholder:"Select Date",value:selectedDate&&showSelectedDate?getFormattedDate(selectedDate):"",onFocus:function(){return setShow(true)},readOnly:true})});Input.displayName="Input";var CalendarIcon=function(){var ref;var options=(0,_react.useContext)(_datePickerProvider.DatePickerContext).options;return _react.default.createElement("svg",{"aria-hidden":"true",className:(0,_tailwindMerge.twMerge)("w-5 h-5 text-gray-500 dark:text-gray-400",options===null||options===void 0?void 0:(ref=options.theme)===null||ref===void 0?void 0:ref.inputIcon),fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},_react.default.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))};var _default=DatePicker;
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _tailwindMerge=require("tailwind-merge");var _options=_interopRequireDefault(require("../Options"));var _datePickerPopup=_interopRequireDefault(require("./DatePickerPopup"));var _datePickerProvider=_interopRequireWildcard(require("./DatePickerProvider"));function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_defineProperty(target,key,source[key])})}return target}var DatePicker=function(param){var children=param.children,options=param.options,onChange=param.onChange,classNames=param.classNames,show=param.show,setShow=param.setShow,selectedDateState=param.selectedDateState;return _react.default.createElement("div",{className:(0,_tailwindMerge.twMerge)("w-full",classNames)},_react.default.createElement(_datePickerProvider.default,{options:options,onChange:onChange,show:show,setShow:setShow,selectedDateState:selectedDateState},_react.default.createElement(DatePickerMain,{options:options},children)))};var DatePickerMain=function(param){var customOptions=param.options,children=param.children;var options=_objectSpread({},_options.default,customOptions);var ref=(0,_react.useContext)(_datePickerProvider.DatePickerContext),setShow=ref.setShow,show=ref.show;var InputRef=(0,_react.useRef)(null);var DatePickerRef=(0,_react.useRef)(null);(0,_react.useEffect)(function(){var handleClickOutside=function(event){if(!((InputRef===null||InputRef===void 0?void 0:InputRef.current)&&(DatePickerRef===null||DatePickerRef===void 0?void 0:DatePickerRef.current)))return;if(!InputRef.current.contains(event.target)&&!DatePickerRef.current.contains(event.target)){setShow(false)}};document.addEventListener("mousedown",function(event){return handleClickOutside(event)});return function(){document.removeEventListener("mousedown",function(event){return handleClickOutside(event)})}},[DatePickerRef,InputRef,setShow]);return _react.default.createElement(_react.default.Fragment,null,children?children:_react.default.createElement("div",{className:"relative"},_react.default.createElement("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},_react.default.createElement(CalendarIcon,null)),_react.default.createElement(Input,{ref:InputRef,idProp:options===null||options===void 0?void 0:options.inputIdProp,nameProp:options===null||options===void 0?void 0:options.inputNameProp,placeholderProp:options===null||options===void 0?void 0:options.inputPlaceholderProp,dateFormat:options===null||options===void 0?void 0:options.inputDateFormatProp})),show&&_react.default.createElement(_datePickerPopup.default,{ref:DatePickerRef}))};var Input=(0,_react.forwardRef)(function(props,ref){var _$ref;var _$ref1=(0,_react.useContext)(_datePickerProvider.DatePickerContext),setShow=_$ref1.setShow,selectedDate=_$ref1.selectedDate,showSelectedDate=_$ref1.showSelectedDate,options=_$ref1.options,getFormattedDate=_$ref1.getFormattedDate;var nameProp=props.nameProp||"date";var idProp=props.idProp||nameProp;var placeholderProp=props.placeholderProp||"Select Date";var format=props.dateFormat||null;return _react.default.createElement("input",{ref:ref,type:"text",name:nameProp,id:idProp,className:(0,_tailwindMerge.twMerge)("pl-9 pr-2.5 py-2.5 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",options===null||options===void 0?void 0:(_$ref=options.theme)===null||_$ref===void 0?void 0:_$ref.input),placeholder:placeholderProp,value:selectedDate&&showSelectedDate?getFormattedDate(selectedDate,format):"",onFocus:function(){return setShow(true)},readOnly:true})});Input.displayName="Input";var CalendarIcon=function(){var ref;var options=(0,_react.useContext)(_datePickerProvider.DatePickerContext).options;return _react.default.createElement("svg",{"aria-hidden":"true",className:(0,_tailwindMerge.twMerge)("w-5 h-5 text-gray-500 dark:text-gray-400",options===null||options===void 0?void 0:(ref=options.theme)===null||ref===void 0?void 0:ref.inputIcon),fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},_react.default.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))};var _default=DatePicker;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _tailwindMerge=require("tailwind-merge");var _date=require("../Utils/date");var _buttons=require("./Buttons");var _datePickerProvider=require("./DatePickerProvider");var _days=_interopRequireDefault(require("./Views/Days"));var _decades=_interopRequireDefault(require("./Views/Decades"));var _months=_interopRequireDefault(require("./Views/Months"));var _years=_interopRequireDefault(require("./Views/Years"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}var DatePickerPopup=(0,_react.forwardRef)(function(_props,ref){var _$ref,_$ref1;var _$ref2=(0,_react.useContext)(_datePickerProvider.DatePickerContext),selectedMonth=_$ref2.selectedMonth,selectedYear=_$ref2.selectedYear,view=_$ref2.view,options=_$ref2.options;var firstOfMonth=(0,_date.firstDateOfMonth)(selectedYear,selectedMonth,1);var start=(0,_date.dayOfTheWeekOf)(firstOfMonth,1,1);return _react.default.createElement("div",{ref:ref,className:(0,_tailwindMerge.twMerge)("absolute z-50 block pt-2 top-10",options===null||options===void 0?void 0:options.datepickerClassNames)},_react.default.createElement("div",{className:(0,_tailwindMerge.twMerge)("inline-block p-4 bg-white rounded-lg shadow-lg dark:bg-gray-700",options===null||options===void 0?void 0:(_$ref=options.theme)===null||_$ref===void 0?void 0:_$ref.background)},_react.default.createElement("div",null,(options===null||options===void 0?void 0:options.title)&&_react.default.createElement("div",{className:(0,_tailwindMerge.twMerge)("px-2 py-3 font-semibold text-center text-gray-900 dark:text-white",options===null||options===void 0?void 0:(_$ref1=options.theme)===null||_$ref1===void 0?void 0:_$ref1.text)},options===null||options===void 0?void 0:options.title),_react.default.createElement("div",{className:"flex justify-between mb-2"},_react.default.createElement(_buttons.ButtonPrevMonth,null),_react.default.createElement(_buttons.ButtonSelectMonth,null),_react.default.createElement(_buttons.ButtonNextMonth,null))),_react.default.createElement("div",{className:"p-1"},view==="days"&&_react.default.createElement(_days.default,{start:start}),view==="months"&&_react.default.createElement(_months.default,null),view==="years"&&_react.default.createElement(_years.default,null),view==="decades"&&_react.default.createElement(_decades.default,null)),((options===null||options===void 0?void 0:options.todayBtn)||(options===null||options===void 0?void 0:options.clearBtn))&&_react.default.createElement("div",{className:"flex mt-2 space-x-2"},(options===null||options===void 0?void 0:options.todayBtn)&&_react.default.createElement(_buttons.ButtonToday,null),(options===null||options===void 0?void 0:options.clearBtn)&&_react.default.createElement(_buttons.ButtonClear,null))))});DatePickerPopup.displayName="DatePickerPopup";var _default=DatePickerPopup;
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _tailwindMerge=require("tailwind-merge");var _date=require("../Utils/date");var _buttons=require("./Buttons");var _datePickerProvider=require("./DatePickerProvider");var _days=_interopRequireDefault(require("./Views/Days"));var _decades=_interopRequireDefault(require("./Views/Decades"));var _months=_interopRequireDefault(require("./Views/Months"));var _years=_interopRequireDefault(require("./Views/Years"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}var DatePickerPopup=(0,_react.forwardRef)(function(_props,ref){var _$ref,_$ref1,_$ref2;var _$ref3=(0,_react.useContext)(_datePickerProvider.DatePickerContext),selectedMonth=_$ref3.selectedMonth,selectedYear=_$ref3.selectedYear,view=_$ref3.view,options=_$ref3.options;var language=(options===null||options===void 0?void 0:options.language)?options===null||options===void 0?void 0:options.language:"en";var locale=new Intl.Locale(language);var weekStart=(locale===null||locale===void 0?void 0:(_$ref=locale.weekInfo)===null||_$ref===void 0?void 0:_$ref.firstDay)||1;var firstOfMonth=(0,_date.firstDateOfMonth)(selectedYear,selectedMonth,1);var start=(0,_date.dayOfTheWeekOf)(firstOfMonth,weekStart,weekStart);return _react.default.createElement("div",{ref:ref,className:(0,_tailwindMerge.twMerge)("absolute z-50 block pt-2 top-10",options===null||options===void 0?void 0:options.datepickerClassNames)},_react.default.createElement("div",{className:(0,_tailwindMerge.twMerge)("inline-block p-4 bg-white rounded-lg shadow-lg dark:bg-gray-700",options===null||options===void 0?void 0:(_$ref1=options.theme)===null||_$ref1===void 0?void 0:_$ref1.background)},_react.default.createElement("div",null,(options===null||options===void 0?void 0:options.title)&&_react.default.createElement("div",{className:(0,_tailwindMerge.twMerge)("px-2 py-3 font-semibold text-center text-gray-900 dark:text-white",options===null||options===void 0?void 0:(_$ref2=options.theme)===null||_$ref2===void 0?void 0:_$ref2.text)},options===null||options===void 0?void 0:options.title),_react.default.createElement("div",{className:"flex justify-between mb-2"},_react.default.createElement(_buttons.ButtonPrevMonth,null),_react.default.createElement(_buttons.ButtonSelectMonth,null),_react.default.createElement(_buttons.ButtonNextMonth,null))),_react.default.createElement("div",{className:"p-1"},view==="days"&&_react.default.createElement(_days.default,{start:start}),view==="months"&&_react.default.createElement(_months.default,null),view==="years"&&_react.default.createElement(_years.default,null),view==="decades"&&_react.default.createElement(_decades.default,null)),((options===null||options===void 0?void 0:options.todayBtn)||(options===null||options===void 0?void 0:options.clearBtn))&&_react.default.createElement("div",{className:"flex mt-2 space-x-2"},(options===null||options===void 0?void 0:options.todayBtn)&&_react.default.createElement(_buttons.ButtonToday,null),(options===null||options===void 0?void 0:options.clearBtn)&&_react.default.createElement(_buttons.ButtonClear,null))))});DatePickerPopup.displayName="DatePickerPopup";var _default=DatePickerPopup;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{DatePickerContext:function(){return DatePickerContext},default:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _options=_interopRequireDefault(require("../Options"));var _date=require("../Utils/date");function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_defineProperty(target,key,source[key])})}return target}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}var DatePickerContext=(0,_react.createContext)({options:_options.default,view:"days",setView:function(){},show:false,setShow:function(){},selectedDate:new Date,changeSelectedDate:function(){},showSelectedDate:true,setShowSelectedDate:function(){},selectedMonth:0,selectedYear:0,getFormattedDate:function(){return""}});var DatePickerProvider=function(param){var children=param.children,customOptions=param.options,onChange=param.onChange,show=param.show,setShow=param.setShow,selectedDateState=param.selectedDateState;var options=_objectSpread({},_options.default,customOptions);var ref=_slicedToArray((0,_react.useState)("days"),2),view=ref[0],setView=ref[1];var ref1=_slicedToArray(selectedDateState||(0,_react.useState)((options===null||options===void 0?void 0:options.defaultDate)||new Date),2),selectedDate=ref1[0],setSelectedDate=ref1[1];var ref2=_slicedToArray((0,_react.useState)(true),2),showSelectedDate=ref2[0],setShowSelectedDate=ref2[1];var selectedMonth=selectedDate.getMonth();var selectedYear=selectedDate.getFullYear();var changeSelectedDate=function(action,date){if((options===null||options===void 0?void 0:options.maxDate)&&date>options.maxDate)return;if((options===null||options===void 0?void 0:options.minDate)&&date<options.minDate)return;if((options===null||options===void 0?void 0:options.disabledDates)&&options.disabledDates.indexOf(date)>=0)return;setSelectedDate(date);setShowSelectedDate(true);if((options===null||options===void 0?void 0:options.autoHide)&&view==="days"&&action==="date")setShow(false);if(onChange)onChange(date)};var getFormattedDate=function(date,formatOptions){return(0,_date.getFormattedDate)((options===null||options===void 0?void 0:options.language)?options===null||options===void 0?void 0:options.language:"en",date,formatOptions)};return _react.default.createElement(DatePickerContext.Provider,{value:{options:options,view:view,setView:setView,show:show,setShow:setShow,selectedDate:selectedDate,changeSelectedDate:changeSelectedDate,showSelectedDate:showSelectedDate,setShowSelectedDate:setShowSelectedDate,selectedMonth:selectedMonth,selectedYear:selectedYear,getFormattedDate:getFormattedDate}},children)};var _default=DatePickerProvider;
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{DatePickerContext:function(){return DatePickerContext},default:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _options=_interopRequireDefault(require("../Options"));var _date=require("../Utils/date");function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_defineProperty(target,key,source[key])})}return target}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}var DatePickerContext=(0,_react.createContext)({options:_options.default,view:"days",setView:function(){},show:false,setShow:function(){},selectedDate:new Date,changeSelectedDate:function(){},showSelectedDate:true,setShowSelectedDate:function(){},selectedMonth:0,selectedYear:0,getFormattedDate:function(){return""}});var DatePickerProvider=function(param){var children=param.children,customOptions=param.options,onChange=param.onChange,show=param.show,setShow=param.setShow,selectedDateState=param.selectedDateState;var options=_objectSpread({},_options.default,customOptions);var ref=_slicedToArray((0,_react.useState)("days"),2),view=ref[0],setView=ref[1];var ref1=_slicedToArray(selectedDateState||(0,_react.useState)((options===null||options===void 0?void 0:options.defaultDate)||new Date),2),selectedDate=ref1[0],setSelectedDate=ref1[1];var ref2=_slicedToArray((0,_react.useState)((options===null||options===void 0?void 0:options.defaultDate)!==null),2),showSelectedDate=ref2[0],setShowSelectedDate=ref2[1];var selectedMonth=selectedDate.getMonth();var selectedYear=selectedDate.getFullYear();var changeSelectedDate=function(action,date){if((options===null||options===void 0?void 0:options.maxDate)&&date>options.maxDate)return;if((options===null||options===void 0?void 0:options.minDate)&&date<options.minDate)return;if((options===null||options===void 0?void 0:options.disabledDates)&&options.disabledDates.indexOf(date)>=0)return;setSelectedDate(date);setShowSelectedDate(true);if((options===null||options===void 0?void 0:options.autoHide)&&view==="days"&&action==="date")setShow(false);if(onChange)onChange(date)};var getFormattedDate=function(date,formatOptions){return(0,_date.getFormattedDate)((options===null||options===void 0?void 0:options.language)?options===null||options===void 0?void 0:options.language:"en",date,formatOptions)};return _react.default.createElement(DatePickerContext.Provider,{value:{options:options,view:view,setView:setView,show:show,setShow:setShow,selectedDate:selectedDate,changeSelectedDate:changeSelectedDate,showSelectedDate:showSelectedDate,setShowSelectedDate:setShowSelectedDate,selectedMonth:selectedMonth,selectedYear:selectedYear,getFormattedDate:getFormattedDate}},children)};var _default=DatePickerProvider;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _date=require("../../Utils/date");var _datePickerProvider=require("../DatePickerProvider");var _tailwindMerge=require("tailwind-merge");function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}var Days=function(param){var start=param.start;var ref;var ref1=(0,_react.useContext)(_datePickerProvider.DatePickerContext),selectedDate=ref1.selectedDate,changeSelectedDate=ref1.changeSelectedDate,showSelectedDate=ref1.showSelectedDate,getFormattedDate=ref1.getFormattedDate,options=ref1.options;return _react.default.createElement(_react.default.Fragment,null,_react.default.createElement("div",{className:"grid grid-cols-7 mb-1"},(ref=options.weekDays)===null||ref===void 0?void 0:ref.map(function(day,index){return _react.default.createElement("span",{key:index,className:"h-6 text-sm font-medium leading-6 text-center text-gray-500 dow dark:text-gray-400"},day)})),_react.default.createElement("div",{className:"grid w-64 grid-cols-7"},_toConsumableArray(Array(42)).map(function(_date1,index){var ref,ref1,ref2,ref3,ref4;var current=(0,_date.addDays)(start,index);var day=getFormattedDate(current,{day:"numeric"});var month=getFormattedDate(current,{month:"long"});var year=getFormattedDate(current,{year:"numeric"});return _react.default.createElement("span",{key:index,className:"hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center dark:text-white font-semibold text-sm ".concat(showSelectedDate&&selectedDate.getTime()>0&&getFormattedDate(selectedDate)===getFormattedDate(current)?(0,_tailwindMerge.twMerge)("bg-blue-700 text-white hover:bg-blue-600",options===null||options===void 0?void 0:(ref=options.theme)===null||ref===void 0?void 0:ref.selected):""," ").concat(month==getFormattedDate(selectedDate,{month:"long"})&&year==getFormattedDate(selectedDate,{year:"numeric"})?(0,_tailwindMerge.twMerge)("text-gray-900",options===null||options===void 0?void 0:(ref1=options.theme)===null||ref1===void 0?void 0:ref1.text):(0,_tailwindMerge.twMerge)("text-gray-500",options===null||options===void 0?void 0:(ref2=options.theme)===null||ref2===void 0?void 0:ref2.disabledText)," ").concat((options===null||options===void 0?void 0:options.minDate)&&new Date(current)<(options===null||options===void 0?void 0:options.minDate)||(options===null||options===void 0?void 0:options.disabledDates)&&options.disabledDates.indexOf(new Date(current))>=0?(0,_tailwindMerge.twMerge)("text-gray-500",options===null||options===void 0?void 0:(ref3=options.theme)===null||ref3===void 0?void 0:ref3.disabledText):""," ").concat((options===null||options===void 0?void 0:options.maxDate)&&new Date(current)>(options===null||options===void 0?void 0:options.maxDate)||(options===null||options===void 0?void 0:options.disabledDates)&&options.disabledDates.indexOf(new Date(current))>=0?(0,_tailwindMerge.twMerge)("text-gray-500",options===null||options===void 0?void 0:(ref4=options.theme)===null||ref4===void 0?void 0:ref4.disabledText):"","\n "),onClick:function(){changeSelectedDate("date",new Date(current))}},day)})))};var _default=Days;
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _date=require("../../Utils/date");var _datePickerProvider=require("../DatePickerProvider");var _tailwindMerge=require("tailwind-merge");function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}var Days=function(param){var start=param.start;var ref=(0,_react.useContext)(_datePickerProvider.DatePickerContext),selectedDate=ref.selectedDate,changeSelectedDate=ref.changeSelectedDate,showSelectedDate=ref.showSelectedDate,getFormattedDate=ref.getFormattedDate,options=ref.options;var startOfWeek=(new Date(start).getDay()+6)%7;var weekDays=options.weekDays||[];var sortedWeekDays=weekDays.slice(startOfWeek).concat(weekDays.slice(0,startOfWeek));return _react.default.createElement(_react.default.Fragment,null,_react.default.createElement("div",{className:"grid grid-cols-7 mb-1"},sortedWeekDays.map(function(day,index){return _react.default.createElement("span",{key:index,className:"h-6 text-sm font-medium leading-6 text-center text-gray-500 dow dark:text-gray-400"},day)})),_react.default.createElement("div",{className:"grid w-64 grid-cols-7"},_toConsumableArray(Array(42)).map(function(_date1,index){var ref,ref1,ref2,ref3,ref4;var current=(0,_date.addDays)(start,index);var day=getFormattedDate(current,{day:"numeric"});var month=getFormattedDate(current,{month:"long"});var year=getFormattedDate(current,{year:"numeric"});return _react.default.createElement("span",{key:index,className:"hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center dark:text-white font-semibold text-sm ".concat(showSelectedDate&&selectedDate.getTime()>0&&getFormattedDate(selectedDate)===getFormattedDate(current)?(0,_tailwindMerge.twMerge)("bg-blue-700 text-white hover:bg-blue-600",options===null||options===void 0?void 0:(ref=options.theme)===null||ref===void 0?void 0:ref.selected):""," ").concat(month==getFormattedDate(selectedDate,{month:"long"})&&year==getFormattedDate(selectedDate,{year:"numeric"})?(0,_tailwindMerge.twMerge)("text-gray-900",options===null||options===void 0?void 0:(ref1=options.theme)===null||ref1===void 0?void 0:ref1.text):(0,_tailwindMerge.twMerge)("text-gray-500",options===null||options===void 0?void 0:(ref2=options.theme)===null||ref2===void 0?void 0:ref2.disabledText)," ").concat((options===null||options===void 0?void 0:options.minDate)&&new Date(current)<(options===null||options===void 0?void 0:options.minDate)||(options===null||options===void 0?void 0:options.disabledDates)&&options.disabledDates.indexOf(new Date(current))>=0?(0,_tailwindMerge.twMerge)("text-gray-500",options===null||options===void 0?void 0:(ref3=options.theme)===null||ref3===void 0?void 0:ref3.disabledText):""," ").concat((options===null||options===void 0?void 0:options.maxDate)&&new Date(current)>(options===null||options===void 0?void 0:options.maxDate)||(options===null||options===void 0?void 0:options.disabledDates)&&options.disabledDates.indexOf(new Date(current))>=0?(0,_tailwindMerge.twMerge)("text-gray-500",options===null||options===void 0?void 0:(ref4=options.theme)===null||ref4===void 0?void 0:ref4.disabledText):"","\n "),onClick:function(){changeSelectedDate("date",new Date(current))}},day)})))};var _default=Days;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var options={autoHide:true,todayBtn:true,clearBtn:true,todayBtnText:"Today",clearBtnText:"Clear",theme:{background:"",todayBtn:"",clearBtn:"",icons:"",text:"",disabledText:"",input:"",inputIcon:"",selected:""},datepickerClassNames:"",defaultDate:new Date,language:"en",weekDays:["Mo","Tu","We","Th","Fr","Sa","Su"],inputNameProp:"date"};var _default=options;
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var options={autoHide:true,todayBtn:true,clearBtn:true,todayBtnText:"Today",clearBtnText:"Clear",theme:{background:"",todayBtn:"",clearBtn:"",icons:"",text:"",disabledText:"",input:"",inputIcon:"",selected:""},datepickerClassNames:"",defaultDate:new Date,language:"en",weekDays:["Mo","Tu","We","Th","Fr","Sa","Su"],inputNameProp:"date",inputIdProp:"date",inputPlaceholderProp:"Select Date",inputDateFormatProp:{day:"numeric",month:"long",year:"numeric"}};var _default=options;

@@ -0,0 +0,0 @@ MIT License

{
"name": "tailwind-datepicker-react",
"version": "1.3.0",
"version": "1.4.0",
"description": "A tailwindcss/flowbite datepicker component built as a react component with types",

@@ -16,3 +16,4 @@ "main": "dist/index.js",

"build:dts": "tsc --declaration --declarationMap --emitDeclarationOnly",
"build": "yarn build:cjs && yarn build:dts"
"build": "yarn build:cjs && yarn build:dts",
"dev": "./node_modules/.bin/nodemon"
},

@@ -48,2 +49,3 @@ "repository": {

"@types/react": ">=17",
"nodemon": "^2.0.22",
"react": ">=17",

@@ -50,0 +52,0 @@ "typescript": "^4.8.4"

@@ -176,7 +176,10 @@ [![NPM Version](https://img.shields.io/npm/v/tailwind-datepicker-react?color=green)](https://www.npmjs.com/package/tailwind-datepicker-react)

- datepickerClassNames?: string - Default: `""`
- defaultDate?: Date - Default: `new Date()`
- defaultDate?: false|Date - Default: `new Date()`
- language?: string - Default: `en`
- disabledDates?: Date[] - Default: `[]`
- weekDays?: string[] - Default: `["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]`
- weekDays?: string[] - Default: `["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"] - Start at Monday even with another language`
- inputNameProp?: string - Default: `date`
- inputIdProp?: string - Default: `Same as "inputNameProp"`
- inputPlaceholderProp?: string - Default: `Select Date`
- inputDateFormatProp?: [Intl.DateTimeFormatOptions](https://devhints.io/wip/intl-datetime) - Default: `{day: "numeric", month: "long", year: "numeric"}`

@@ -203,1 +206,8 @@ ### ITheme

This project is open-source under the [MIT License](https://github.com/OMikkel/tailwind-datepicker-react/blob/master/LICENSE.md).
## Contributing
After clone, you can run (separated):
* `yarn run dev` to start building with [Nodemon](https://github.com/remy/nodemon).
* `cd demo-app/ && npm run dev` to start [Demo App](http://localhost:3000/).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc