chakra-dayzed-datepicker
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -10,3 +10,2 @@ 'use strict'; | ||
var dayzed = require('dayzed'); | ||
var ArrowKeysReact = require('arrow-keys-react'); | ||
@@ -17,3 +16,2 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var FocusLock__default = /*#__PURE__*/_interopDefaultLegacy(FocusLock); | ||
var ArrowKeysReact__default = /*#__PURE__*/_interopDefaultLegacy(ArrowKeysReact); | ||
@@ -56,2 +54,41 @@ function _extends() { | ||
// Based on: https://github.com/leon-good-life/arrow-keys-react | ||
// re-implemented by @hexelon in https://github.com/hexelon/chakra-dayzed-datepicker/commit/4f44e565e3975f613b54304d1fdaeb97dd7dfa15 | ||
var ArrowKeysReact = /*#__PURE__*/function () { | ||
function ArrowKeysReact(config) { | ||
this.config = void 0; | ||
this.config = config; | ||
} | ||
var _proto = ArrowKeysReact.prototype; | ||
_proto.getEvents = function getEvents() { | ||
var _this = this; | ||
return { | ||
onKeyDown: function onKeyDown(e) { | ||
switch (e.key) { | ||
case 'ArrowDown': | ||
_this.config.down && _this.config.down(); | ||
break; | ||
case 'ArrowLeft': | ||
_this.config.left && _this.config.left(); | ||
break; | ||
case 'ArrowRight': | ||
_this.config.right && _this.config.right(); | ||
break; | ||
case 'ArrowUp': | ||
_this.config.up && _this.config.up(); | ||
break; | ||
} | ||
} | ||
}; | ||
}; | ||
return ArrowKeysReact; | ||
}(); | ||
var DefaultBtnStyle = { | ||
@@ -178,3 +215,3 @@ variant: 'ghost', | ||
}, []); | ||
ArrowKeysReact__default["default"].config({ | ||
var arrowKeysReact = new ArrowKeysReact({ | ||
left: function left() { | ||
@@ -201,3 +238,3 @@ getKeyOffset(-1); | ||
direction: ['column', 'column', 'row'] | ||
}, ArrowKeysReact__default["default"].events), calendars.map(function (calendar, calendarIdx) { | ||
}, arrowKeysReact.getEvents()), calendars.map(function (calendar, calendarIdx) { | ||
return React__default["default"].createElement(react.VStack, { | ||
@@ -492,2 +529,8 @@ key: calendarIdx, | ||
}, React__default["default"].createElement(react.PopoverTrigger, null, React__default["default"].createElement(react.Input, _extends({ | ||
onKeyPress: function onKeyPress(e) { | ||
if (e.key === ' ' && !isOpen) { | ||
e.preventDefault(); | ||
onOpen(); | ||
} | ||
}, | ||
id: id, | ||
@@ -494,0 +537,0 @@ autoComplete: "off", |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@chakra-ui/react"),n=require("date-fns"),a=require("react-focus-lock"),r=require("dayzed"),o=require("arrow-keys-react");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(e),u=l(a),d=l(o);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},i.apply(this,arguments)}function c(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)t.indexOf(n=o[a])>=0||(r[n]=e[n]);return r}var f=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],p=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],m={variant:"ghost",size:"sm"},g=function(n){var a,r=n.calendars,o=n.getBackProps,l=null==(a=n.propsConfigs)?void 0:a.dateNavBtnProps;return s.default.createElement(e.Fragment,null,s.default.createElement(t.Button,i({},o({calendars:r,offset:12}),m,l),"<<"),s.default.createElement(t.Button,i({},o({calendars:r}),m,l),"<"))},v=function(n){var a,r=n.calendars,o=n.getForwardProps,l=null==(a=n.propsConfigs)?void 0:a.dateNavBtnProps;return s.default.createElement(e.Fragment,null,s.default.createElement(t.Button,i({},o({calendars:r}),m,l),">"),s.default.createElement(t.Button,i({},o({calendars:r,offset:12}),m,l),">>"))},y=function(n){var a=n.dateObj,r=n.propsConfigs,o=n.isInRange,l=n.onMouseEnter,u=a.date,d=a.selected,c=a.selectable,f=a.today,p=n.renderProps.getDateProps,m=(null==r?void 0:r.dayOfMonthBtnProps)||{},g=m.defaultBtnProps,v=m.isInRangeBtnProps,y=m.selectedBtnProps,h=m.todayBtnProps,P=e.useMemo((function(){return{defaultBtnProps:i({size:"sm",variant:"outline",background:"transparent",borderColor:"transparent",_after:{content:"''",position:"absolute",top:"-0.125rem",left:"-0.125rem",bottom:"-0.125rem",right:"-0.125rem",borderWidth:"0.125rem",borderColor:"transparent"}},g,{_hover:c?i({bg:"purple.400"},null==g?void 0:g._hover):void 0}),isInRangeBtnProps:i({background:"purple.200"},v),selectedBtnProps:i({background:"purple.200"},y),todayBtnProps:i({borderColor:"blue.400"},h)}}),[g,v,y,h,c]);return s.default.createElement(t.Button,i({},p({dateObj:a,disabled:!c,onMouseEnter:l}),{disabled:!c},P.defaultBtnProps,o&&c&&P.isInRangeBtnProps,d&&c&&P.selectedBtnProps,f&&P.todayBtnProps),u.getDate())},h=function(n){var a=n.configs,o=n.propsConfigs,l=n.onMouseEnterHighlight,u=n.isInRange,c=r.useDayzed(n.dayzedHookProps),f=c.calendars,p=c.getBackProps,m=c.getForwardProps,h=e.useCallback((function(e){var t=document.activeElement,n=document.querySelectorAll("button");n.forEach((function(a,r){var o=r+e;a===t&&(o<=n.length-1&&o>=0?n[o].focus():n[0].focus())}))}),[]);return d.default.config({left:function(){h(-1)},right:function(){h(1)},up:function(){h(-7)},down:function(){h(7)}}),f.length<=0?null:s.default.createElement(t.Stack,i({className:"datepicker-calendar",direction:["column","column","row"]},d.default.events),f.map((function(e,n){return s.default.createElement(t.VStack,{key:n,height:"100%",borderWidth:"1px",padding:"0.5rem 0.75rem"},s.default.createElement(t.HStack,null,s.default.createElement(g,{calendars:f,getBackProps:p,propsConfigs:o}),s.default.createElement(t.Heading,{size:"sm",minWidth:"5rem",textAlign:"center"},a.monthNames[e.month]," ",e.year),s.default.createElement(v,{calendars:f,getForwardProps:m,propsConfigs:o})),s.default.createElement(t.Divider,null),s.default.createElement(t.SimpleGrid,{columns:7,spacing:1,textAlign:"center"},a.dayNames.map((function(e,n){return s.default.createElement(t.Box,{fontSize:"sm",fontWeight:"semibold",key:n},e)})),e.weeks.map((function(n,a){return n.map((function(n,r){var d=e.month+"-"+e.year+"-"+a+"-"+r;if(!n)return s.default.createElement(t.Box,{key:d});var i=n.date;return s.default.createElement(y,{key:d,dateObj:n,propsConfigs:o,renderProps:c,isInRange:u&&u(i),onMouseEnter:function(){l&&l(i)}})}))}))))})))},P=["configs","propsConfigs","usePortal","defaultIsOpen"],E={dateFormat:"yyyy-MM-dd",monthNames:f,dayNames:p},b=["configs","propsConfigs","id","name","usePortal","defaultIsOpen"],C=function(n){var a=n.dayzedHookProps,r=n.configs,o=n.propsConfigs,l=n.selected,u=e.useState(null),d=u[0],i=u[1];return s.default.createElement(t.Flex,{onMouseLeave:function(){i(null)}},s.default.createElement(h,{dayzedHookProps:a,configs:r,propsConfigs:o,isInRange:function(e){if(!Array.isArray(l)||null==l||!l.length)return!1;var t=l[0];return 2===l.length?t<e&&l[1]>e:d&&(t<e&&d>=e||e<t&&e>=d)},onMouseEnterHighlight:function(e){Array.isArray(l)&&null!=l&&l.length&&i(e)}}))},D={dateFormat:"MM/dd/yyyy",monthNames:f,dayNames:p};exports.RangeDatepicker=function(a){var r=a.configs,o=void 0===r?D:r,l=a.propsConfigs,d=void 0===l?{}:l,f=a.id,p=a.name,m=a.usePortal,g=a.defaultIsOpen,v=void 0!==g&&g,y=c(a,b),h=y.selectedDates,P=y.minDate,E=y.maxDate,k=y.onDateChange,O=y.disabled,B=e.useState(h[0]||new Date),S=B[0],M=B[1],F=e.useState(0),I=F[0],x=F[1],w=t.useDisclosure({defaultIsOpen:v}),z=w.onOpen,N=w.onClose,A=w.isOpen,H=h[0]?""+n.format(h[0],o.dateFormat):"";H+=h[1]?" - "+n.format(h[1],o.dateFormat):"";var j=m?t.Portal:s.default.Fragment;return s.default.createElement(t.Popover,{placement:"bottom-start",variant:"responsive",isOpen:A,onOpen:z,onClose:function(){N(),M(h[0]||new Date),x(0)},isLazy:!0},s.default.createElement(t.PopoverTrigger,null,s.default.createElement(t.Input,i({id:f,autoComplete:"off",isDisabled:O,name:p,value:H,onChange:function(e){return e.target.value}},d.inputProps))),s.default.createElement(j,null,s.default.createElement(t.PopoverContent,{width:"100%"},s.default.createElement(t.PopoverBody,null,s.default.createElement(u.default,null,s.default.createElement(C,{dayzedHookProps:{onDateSelected:function(e){var t=e.date;if(e.selectable){var n=[].concat(h);h.length?1===h.length?(h[0]<t?n.push(t):n.unshift(t),k(n)):2===n.length&&k([t]):(n.push(t),k(n))}},selected:h,monthsToDisplay:2,date:S,minDate:P,maxDate:E,offset:I,onOffsetChanged:x},configs:o,propsConfigs:d,selected:h}))))))},exports.SingleDatepicker=function(a){var r=a.configs,o=void 0===r?E:r,l=a.propsConfigs,d=a.usePortal,f=a.defaultIsOpen,p=void 0!==f&&f,m=c(a,P),g=m.date,v=m.name,y=m.disabled,b=m.onDateChange,C=m.id,D=m.minDate,k=m.maxDate,O=e.useState(g),B=O[0],S=O[1],M=e.useState(0),F=M[0],I=M[1],x=t.useDisclosure({defaultIsOpen:p}),w=x.onOpen,z=x.onClose,N=x.isOpen,A=d?t.Portal:s.default.Fragment;return s.default.createElement(t.Popover,{placement:"bottom-start",variant:"responsive",isOpen:N,onOpen:w,onClose:function(){z(),S(g),I(0)},isLazy:!0},s.default.createElement(t.PopoverTrigger,null,s.default.createElement(t.Input,i({onKeyPress:function(e){" "!==e.key||N||(e.preventDefault(),w())},id:C,autoComplete:"off",isDisabled:y,name:v,value:g?n.format(g,o.dateFormat):"",onChange:function(e){return e.target.value}},null==l?void 0:l.inputProps))),s.default.createElement(A,null,s.default.createElement(t.PopoverContent,{width:"100%"},s.default.createElement(t.PopoverBody,null,s.default.createElement(u.default,null,s.default.createElement(h,{dayzedHookProps:{showOutsideDays:!0,onDateSelected:function(e){var t=e.date;if(e.selectable)return t instanceof Date&&!isNaN(t.getTime())?(b(t),void z()):void 0},selected:g,date:B,minDate:D,maxDate:k,offset:F,onOffsetChanged:I},configs:o,propsConfigs:l}))))))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@chakra-ui/react"),n=require("date-fns"),a=require("react-focus-lock"),r=require("dayzed");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(e),s=o(a);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},u.apply(this,arguments)}function i(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)t.indexOf(n=o[a])>=0||(r[n]=e[n]);return r}var d=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],c=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],f=function(){function e(e){this.config=void 0,this.config=e}return e.prototype.getEvents=function(){var e=this;return{onKeyDown:function(t){switch(t.key){case"ArrowDown":e.config.down&&e.config.down();break;case"ArrowLeft":e.config.left&&e.config.left();break;case"ArrowRight":e.config.right&&e.config.right();break;case"ArrowUp":e.config.up&&e.config.up()}}}},e}(),p={variant:"ghost",size:"sm"},m=function(n){var a,r=n.calendars,o=n.getBackProps,s=null==(a=n.propsConfigs)?void 0:a.dateNavBtnProps;return l.default.createElement(e.Fragment,null,l.default.createElement(t.Button,u({},o({calendars:r,offset:12}),p,s),"<<"),l.default.createElement(t.Button,u({},o({calendars:r}),p,s),"<"))},g=function(n){var a,r=n.calendars,o=n.getForwardProps,s=null==(a=n.propsConfigs)?void 0:a.dateNavBtnProps;return l.default.createElement(e.Fragment,null,l.default.createElement(t.Button,u({},o({calendars:r}),p,s),">"),l.default.createElement(t.Button,u({},o({calendars:r,offset:12}),p,s),">>"))},v=function(n){var a=n.dateObj,r=n.propsConfigs,o=n.isInRange,s=n.onMouseEnter,i=a.date,d=a.selected,c=a.selectable,f=a.today,p=n.renderProps.getDateProps,m=(null==r?void 0:r.dayOfMonthBtnProps)||{},g=m.defaultBtnProps,v=m.isInRangeBtnProps,h=m.selectedBtnProps,y=m.todayBtnProps,P=e.useMemo((function(){return{defaultBtnProps:u({size:"sm",variant:"outline",background:"transparent",borderColor:"transparent",_after:{content:"''",position:"absolute",top:"-0.125rem",left:"-0.125rem",bottom:"-0.125rem",right:"-0.125rem",borderWidth:"0.125rem",borderColor:"transparent"}},g,{_hover:c?u({bg:"purple.400"},null==g?void 0:g._hover):void 0}),isInRangeBtnProps:u({background:"purple.200"},v),selectedBtnProps:u({background:"purple.200"},h),todayBtnProps:u({borderColor:"blue.400"},y)}}),[g,v,h,y,c]);return l.default.createElement(t.Button,u({},p({dateObj:a,disabled:!c,onMouseEnter:s}),{disabled:!c},P.defaultBtnProps,o&&c&&P.isInRangeBtnProps,d&&c&&P.selectedBtnProps,f&&P.todayBtnProps),i.getDate())},h=function(n){var a=n.configs,o=n.propsConfigs,s=n.onMouseEnterHighlight,i=n.isInRange,d=r.useDayzed(n.dayzedHookProps),c=d.calendars,p=d.getBackProps,h=d.getForwardProps,y=e.useCallback((function(e){var t=document.activeElement,n=document.querySelectorAll("button");n.forEach((function(a,r){var o=r+e;a===t&&(o<=n.length-1&&o>=0?n[o].focus():n[0].focus())}))}),[]),P=new f({left:function(){y(-1)},right:function(){y(1)},up:function(){y(-7)},down:function(){y(7)}});return c.length<=0?null:l.default.createElement(t.Stack,u({className:"datepicker-calendar",direction:["column","column","row"]},P.getEvents()),c.map((function(e,n){return l.default.createElement(t.VStack,{key:n,height:"100%",borderWidth:"1px",padding:"0.5rem 0.75rem"},l.default.createElement(t.HStack,null,l.default.createElement(m,{calendars:c,getBackProps:p,propsConfigs:o}),l.default.createElement(t.Heading,{size:"sm",minWidth:"5rem",textAlign:"center"},a.monthNames[e.month]," ",e.year),l.default.createElement(g,{calendars:c,getForwardProps:h,propsConfigs:o})),l.default.createElement(t.Divider,null),l.default.createElement(t.SimpleGrid,{columns:7,spacing:1,textAlign:"center"},a.dayNames.map((function(e,n){return l.default.createElement(t.Box,{fontSize:"sm",fontWeight:"semibold",key:n},e)})),e.weeks.map((function(n,a){return n.map((function(n,r){var u=e.month+"-"+e.year+"-"+a+"-"+r;if(!n)return l.default.createElement(t.Box,{key:u});var c=n.date;return l.default.createElement(v,{key:u,dateObj:n,propsConfigs:o,renderProps:d,isInRange:i&&i(c),onMouseEnter:function(){s&&s(c)}})}))}))))})))},y=["configs","propsConfigs","usePortal","defaultIsOpen"],P={dateFormat:"yyyy-MM-dd",monthNames:d,dayNames:c},E=["configs","propsConfigs","id","name","usePortal","defaultIsOpen"],b=function(n){var a=n.dayzedHookProps,r=n.configs,o=n.propsConfigs,s=n.selected,u=e.useState(null),i=u[0],d=u[1];return l.default.createElement(t.Flex,{onMouseLeave:function(){d(null)}},l.default.createElement(h,{dayzedHookProps:a,configs:r,propsConfigs:o,isInRange:function(e){if(!Array.isArray(s)||null==s||!s.length)return!1;var t=s[0];return 2===s.length?t<e&&s[1]>e:i&&(t<e&&i>=e||e<t&&e>=i)},onMouseEnterHighlight:function(e){Array.isArray(s)&&null!=s&&s.length&&d(e)}}))},C={dateFormat:"MM/dd/yyyy",monthNames:d,dayNames:c};exports.RangeDatepicker=function(a){var r=a.configs,o=void 0===r?C:r,d=a.propsConfigs,c=void 0===d?{}:d,f=a.id,p=a.name,m=a.usePortal,g=a.defaultIsOpen,v=void 0!==g&&g,h=i(a,E),y=h.selectedDates,P=h.minDate,D=h.maxDate,k=h.onDateChange,O=h.disabled,B=e.useState(y[0]||new Date),w=B[0],S=B[1],M=e.useState(0),F=M[0],I=M[1],x=t.useDisclosure({defaultIsOpen:v}),z=x.onOpen,A=x.onClose,N=x.isOpen,H=y[0]?""+n.format(y[0],o.dateFormat):"";H+=y[1]?" - "+n.format(y[1],o.dateFormat):"";var R=m?t.Portal:l.default.Fragment;return l.default.createElement(t.Popover,{placement:"bottom-start",variant:"responsive",isOpen:N,onOpen:z,onClose:function(){A(),S(y[0]||new Date),I(0)},isLazy:!0},l.default.createElement(t.PopoverTrigger,null,l.default.createElement(t.Input,u({onKeyPress:function(e){" "!==e.key||N||(e.preventDefault(),z())},id:f,autoComplete:"off",isDisabled:O,name:p,value:H,onChange:function(e){return e.target.value}},c.inputProps))),l.default.createElement(R,null,l.default.createElement(t.PopoverContent,{width:"100%"},l.default.createElement(t.PopoverBody,null,l.default.createElement(s.default,null,l.default.createElement(b,{dayzedHookProps:{onDateSelected:function(e){var t=e.date;if(e.selectable){var n=[].concat(y);y.length?1===y.length?(y[0]<t?n.push(t):n.unshift(t),k(n)):2===n.length&&k([t]):(n.push(t),k(n))}},selected:y,monthsToDisplay:2,date:w,minDate:P,maxDate:D,offset:F,onOffsetChanged:I},configs:o,propsConfigs:c,selected:y}))))))},exports.SingleDatepicker=function(a){var r=a.configs,o=void 0===r?P:r,d=a.propsConfigs,c=a.usePortal,f=a.defaultIsOpen,p=void 0!==f&&f,m=i(a,y),g=m.date,v=m.name,E=m.disabled,b=m.onDateChange,C=m.id,D=m.minDate,k=m.maxDate,O=e.useState(g),B=O[0],w=O[1],S=e.useState(0),M=S[0],F=S[1],I=t.useDisclosure({defaultIsOpen:p}),x=I.onOpen,z=I.onClose,A=I.isOpen,N=c?t.Portal:l.default.Fragment;return l.default.createElement(t.Popover,{placement:"bottom-start",variant:"responsive",isOpen:A,onOpen:x,onClose:function(){z(),w(g),F(0)},isLazy:!0},l.default.createElement(t.PopoverTrigger,null,l.default.createElement(t.Input,u({onKeyPress:function(e){" "!==e.key||A||(e.preventDefault(),x())},id:C,autoComplete:"off",isDisabled:E,name:v,value:g?n.format(g,o.dateFormat):"",onChange:function(e){return e.target.value}},null==d?void 0:d.inputProps))),l.default.createElement(N,null,l.default.createElement(t.PopoverContent,{width:"100%"},l.default.createElement(t.PopoverBody,null,l.default.createElement(s.default,null,l.default.createElement(h,{dayzedHookProps:{showOutsideDays:!0,onDateSelected:function(e){var t=e.date;if(e.selectable)return t instanceof Date&&!isNaN(t.getTime())?(b(t),void z()):void 0},selected:g,date:B,minDate:D,maxDate:k,offset:M,onOffsetChanged:F},configs:o,propsConfigs:d}))))))}; | ||
//# sourceMappingURL=chakra-dayzed-datepicker.cjs.production.min.js.map |
@@ -6,3 +6,2 @@ import React, { Fragment, useMemo, useCallback, useState } from 'react'; | ||
import { useDayzed } from 'dayzed'; | ||
import ArrowKeysReact from 'arrow-keys-react'; | ||
@@ -45,2 +44,41 @@ function _extends() { | ||
// Based on: https://github.com/leon-good-life/arrow-keys-react | ||
// re-implemented by @hexelon in https://github.com/hexelon/chakra-dayzed-datepicker/commit/4f44e565e3975f613b54304d1fdaeb97dd7dfa15 | ||
var ArrowKeysReact = /*#__PURE__*/function () { | ||
function ArrowKeysReact(config) { | ||
this.config = void 0; | ||
this.config = config; | ||
} | ||
var _proto = ArrowKeysReact.prototype; | ||
_proto.getEvents = function getEvents() { | ||
var _this = this; | ||
return { | ||
onKeyDown: function onKeyDown(e) { | ||
switch (e.key) { | ||
case 'ArrowDown': | ||
_this.config.down && _this.config.down(); | ||
break; | ||
case 'ArrowLeft': | ||
_this.config.left && _this.config.left(); | ||
break; | ||
case 'ArrowRight': | ||
_this.config.right && _this.config.right(); | ||
break; | ||
case 'ArrowUp': | ||
_this.config.up && _this.config.up(); | ||
break; | ||
} | ||
} | ||
}; | ||
}; | ||
return ArrowKeysReact; | ||
}(); | ||
var DefaultBtnStyle = { | ||
@@ -167,3 +205,3 @@ variant: 'ghost', | ||
}, []); | ||
ArrowKeysReact.config({ | ||
var arrowKeysReact = new ArrowKeysReact({ | ||
left: function left() { | ||
@@ -190,3 +228,3 @@ getKeyOffset(-1); | ||
direction: ['column', 'column', 'row'] | ||
}, ArrowKeysReact.events), calendars.map(function (calendar, calendarIdx) { | ||
}, arrowKeysReact.getEvents()), calendars.map(function (calendar, calendarIdx) { | ||
return React.createElement(VStack, { | ||
@@ -481,2 +519,8 @@ key: calendarIdx, | ||
}, React.createElement(PopoverTrigger, null, React.createElement(Input, _extends({ | ||
onKeyPress: function onKeyPress(e) { | ||
if (e.key === ' ' && !isOpen) { | ||
e.preventDefault(); | ||
onOpen(); | ||
} | ||
}, | ||
id: id, | ||
@@ -483,0 +527,0 @@ autoComplete: "off", |
{ | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"license": "MIT", | ||
@@ -80,5 +80,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"arrow-keys-react": "^1.0.6", | ||
"react-focus-lock": "^2.5.2" | ||
} | ||
} |
@@ -97,2 +97,4 @@ # A Simple Chakra Datepicker based on Dayzed. | ||
defaultIsOpen | boolean | undefined | open the date panel at the beginning | ||
minDate | Date | undefined | minimum date | ||
maxDate | Date | undefined | maximum date | ||
@@ -99,0 +101,0 @@ For version < `npm@0.1.6`:</br> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
176516
2
28
1813
111
- Removedarrow-keys-react@^1.0.6
- Removedarrow-keys-react@1.0.6(transitive)