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

!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).RangePickerFooter=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 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){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 o(e){return e&&e.name?e.name.split("_")[1]:""}return function(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.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".rmdp-range-picker-footer{padding:10px;text-align:left}.rtl.rmdp-range-picker-footer{direction:rtl;text-align:right}.rmdp-range-picker-footer h6{font-size:16px;margin:0;white-space:nowrap}.left.rmdp-range-picker-footer h6,.right.rmdp-range-picker-footer h6{flex-direction:row;padding-top:5px;width:100%}.rmdp-cancel{background-color:#bdbcbc;border-radius:50%;color:#fff;cursor:pointer;display:inline-block;font-family:Arial!important;font-size:16px;height:17px;line-height:19px;margin:auto 7px auto 0;text-align:center;transform:rotate(45deg);width:17px}.rtl .rmdp-cancel{margin-left:7px;margin-right:unset}.rmdp-range-picker-footer span{font-size:16px;margin-top:auto}"),function(e){var t,n,l,i,c=e.state,d=e.handleChange,s=e.position,p=e.direction,f=void 0===p?["fa","ar"].includes(o(c.date.locale))?"rtl":"ltr":p,u=e.format,m=void 0===u?"rtl"===f?"DD MMMM":"MMMM DD":u,g=e.names,y=e.DatePicker,b=c.selectedDate,h=c.date.locale,v=null===(t=b[0])||void 0===t||null===(n=t.format)||void 0===n?void 0:n.call(t,m),x=null===(l=b[1])||void 0===l||null===(i=l.format)||void 0===i?void 0:i.call(l,m),D=["bottom","top"].includes(s),k={en:{selectedDates:"Selected Dates"+(D?":":""),from:"From:",to:"To:",selectDate:"Select Date",close:"Close",separator:"-"},fa:{selectedDates:"تاریخ انتخابی شما"+(D?":":""),from:"از:",to:"تا:",selectDate:"انتخاب کنید",close:"بستن",separator:"-"}},O=g||k[o(h)]||k.en;return r.default.createElement("div",{className:"rmdp-range-picker-footer ".concat(f," ").concat(s),style:{display:D?"block":"grid",gridTemplateRows:"auto 1fr"}},r.default.createElement("h6",{className:"rmdp-week-day"},O.selectedDates),r.default.createElement("div",{style:{display:D?"flex":"grid",gridTemplateRows:"1fr auto"}},r.default.createElement("div",{className:"rmdp-header-values",style:{flex:"1",display:D?"":"grid"}},r.default.createElement("div",{style:{display:"inline-block"}},r.default.createElement("i",{className:"rmdp-cancel",onClick:function(){return E(0)}},"+"),r.default.createElement("span",null,O.from," ",null!=v?v:O.selectDate)),D&&r.default.createElement("span",{style:{padding:"0px 10px"}},O.separator),r.default.createElement("div",{style:{display:"inline-block"}},r.default.createElement("i",{className:"rmdp-cancel",onClick:function(){return E(1)}},"+"),r.default.createElement("span",null,O.to," ",null!=x?x:O.selectDate))),y&&r.default.createElement("button",{className:"rmdp-button",onClick:function(){return y.closeCalendar()}},O.close)));function E(e){Array.isArray(b)&&(b.splice(e,1),d(b,a(a({},c),{},{selectedDate:b})))}}}));