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
10 KiB
2 lines
10 KiB
2 years ago
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).AnalogTimePicker=t(e.React)}(this,(function(e){"use strict";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 o(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){a(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 a(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,o,a=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw o}}return a}(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,o=e.disabled;return r.default.createElement("span",{className:"rmdp-arrow-container ".concat(t," ").concat(o?"disabled":""),onClick:n},r.default.createElement("i",{className:"rmdp-arrow"}))}function c(e){var t=e.name,n=e.value,o=e.onChange,a=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;o(t,r)},onKeyDown:function(e){var r;if("ArrowUp"===e.key)r=1;else{if("ArrowDown"!==e.key)return;r=-1}o(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,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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,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,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(d)throw a}}}}(a);try{for(r.s();!(t=r.n()).done;){var n=t.value;e=e.replace(n,a.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,a=t.focused,i=t.handleFocusedDate,l=t.state,d=t.setState,p=t.format;return e.useEffect((function(){u(n)&&0!==n.length&&(a||c(n[0]))}),[a,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==a?void 0:a.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(o(o({},l),{},{focused:e})),i(e)}}function f(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefine
|