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
3.8 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 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){l(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 l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function i(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function c(e){return e&&e.name?e.name.split("_")[1]:""}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function s(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function f(t){var r=t.size,n=void 0===r?24:r,o=t.color,l=void 0===o?"currentColor":o,a=t.stroke,i=void 0===a?2:a,c=s(t,["size","color","stroke"]);return e.createElement("svg",u({className:"icon icon-tabler icon-tabler-calendar-event",width:n,height:n,viewBox:"0 0 24 24",strokeWidth:i,stroke:l,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},c),e.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),e.createElement("rect",{x:4,y:5,width:16,height:16,rx:2}),e.createElement("line",{x1:16,y1:3,x2:16,y2:7}),e.createElement("line",{x1:8,y1:3,x2:8,y2:7}),e.createElement("line",{x1:4,y1:11,x2:20,y2:11}),e.createElement("rect",{x:8,y:15,width:2,height:2}))}var p=["value","openCalendar","className","stringDate","stringDates","separator","handleValueChange","locale","placeholder","iconStyle"];exports.default=function(t){var n,u,s=t.value,y=t.openCalendar,d=t.className,v=void 0===d?"rmdp-input":d,b=t.stringDate,h=t.stringDates,O=t.separator,g=t.handleValueChange,m=t.locale,j=t.placeholder,w=t.iconStyle,x=void 0===w?{}:w,P=i(t,p);s=s||b||(null==h||null===(n=h.join)||void 0===n?void 0:n.call(h,O))||j||"";var E=e.useRef();return e.useEffect((function(){var e,t,r=E.current,n=null==r||null===(e=r.parentNode)||void 0===e||null===(t=e.querySelector)||void 0===t?void 0:t.call(e,".rmdp-input-icon"),o=(null==r?void 0:r.clientHeight)-5+"px";n&&(n.style.height=o,n.style.width=o)})),r.default.createElement("div",{style:{position:"relative"}},r.default.createElement("input",a({ref:E,type:"text",onFocus:y,className:v,value:s,onChange:g,autoComplete:"off"},P)),r.default.createElement(f,{height:20,width:20,stroke:1.5,style:o((u={position:"absolute"},l(u,["fa","ar"].includes(c(m))?"left":"right","2.5px"),l(u,"top","50%"),l(u,"transform","translateY(-50%)"),l(u,"backgroundColor","inherit"),l(u,"cursor","pointer"),u),x),onClick:y}))};