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
4.4 KiB

2 years ago
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-date-object");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e),n=r(t);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function i(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function s(e,t){var r=[];return["left","right"].includes(e)?(t.left&&r.push("rmdp-border-left"),t.right&&r.push("rmdp-border-right")):(t.top&&r.push("rmdp-border-top"),t.bottom&&r.push("rmdp-border-bottom")),r.join(" ")}var p=["state","setState","position","registerListener","calendarProps","datePickerProps","handleChange","nodes","Calendar","DatePicker","handlePropsChange","handleFocusedDate"];!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===r&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".rmdp-toolbar{display:flex;flex-wrap:wrap;justify-content:space-around}.rmdp-toolbar div{background-color:#0074d9;border-radius:3px;color:#fff;cursor:pointer;flex-basis:31%;font-size:12px;line-height:22px;margin:5px 0;padding:3px 0}.rmdp-toolbar div:hover{box-shadow:0 0 5px #8798ad;transition:.4s}.rmdp-toolbar.left,.rmdp-toolbar.right{display:grid}.rmdp-toolbar.left div,.rmdp-toolbar.right div{margin:5px 3px;padding:0 5px;text-orientation:mixed;writing-mode:vertical-rl}.green .rmdp-toolbar div{background-color:#3d9970}.purple .rmdp-toolbar div{background-color:#9c27b0}.red .rmdp-toolbar div{background-color:#ea0034}.teal .rmdp-toolbar div{background-color:#009688}.yellow .rmdp-toolbar div{background-color:#f7da37}");var u=["state","handleChange","position","calendarProps","nodes","className","names","sort","handleFocusedDate","DatePicker"];exports.default=function(e){var t=e.state,r=e.handleChange,a=e.position;e.calendarProps;var d=e.nodes,f=e.className,b=e.names,m=e.sort,h=void 0===m?["today","deselect","close"]:m,g=e.handleFocusedDate,y=e.DatePicker,v=i(e,u),O=t.range,P=t.multiple,j=t.date.locale,x={fa:{today:"امروز",deselect:"لغو",close:"بستن"},en:{today:"Today",deselect:"Deselect",close:"Close"}},k=b||x[function(e){return e&&e.name?e.name.split("_")[1]:""}(j)]||x.en,C=["rmdp-toolbar",a,s(a,d)];return o.default.createElement("div",c({className:"".concat(C.join(" ")," ").concat(f)},function(e){return e.state,e.setState,e.position,e.registerListener,e.calendarProps,e.datePickerProps,e.handleChange,e.nodes,e.Calendar,e.DatePicker,e.handlePropsChange,e.handleFocusedDate,i(e,p)}(v)),h.map((function(e,t){return{today:o.default.createElement("div",{key:t,onClick:w},k.today),deselect:o.default.createElement("div",{key:t,onClick:D},k.deselect),close:y&&o.default.createElement("div",{key:t,onClick:function(){return y.clo