You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
9.9 KiB
2 lines
9.9 KiB
2 years ago
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(e);function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}(e,t)||l(e,t)||function(){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 l(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p(e){var t=e.direction,n=e.onClick,a=e.disabled;return r.default.createElement("span",{className:"rmdp-arrow-container ".concat(t," ").concat(a?"disabled":""),onClick:n},r.default.createElement("i",{className:"rmdp-arrow"}))}function c(e){var t=e.name,n=e.value,a=e.onChange,o=e.digits;return r.default.createElement("input",{type:"text",name:t,value:n,onChange:function(e){var r=i(e.target.value);if(isNaN(r))return;a(t,r)},onKeyDown:function(e){var r;if("ArrowUp"===e.key)r=1;else{if("ArrowDown"!==e.key)return;r=-1}a(t,i(n)+r)}});function i(e){var t,r=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=l(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}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 o,i=!0,d=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){d=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(d)throw o}}}}(o);try{for(r.s();!(t=r.n()).done;){var n=t.value;e=e.replace(n,o.indexOf(n))}}catch(e){r.e(e)}finally{r.f()}return Number(e)}}function u(e){return Array.isArray(e)}function m(t){var n=t.selectedDate,o=t.focused,i=t.handleFocusedDate,l=t.state,d=t.setState,p=t.format;return e.useEffect((function(){u(n)&&0!==n.length&&(o||c(n[0]))}),[o,n,c]),u(n)&&r.default.createElement("div",{style:{display:"flex",padding:"5px 0"}},r.default.createElement("select",{className:"rmdp-input",style:{height:"26px",width:"90%",margin:"auto"},value:(null==o?void 0:o.day)||"",onChange:function(e){return c(n.find((function(t){return t.day.toString()===e.target.value})))}},n.map((function(e){return r.default.createElement("option",{key:e.day,value:e.day},e.format(p))}))));function c(e){d(a(a({},l),{},{focused:e})),i(e)}}function f(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===r&&n.firstChild?n.insertBefore(a,n.firstC
|