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.
1 lines
4.0 KiB
1 lines
4.0 KiB
!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).InputIcon=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){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 i(){return(i=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 a(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,i=t.stroke,a=void 0===i?2:i,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:a,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"];return function(t){var n,u,s=t.value,d=t.openCalendar,y=t.className,h=void 0===y?"rmdp-input":y,b=t.stringDate,v=t.stringDates,O=t.separator,g=t.handleValueChange,m=t.locale,j=t.placeholder,w=t.iconStyle,x=void 0===w?{}:w,E=a(t,p);s=s||b||(null==v||null===(n=v.join)||void 0===n?void 0:n.call(v,O))||j||"";var P=e.useRef();return e.useEffect((function(){var e,t,r=P.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",i({ref:P,type:"text",onFocus:d,className:h,value:s,onChange:g,autoComplete:"off"},E)),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:d}))}}));
|
|
|