react-multi-date-picker
Advanced tools
Comparing version 2.9.1 to 2.9.2
@@ -1,1 +0,1 @@ | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):(n="undefined"!=typeof globalThis?globalThis:n||self).AnalogTimePicker=e(n.React)}(this,(function(n){"use strict";function e(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var t=e(n);function r(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function o(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?r(Object(t),!0).forEach((function(e){a(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function a(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function i(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function l(n,e){var t="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=function(n,e){if(n){if("string"==typeof n)return i(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(n,e):void 0}}(n))||e&&n&&"number"==typeof n.length){t&&(n=t);var r=0,o=function(){};return{s:o,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(n){throw n},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,c=!1;return{s:function(){t=t.call(n)},n:function(){var n=t.next();return l=n.done,n},e:function(n){c=!0,a=n},f:function(){try{l||null==t.return||t.return()}finally{if(c)throw a}}}}function c(n){var e=n.direction,r=n.onClick,o=n.disabled;return t.default.createElement("span",{className:"rmdp-arrow-container ".concat(e," ").concat(o?"disabled":""),onClick:r},t.default.createElement("i",{className:"rmdp-arrow"}))}function d(n){var e=n.name,r=n.value,o=n.onChange,a=n.digits;return r=r<10?"0"+r:""+r,t.default.createElement("input",{type:"text",name:e,value:function(n){return n.replace(/[0-9]/g,(function(n){return a[n]}))}(r),onChange:function(n){var t=i(n.target.value);if(isNaN(t))return;o(e,t)},onKeyDown:function(n){var t;if("ArrowUp"===n.key)t=1;else{if("ArrowDown"!==n.key)return;t=-1}o(e,i(r)+t)}});function i(n){var e,t=l(a);try{for(t.s();!(e=t.n()).done;){var r=e.value;n=n.replace(r,a.indexOf(r))}}catch(n){t.e(n)}finally{t.f()}return Number(n)}}!function(n,e){void 0===e&&(e={});var t=e.insertAt;if(n&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}}(".rmdp-analog-clock {\n background-color: #83cbe7;\n width: 130px;\n height: 130px;\n margin: 15px 20px;\n border-radius: 50%;\n border: 5px solid #09589e;\n position: relative;\n}\n\n.top .rmdp-analog-clock,\n.bottom .rmdp-analog-clock {\n margin: 20px auto;\n}\n\n.rmdp-analog-clock .dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: #ccc;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n position: absolute;\n z-index: 10;\n box-shadow: 0 2px 4px -1px black;\n}\n\n.rmdp-analog-clock .rmdp-hour {\n position: absolute;\n z-index: 5;\n width: 4px;\n height: 30px;\n background-color: #333;\n top: 35px;\n transform-origin: 50% 30px;\n left: 50%;\n margin-left: -2px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n}\n\n.rmdp-analog-clock .rmdp-minute {\n position: absolute;\n z-index: 6;\n width: 4px;\n height: 55px;\n background-color: #666;\n top: 14px;\n left: 50%;\n margin-left: -2px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n transform-origin: 50% 52px;\n}\n\n.rmdp-analog-clock .rmdp-second {\n position: absolute;\n z-index: 7;\n width: 2px;\n height: 60px;\n background-color: #0074d9;\n top: 10px;\n left: 50%;\n margin-left: -1px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n transform-origin: 50% 55px;\n}\n\n.rmdp-analog-clock span {\n display: inline-block;\n position: absolute;\n color: #333;\n font-size: 16px;\n font-family: Arial;\n font-weight: 700;\n z-index: 4;\n}\n\n.rmdp-analog-clock .rmdp-h12 {\n top: 10px;\n left: 50%;\n margin-left: -9px;\n}\n\n.rmdp-analog-clock .rmdp-h3 {\n top: 58px;\n right: 10px;\n}\n\n.rmdp-analog-clock .rmdp-h6 {\n bottom: 7px;\n left: 50%;\n margin-left: -4px;\n}\n\n.rmdp-analog-clock .rmdp-h9 {\n left: 10px;\n top: 58px;\n}\n\n.rmdp-analog-clock .dial-lines {\n position: absolute;\n z-index: 2;\n width: 2px;\n height: 5px;\n background-color: #4ca6f5;\n left: 50%;\n margin-left: -1px;\n transform-origin: 50% 65px;\n}\n\n.rmdp-analog-clock .dial-lines:nth-of-type(5n) {\n width: 3px;\n height: 8px;\n background-color: #0074d9;\n}\n\n@media (max-width: 400px), (max-height: 400px) {\n .rmdp-analog-clock {\n margin: 20px 10px;\n height: 100px;\n width: 100px;\n }\n\n .rmdp-analog-clock .dial-lines {\n width: 1px;\n height: 3px;\n transform-origin: 50% 50px;\n }\n\n .rmdp-analog-clock .dial-lines:nth-of-type(5n) {\n width: 2px;\n height: 5px;\n background-color: #0074d9;\n }\n\n .rmdp-analog-clock span {\n font-size: 12px;\n font-weight: normal;\n }\n\n .rmdp-analog-clock .rmdp-h12 {\n top: 6px;\n }\n\n .rmdp-analog-clock .rmdp-h3 {\n top: 41px;\n right: 7px;\n }\n\n .rmdp-analog-clock .rmdp-h6 {\n bottom: 6px;\n }\n\n .rmdp-analog-clock .rmdp-h9 {\n left: 7px;\n top: 41px;\n }\n\n .rmdp-analog-clock .rmdp-hour {\n height: 20px;\n top: 30px;\n transform-origin: 50% 20px;\n }\n\n .rmdp-analog-clock .rmdp-minute {\n height: 28px;\n top: 19px;\n transform-origin: 50% 31px;\n }\n\n .rmdp-analog-clock .rmdp-second {\n height: 33px;\n top: 16px;\n transform-origin: 50% 35px;\n }\n\n .rmdp-analog-clock .dot {\n width: 7px;\n height: 7px;\n box-shadow: 0 2px 4px -1px black;\n }\n}\n");var p=function(n){return"rotate(".concat(n,"deg)")},u=["hour","minute","second"];function m(n){var e=n.name,r=n.value,o=n.update,a=n.digits,i=n.hideDivider;return t.default.createElement(t.default.Fragment,null,t.default.createElement("div",null,t.default.createElement(c,{direction:"rmdp-up",onClick:function(){return o(e,r+1)}}),t.default.createElement(d,{value:r,onChange:o,digits:a,name:e}),t.default.createElement(c,{direction:"rmdp-down",onClick:function(){return o(e,r-1)}})),!i&&t.default.createElement("span",{className:"dvdr"},":"))}return function(e){var r,a=e.state,i=e.handleChange,l=e.position,c=e.calendarProps.disableDayPicker,d=e.hideSeconds,f=a.date,s=a.selectedDate,g=a.multiple,h=a.range,x=a.focused,b=(r=g||h?x||f:s||f).hour,y=r.minute,k=r.second,v={hour:30*b+.5*y,minute:6*y+.1*k,second:6*k},w=n.useMemo((function(){return Array.from(Array(60).keys()).map((function(n){return t.default.createElement("div",{key:n,className:"dial-lines",style:{transform:p(6*(n+1))}})}))}),[]),E=["3","6","9","12"].map((function(n,e){return t.default.createElement("span",{key:e,className:"rmdp-h"+n},n.replace(/[0-9]/g,(function(n){return f.digits[n]})))}));return t.default.createElement("div",{className:l,style:{display:"grid",gridTemplateRows:"1fr auto",minWidth:c?"180px":""}},t.default.createElement("div",{className:"rmdp-analog-clock"},t.default.createElement("div",{className:"dot"}),t.default.createElement("div",null,u.map((function(n,e){return"second"===n&&d?null:t.default.createElement("div",{key:e,style:{transform:p(v[n])},className:"rmdp-".concat(n)})}))),t.default.createElement("div",null,E),t.default.createElement("div",null,w)),t.default.createElement("div",{className:"rmdp-time-picker",style:{marginBottom:"10px"}},u.map((function(n,e){return"second"===n?null:t.default.createElement(m,{key:e,name:n,value:O(n),update:j,digits:f.digits,hideDivider:"second"===n||"minute"===n&&d})}))));function O(n){return r[n]||(r[n]=0),r[n]}function j(n,e){g||h?x&&(x[n]=e):s&&(s[n]=e),i(s,o(o({},a),{},{selectedDate:s,focused:x}))}}})); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):(n="undefined"!=typeof globalThis?globalThis:n||self).AnalogTimePicker=e(n.React)}(this,(function(n){"use strict";function e(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var t=e(n);function r(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function o(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?r(Object(t),!0).forEach((function(e){a(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function a(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function i(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function l(n,e){var t="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=function(n,e){if(n){if("string"==typeof n)return i(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(n,e):void 0}}(n))||e&&n&&"number"==typeof n.length){t&&(n=t);var r=0,o=function(){};return{s:o,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(n){throw n},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,c=!1;return{s:function(){t=t.call(n)},n:function(){var n=t.next();return l=n.done,n},e:function(n){c=!0,a=n},f:function(){try{l||null==t.return||t.return()}finally{if(c)throw a}}}}function c(n){var e=n.direction,r=n.onClick,o=n.disabled;return t.default.createElement("span",{className:"rmdp-arrow-container ".concat(e," ").concat(o?"disabled":""),onClick:r},t.default.createElement("i",{className:"rmdp-arrow"}))}function d(n){var e=n.name,r=n.value,o=n.onChange,a=n.digits;return r=r<10?"0"+r:""+r,t.default.createElement("input",{type:"text",name:e,value:function(n){return n.replace(/[0-9]/g,(function(n){return a[n]}))}(r),onChange:function(n){var t=i(n.target.value);if(isNaN(t))return;o(e,t)},onKeyDown:function(n){var t;if("ArrowUp"===n.key)t=1;else{if("ArrowDown"!==n.key)return;t=-1}o(e,i(r)+t)}});function i(n){var e,t=l(a);try{for(t.s();!(e=t.n()).done;){var r=e.value;n=n.replace(r,a.indexOf(r))}}catch(n){t.e(n)}finally{t.f()}return Number(n)}}!function(n,e){void 0===e&&(e={});var t=e.insertAt;if(n&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}}(".rmdp-analog-clock {\n background-color: #83cbe7;\n width: 130px;\n height: 130px;\n margin: 15px 20px;\n border-radius: 50%;\n border: 5px solid #09589e;\n position: relative;\n}\n\n.top .rmdp-analog-clock,\n.bottom .rmdp-analog-clock {\n margin: 20px auto;\n}\n\n.rmdp-analog-clock .dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: #ccc;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n position: absolute;\n z-index: 10;\n box-shadow: 0 2px 4px -1px black;\n}\n\n.rmdp-analog-clock .rmdp-hour {\n position: absolute;\n z-index: 5;\n width: 4px;\n height: 30px;\n background-color: #333;\n top: 35px;\n transform-origin: 50% 30px;\n left: 50%;\n margin-left: -2px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n}\n\n.rmdp-analog-clock .rmdp-minute {\n position: absolute;\n z-index: 6;\n width: 4px;\n height: 55px;\n background-color: #666;\n top: 14px;\n left: 50%;\n margin-left: -2px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n transform-origin: 50% 52px;\n}\n\n.rmdp-analog-clock .rmdp-second {\n position: absolute;\n z-index: 7;\n width: 2px;\n height: 60px;\n background-color: #0074d9;\n top: 10px;\n left: 50%;\n margin-left: -1px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n transform-origin: 50% 55px;\n}\n\n.rmdp-analog-clock span {\n display: inline-block;\n position: absolute;\n color: #333;\n font-size: 16px;\n font-family: Arial;\n font-weight: 700;\n z-index: 4;\n}\n\n.rmdp-analog-clock .rmdp-h12 {\n top: 10px;\n left: 50%;\n margin-left: -9px;\n}\n\n.rmdp-analog-clock .rmdp-h3 {\n top: 58px;\n right: 10px;\n}\n\n.rmdp-analog-clock .rmdp-h6 {\n bottom: 7px;\n left: 50%;\n margin-left: -4px;\n}\n\n.rmdp-analog-clock .rmdp-h9 {\n left: 10px;\n top: 58px;\n}\n\n.rmdp-analog-clock .dial-lines {\n position: absolute;\n z-index: 2;\n width: 2px;\n height: 5px;\n background-color: #4ca6f5;\n left: 50%;\n margin-left: -1px;\n transform-origin: 50% 65px;\n}\n\n.rmdp-analog-clock .dial-lines:nth-of-type(5n) {\n width: 3px;\n height: 8px;\n background-color: #0074d9;\n}\n\n@media (max-width: 400px), (max-height: 400px) {\n .rmdp-analog-clock {\n margin: 20px 10px;\n height: 100px;\n width: 100px;\n }\n\n .rmdp-analog-clock .dial-lines {\n width: 1px;\n height: 3px;\n transform-origin: 50% 50px;\n }\n\n .rmdp-analog-clock .dial-lines:nth-of-type(5n) {\n width: 2px;\n height: 5px;\n background-color: #0074d9;\n }\n\n .rmdp-analog-clock span {\n font-size: 12px;\n font-weight: normal;\n }\n\n .rmdp-analog-clock .rmdp-h12 {\n top: 6px;\n }\n\n .rmdp-analog-clock .rmdp-h3 {\n top: 41px;\n right: 7px;\n }\n\n .rmdp-analog-clock .rmdp-h6 {\n bottom: 6px;\n }\n\n .rmdp-analog-clock .rmdp-h9 {\n left: 7px;\n top: 41px;\n }\n\n .rmdp-analog-clock .rmdp-hour {\n height: 20px;\n top: 30px;\n transform-origin: 50% 20px;\n }\n\n .rmdp-analog-clock .rmdp-minute {\n height: 28px;\n top: 19px;\n transform-origin: 50% 31px;\n }\n\n .rmdp-analog-clock .rmdp-second {\n height: 33px;\n top: 16px;\n transform-origin: 50% 35px;\n }\n\n .rmdp-analog-clock .dot {\n width: 7px;\n height: 7px;\n box-shadow: 0 2px 4px -1px black;\n }\n}\n");var p=function(n){return"rotate(".concat(n,"deg)")},u=["hour","minute","second"];function m(n){var e=n.name,r=n.value,o=n.update,a=n.digits,i=n.hideDivider;return t.default.createElement(t.default.Fragment,null,t.default.createElement("div",null,t.default.createElement(c,{direction:"rmdp-up",onClick:function(){return o(e,r+1)}}),t.default.createElement(d,{value:r,onChange:o,digits:a,name:e}),t.default.createElement(c,{direction:"rmdp-down",onClick:function(){return o(e,r-1)}})),!i&&t.default.createElement("span",{className:"dvdr"},":"))}return function(e){var r,a=e.state,i=e.handleChange,l=e.position,c=e.calendarProps.disableDayPicker,d=e.hideSeconds,f=a.date,s=a.selectedDate,g=a.multiple,h=a.range,x=a.focused,b=(r=g||h?x||f:s||f).hour,y=r.minute,k=r.second,v={hour:30*b+.5*y,minute:6*y+.1*k,second:6*k},w=n.useMemo((function(){return Array.from(Array(60).keys()).map((function(n){return t.default.createElement("div",{key:n,className:"dial-lines",style:{transform:p(6*(n+1))}})}))}),[]),E=["3","6","9","12"].map((function(n,e){return t.default.createElement("span",{key:e,className:"rmdp-h"+n},n.replace(/[0-9]/g,(function(n){return f.digits[n]})))}));return t.default.createElement("div",{className:l,style:{display:"grid",gridTemplateRows:"1fr auto",minWidth:c?"180px":""}},t.default.createElement("div",{className:"rmdp-analog-clock"},t.default.createElement("div",{className:"dot"}),t.default.createElement("div",null,u.map((function(n,e){return"second"===n&&d?null:t.default.createElement("div",{key:e,style:{transform:p(v[n])},className:"rmdp-".concat(n)})}))),t.default.createElement("div",null,E),t.default.createElement("div",null,w)),t.default.createElement("div",{className:"rmdp-time-picker",style:{marginBottom:"10px"}},u.map((function(n,e){return"second"===n&&d?null:t.default.createElement(m,{key:e,name:n,value:O(n),update:j,digits:f.digits,hideDivider:"second"===n||"minute"===n&&d})}))));function O(n){return r[n]||(r[n]=0),r[n]}function j(n,e){g||h?x&&(x[n]=e):s&&(s[n]=e),i(s,o(o({},a),{},{selectedDate:s,focused:x}))}}})); |
{ | ||
"name": "react-multi-date-picker", | ||
"version": "2.9.1", | ||
"version": "2.9.2", | ||
"description": "a simple React datepicker component for working with gregorian, persian, arabic and indian calendars with the ability to select the date by single, multiple and range pickers.", | ||
@@ -58,2 +58,3 @@ "main": "./build/index.js", | ||
"@tabler/icons": "^1.41.2", | ||
"jest": "^26.6.3", | ||
"postcss": "8.3.0", | ||
@@ -60,0 +61,0 @@ "postcss-css-variables": "^0.18.0", |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react");function e(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var t=e(n);function r(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function o(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?r(Object(t),!0).forEach((function(e){a(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function a(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function i(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function l(n,e){var t="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=function(n,e){if(n){if("string"==typeof n)return i(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(n,e):void 0}}(n))||e&&n&&"number"==typeof n.length){t&&(n=t);var r=0,o=function(){};return{s:o,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(n){throw n},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,c=!1;return{s:function(){t=t.call(n)},n:function(){var n=t.next();return l=n.done,n},e:function(n){c=!0,a=n},f:function(){try{l||null==t.return||t.return()}finally{if(c)throw a}}}}function c(n){var e=n.direction,r=n.onClick,o=n.disabled;return t.default.createElement("span",{className:"rmdp-arrow-container ".concat(e," ").concat(o?"disabled":""),onClick:r},t.default.createElement("i",{className:"rmdp-arrow"}))}function d(n){var e=n.name,r=n.value,o=n.onChange,a=n.digits;return r=r<10?"0"+r:""+r,t.default.createElement("input",{type:"text",name:e,value:function(n){return n.replace(/[0-9]/g,(function(n){return a[n]}))}(r),onChange:function(n){var t=i(n.target.value);if(isNaN(t))return;o(e,t)},onKeyDown:function(n){var t;if("ArrowUp"===n.key)t=1;else{if("ArrowDown"!==n.key)return;t=-1}o(e,i(r)+t)}});function i(n){var e,t=l(a);try{for(t.s();!(e=t.n()).done;){var r=e.value;n=n.replace(r,a.indexOf(r))}}catch(n){t.e(n)}finally{t.f()}return Number(n)}}!function(n,e){void 0===e&&(e={});var t=e.insertAt;if(n&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}}(".rmdp-analog-clock {\n background-color: #83cbe7;\n width: 130px;\n height: 130px;\n margin: 15px 20px;\n border-radius: 50%;\n border: 5px solid #09589e;\n position: relative;\n}\n\n.top .rmdp-analog-clock,\n.bottom .rmdp-analog-clock {\n margin: 20px auto;\n}\n\n.rmdp-analog-clock .dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: #ccc;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n position: absolute;\n z-index: 10;\n box-shadow: 0 2px 4px -1px black;\n}\n\n.rmdp-analog-clock .rmdp-hour {\n position: absolute;\n z-index: 5;\n width: 4px;\n height: 30px;\n background-color: #333;\n top: 35px;\n transform-origin: 50% 30px;\n left: 50%;\n margin-left: -2px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n}\n\n.rmdp-analog-clock .rmdp-minute {\n position: absolute;\n z-index: 6;\n width: 4px;\n height: 55px;\n background-color: #666;\n top: 14px;\n left: 50%;\n margin-left: -2px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n transform-origin: 50% 52px;\n}\n\n.rmdp-analog-clock .rmdp-second {\n position: absolute;\n z-index: 7;\n width: 2px;\n height: 60px;\n background-color: #0074d9;\n top: 10px;\n left: 50%;\n margin-left: -1px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n transform-origin: 50% 55px;\n}\n\n.rmdp-analog-clock span {\n display: inline-block;\n position: absolute;\n color: #333;\n font-size: 16px;\n font-family: Arial;\n font-weight: 700;\n z-index: 4;\n}\n\n.rmdp-analog-clock .rmdp-h12 {\n top: 10px;\n left: 50%;\n margin-left: -9px;\n}\n\n.rmdp-analog-clock .rmdp-h3 {\n top: 58px;\n right: 10px;\n}\n\n.rmdp-analog-clock .rmdp-h6 {\n bottom: 7px;\n left: 50%;\n margin-left: -4px;\n}\n\n.rmdp-analog-clock .rmdp-h9 {\n left: 10px;\n top: 58px;\n}\n\n.rmdp-analog-clock .dial-lines {\n position: absolute;\n z-index: 2;\n width: 2px;\n height: 5px;\n background-color: #4ca6f5;\n left: 50%;\n margin-left: -1px;\n transform-origin: 50% 65px;\n}\n\n.rmdp-analog-clock .dial-lines:nth-of-type(5n) {\n width: 3px;\n height: 8px;\n background-color: #0074d9;\n}\n\n@media (max-width: 400px), (max-height: 400px) {\n .rmdp-analog-clock {\n margin: 20px 10px;\n height: 100px;\n width: 100px;\n }\n\n .rmdp-analog-clock .dial-lines {\n width: 1px;\n height: 3px;\n transform-origin: 50% 50px;\n }\n\n .rmdp-analog-clock .dial-lines:nth-of-type(5n) {\n width: 2px;\n height: 5px;\n background-color: #0074d9;\n }\n\n .rmdp-analog-clock span {\n font-size: 12px;\n font-weight: normal;\n }\n\n .rmdp-analog-clock .rmdp-h12 {\n top: 6px;\n }\n\n .rmdp-analog-clock .rmdp-h3 {\n top: 41px;\n right: 7px;\n }\n\n .rmdp-analog-clock .rmdp-h6 {\n bottom: 6px;\n }\n\n .rmdp-analog-clock .rmdp-h9 {\n left: 7px;\n top: 41px;\n }\n\n .rmdp-analog-clock .rmdp-hour {\n height: 20px;\n top: 30px;\n transform-origin: 50% 20px;\n }\n\n .rmdp-analog-clock .rmdp-minute {\n height: 28px;\n top: 19px;\n transform-origin: 50% 31px;\n }\n\n .rmdp-analog-clock .rmdp-second {\n height: 33px;\n top: 16px;\n transform-origin: 50% 35px;\n }\n\n .rmdp-analog-clock .dot {\n width: 7px;\n height: 7px;\n box-shadow: 0 2px 4px -1px black;\n }\n}\n");var p=function(n){return"rotate(".concat(n,"deg)")},u=["hour","minute","second"];function m(n){var e=n.name,r=n.value,o=n.update,a=n.digits,i=n.hideDivider;return t.default.createElement(t.default.Fragment,null,t.default.createElement("div",null,t.default.createElement(c,{direction:"rmdp-up",onClick:function(){return o(e,r+1)}}),t.default.createElement(d,{value:r,onChange:o,digits:a,name:e}),t.default.createElement(c,{direction:"rmdp-down",onClick:function(){return o(e,r-1)}})),!i&&t.default.createElement("span",{className:"dvdr"},":"))}exports.default=function(e){var r,a=e.state,i=e.handleChange,l=e.position,c=e.calendarProps.disableDayPicker,d=e.hideSeconds,s=a.date,f=a.selectedDate,g=a.multiple,h=a.range,x=a.focused,b=(r=g||h?x||s:f||s).hour,y=r.minute,k=r.second,v={hour:30*b+.5*y,minute:6*y+.1*k,second:6*k},w=n.useMemo((function(){return Array.from(Array(60).keys()).map((function(n){return t.default.createElement("div",{key:n,className:"dial-lines",style:{transform:p(6*(n+1))}})}))}),[]),E=["3","6","9","12"].map((function(n,e){return t.default.createElement("span",{key:e,className:"rmdp-h"+n},n.replace(/[0-9]/g,(function(n){return s.digits[n]})))}));return t.default.createElement("div",{className:l,style:{display:"grid",gridTemplateRows:"1fr auto",minWidth:c?"180px":""}},t.default.createElement("div",{className:"rmdp-analog-clock"},t.default.createElement("div",{className:"dot"}),t.default.createElement("div",null,u.map((function(n,e){return"second"===n&&d?null:t.default.createElement("div",{key:e,style:{transform:p(v[n])},className:"rmdp-".concat(n)})}))),t.default.createElement("div",null,E),t.default.createElement("div",null,w)),t.default.createElement("div",{className:"rmdp-time-picker",style:{marginBottom:"10px"}},u.map((function(n,e){return"second"===n?null:t.default.createElement(m,{key:e,name:n,value:O(n),update:j,digits:s.digits,hideDivider:"second"===n||"minute"===n&&d})}))));function O(n){return r[n]||(r[n]=0),r[n]}function j(n,e){g||h?x&&(x[n]=e):f&&(f[n]=e),i(f,o(o({},a),{},{selectedDate:f,focused:x}))}}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react");function e(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var t=e(n);function r(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function o(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?r(Object(t),!0).forEach((function(e){a(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function a(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function i(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function l(n,e){var t="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=function(n,e){if(n){if("string"==typeof n)return i(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(n,e):void 0}}(n))||e&&n&&"number"==typeof n.length){t&&(n=t);var r=0,o=function(){};return{s:o,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(n){throw n},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,c=!1;return{s:function(){t=t.call(n)},n:function(){var n=t.next();return l=n.done,n},e:function(n){c=!0,a=n},f:function(){try{l||null==t.return||t.return()}finally{if(c)throw a}}}}function c(n){var e=n.direction,r=n.onClick,o=n.disabled;return t.default.createElement("span",{className:"rmdp-arrow-container ".concat(e," ").concat(o?"disabled":""),onClick:r},t.default.createElement("i",{className:"rmdp-arrow"}))}function d(n){var e=n.name,r=n.value,o=n.onChange,a=n.digits;return r=r<10?"0"+r:""+r,t.default.createElement("input",{type:"text",name:e,value:function(n){return n.replace(/[0-9]/g,(function(n){return a[n]}))}(r),onChange:function(n){var t=i(n.target.value);if(isNaN(t))return;o(e,t)},onKeyDown:function(n){var t;if("ArrowUp"===n.key)t=1;else{if("ArrowDown"!==n.key)return;t=-1}o(e,i(r)+t)}});function i(n){var e,t=l(a);try{for(t.s();!(e=t.n()).done;){var r=e.value;n=n.replace(r,a.indexOf(r))}}catch(n){t.e(n)}finally{t.f()}return Number(n)}}!function(n,e){void 0===e&&(e={});var t=e.insertAt;if(n&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}}(".rmdp-analog-clock {\n background-color: #83cbe7;\n width: 130px;\n height: 130px;\n margin: 15px 20px;\n border-radius: 50%;\n border: 5px solid #09589e;\n position: relative;\n}\n\n.top .rmdp-analog-clock,\n.bottom .rmdp-analog-clock {\n margin: 20px auto;\n}\n\n.rmdp-analog-clock .dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: #ccc;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n position: absolute;\n z-index: 10;\n box-shadow: 0 2px 4px -1px black;\n}\n\n.rmdp-analog-clock .rmdp-hour {\n position: absolute;\n z-index: 5;\n width: 4px;\n height: 30px;\n background-color: #333;\n top: 35px;\n transform-origin: 50% 30px;\n left: 50%;\n margin-left: -2px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n}\n\n.rmdp-analog-clock .rmdp-minute {\n position: absolute;\n z-index: 6;\n width: 4px;\n height: 55px;\n background-color: #666;\n top: 14px;\n left: 50%;\n margin-left: -2px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n transform-origin: 50% 52px;\n}\n\n.rmdp-analog-clock .rmdp-second {\n position: absolute;\n z-index: 7;\n width: 2px;\n height: 60px;\n background-color: #0074d9;\n top: 10px;\n left: 50%;\n margin-left: -1px;\n border-top-left-radius: 50%;\n border-top-right-radius: 50%;\n transform-origin: 50% 55px;\n}\n\n.rmdp-analog-clock span {\n display: inline-block;\n position: absolute;\n color: #333;\n font-size: 16px;\n font-family: Arial;\n font-weight: 700;\n z-index: 4;\n}\n\n.rmdp-analog-clock .rmdp-h12 {\n top: 10px;\n left: 50%;\n margin-left: -9px;\n}\n\n.rmdp-analog-clock .rmdp-h3 {\n top: 58px;\n right: 10px;\n}\n\n.rmdp-analog-clock .rmdp-h6 {\n bottom: 7px;\n left: 50%;\n margin-left: -4px;\n}\n\n.rmdp-analog-clock .rmdp-h9 {\n left: 10px;\n top: 58px;\n}\n\n.rmdp-analog-clock .dial-lines {\n position: absolute;\n z-index: 2;\n width: 2px;\n height: 5px;\n background-color: #4ca6f5;\n left: 50%;\n margin-left: -1px;\n transform-origin: 50% 65px;\n}\n\n.rmdp-analog-clock .dial-lines:nth-of-type(5n) {\n width: 3px;\n height: 8px;\n background-color: #0074d9;\n}\n\n@media (max-width: 400px), (max-height: 400px) {\n .rmdp-analog-clock {\n margin: 20px 10px;\n height: 100px;\n width: 100px;\n }\n\n .rmdp-analog-clock .dial-lines {\n width: 1px;\n height: 3px;\n transform-origin: 50% 50px;\n }\n\n .rmdp-analog-clock .dial-lines:nth-of-type(5n) {\n width: 2px;\n height: 5px;\n background-color: #0074d9;\n }\n\n .rmdp-analog-clock span {\n font-size: 12px;\n font-weight: normal;\n }\n\n .rmdp-analog-clock .rmdp-h12 {\n top: 6px;\n }\n\n .rmdp-analog-clock .rmdp-h3 {\n top: 41px;\n right: 7px;\n }\n\n .rmdp-analog-clock .rmdp-h6 {\n bottom: 6px;\n }\n\n .rmdp-analog-clock .rmdp-h9 {\n left: 7px;\n top: 41px;\n }\n\n .rmdp-analog-clock .rmdp-hour {\n height: 20px;\n top: 30px;\n transform-origin: 50% 20px;\n }\n\n .rmdp-analog-clock .rmdp-minute {\n height: 28px;\n top: 19px;\n transform-origin: 50% 31px;\n }\n\n .rmdp-analog-clock .rmdp-second {\n height: 33px;\n top: 16px;\n transform-origin: 50% 35px;\n }\n\n .rmdp-analog-clock .dot {\n width: 7px;\n height: 7px;\n box-shadow: 0 2px 4px -1px black;\n }\n}\n");var p=function(n){return"rotate(".concat(n,"deg)")},u=["hour","minute","second"];function m(n){var e=n.name,r=n.value,o=n.update,a=n.digits,i=n.hideDivider;return t.default.createElement(t.default.Fragment,null,t.default.createElement("div",null,t.default.createElement(c,{direction:"rmdp-up",onClick:function(){return o(e,r+1)}}),t.default.createElement(d,{value:r,onChange:o,digits:a,name:e}),t.default.createElement(c,{direction:"rmdp-down",onClick:function(){return o(e,r-1)}})),!i&&t.default.createElement("span",{className:"dvdr"},":"))}exports.default=function(e){var r,a=e.state,i=e.handleChange,l=e.position,c=e.calendarProps.disableDayPicker,d=e.hideSeconds,s=a.date,f=a.selectedDate,g=a.multiple,h=a.range,x=a.focused,b=(r=g||h?x||s:f||s).hour,y=r.minute,k=r.second,v={hour:30*b+.5*y,minute:6*y+.1*k,second:6*k},w=n.useMemo((function(){return Array.from(Array(60).keys()).map((function(n){return t.default.createElement("div",{key:n,className:"dial-lines",style:{transform:p(6*(n+1))}})}))}),[]),E=["3","6","9","12"].map((function(n,e){return t.default.createElement("span",{key:e,className:"rmdp-h"+n},n.replace(/[0-9]/g,(function(n){return s.digits[n]})))}));return t.default.createElement("div",{className:l,style:{display:"grid",gridTemplateRows:"1fr auto",minWidth:c?"180px":""}},t.default.createElement("div",{className:"rmdp-analog-clock"},t.default.createElement("div",{className:"dot"}),t.default.createElement("div",null,u.map((function(n,e){return"second"===n&&d?null:t.default.createElement("div",{key:e,style:{transform:p(v[n])},className:"rmdp-".concat(n)})}))),t.default.createElement("div",null,E),t.default.createElement("div",null,w)),t.default.createElement("div",{className:"rmdp-time-picker",style:{marginBottom:"10px"}},u.map((function(n,e){return"second"===n&&d?null:t.default.createElement(m,{key:e,name:n,value:O(n),update:j,digits:s.digits,hideDivider:"second"===n||"minute"===n&&d})}))));function O(n){return r[n]||(r[n]=0),r[n]}function j(n,e){g||h?x&&(x[n]=e):f&&(f[n]=e),i(f,o(o({},a),{},{selectedDate:f,focused:x}))}}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
293863
18