@mailstep/design-system 0.7.17 → 0.7.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.7.17",
3
+ "version": "0.7.18",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -1 +1,3 @@
1
- export declare const FooterRow: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
1
+ export declare const FooterRow: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
2
+ disabled?: boolean | undefined;
3
+ }, never>;
@@ -3,5 +3,8 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import { styled } from '@xstyled/styled-components';
6
- export var FooterRow = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 15px;\n line-height: 23px;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 15px;\n line-height: 23px;\n"])));
6
+ export var FooterRow = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 15px;\n line-height: 23px;\n opacity: ", ";\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 15px;\n line-height: 23px;\n opacity: ", ";\n"])), function (_a) {
7
+ var disabled = _a.disabled;
8
+ return (disabled ? 0.2 : 1);
9
+ });
7
10
  var templateObject_1;
@@ -24,5 +24,6 @@ export var Timepicker = function (_a) {
24
24
  useEffect(function () {
25
25
  !!value && setTime('minutes', minutes);
26
26
  }, [minutes]);
27
- return (_jsx(x.div, { borderTop: "1px solid", borderColor: "lightGray2", pt: "8px", mb: "8px", children: _jsxs(FooterRow, { children: [_jsxs(x.div, { children: [_jsx(Icon, { icon: "clock" }), _jsx(FooterRowLabel, { children: i18n._({ id: 'dataGrid.filterCell.time', message: 'Time' }) })] }), _jsx(x.div, { display: "flex", alignItems: "center", children: _jsx(TimeInput, { type: "time", onChange: onChange, disabled: disabled, defaultValue: "00:00" }) })] }) }));
27
+ var timeValue = "".concat((hours).toString().padStart(2, '0'), ":").concat((minutes).toString().padStart(2, '0'));
28
+ return (_jsx(x.div, { borderTop: "1px solid", borderColor: "lightGray2", pt: "8px", mb: "8px", children: _jsxs(FooterRow, { disabled: disabled || !value, children: [_jsxs(x.div, { children: [_jsx(Icon, { icon: "clock" }), _jsx(FooterRowLabel, { children: i18n._({ id: 'dataGrid.filterCell.time', message: 'Time' }) })] }), _jsx(x.div, { display: "flex", alignItems: "center", children: _jsx(TimeInput, { type: "time", onChange: onChange, disabled: disabled || !value, value: timeValue }) })] }) }));
28
29
  };
package/ui/index.es.js CHANGED
@@ -22618,6 +22618,9 @@ const D0 = G.div`
22618
22618
  align-items: center;
22619
22619
  font-size: 15px;
22620
22620
  line-height: 23px;
22621
+ opacity: ${({
22622
+ disabled: e
22623
+ }) => e ? 0.2 : 1};
22621
22624
  `, L0 = G.span`
22622
22625
  margin-left: 8px;
22623
22626
  text-align: left;
@@ -22645,16 +22648,18 @@ const D0 = G.div`
22645
22648
  value: t,
22646
22649
  disabled: r
22647
22650
  }) => {
22648
- var f, A;
22649
- const n = ((f = t == null ? void 0 : t.getHours) == null ? void 0 : f.call(t)) ?? 0, i = ((A = t == null ? void 0 : t.getMinutes) == null ? void 0 : A.call(t)) ?? 0, [a, o] = ke(n), [s, c] = ke(i), u = he((h) => {
22650
- const [g, m] = h.target.value.split(":");
22651
- o(Number(g)), c(Number(m));
22651
+ var A, h;
22652
+ const n = ((A = t == null ? void 0 : t.getHours) == null ? void 0 : A.call(t)) ?? 0, i = ((h = t == null ? void 0 : t.getMinutes) == null ? void 0 : h.call(t)) ?? 0, [a, o] = ke(n), [s, c] = ke(i), u = he((g) => {
22653
+ const [m, b] = g.target.value.split(":");
22654
+ o(Number(m)), c(Number(b));
22652
22655
  }, []);
22653
- return $e(() => {
22656
+ $e(() => {
22654
22657
  t && e("hours", a);
22655
22658
  }, [a]), $e(() => {
22656
22659
  t && e("minutes", s);
22657
- }, [s]), /* @__PURE__ */ p.jsx(je.div, { borderTop: "1px solid", borderColor: "lightGray2", pt: "8px", mb: "8px", children: /* @__PURE__ */ p.jsxs(D0, { children: [
22660
+ }, [s]);
22661
+ const f = `${a.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`;
22662
+ return /* @__PURE__ */ p.jsx(je.div, { borderTop: "1px solid", borderColor: "lightGray2", pt: "8px", mb: "8px", children: /* @__PURE__ */ p.jsxs(D0, { disabled: r || !t, children: [
22658
22663
  /* @__PURE__ */ p.jsxs(je.div, { children: [
22659
22664
  /* @__PURE__ */ p.jsx(ct, { icon: "clock" }),
22660
22665
  /* @__PURE__ */ p.jsx(L0, { children: Ve._({
@@ -22662,7 +22667,7 @@ const D0 = G.div`
22662
22667
  message: "Time"
22663
22668
  }) })
22664
22669
  ] }),
22665
- /* @__PURE__ */ p.jsx(je.div, { display: "flex", alignItems: "center", children: /* @__PURE__ */ p.jsx(lpe, { type: "time", onChange: u, disabled: r, defaultValue: "00:00" }) })
22670
+ /* @__PURE__ */ p.jsx(je.div, { display: "flex", alignItems: "center", children: /* @__PURE__ */ p.jsx(lpe, { type: "time", onChange: u, disabled: r || !t, value: f }) })
22666
22671
  ] }) });
22667
22672
  };
22668
22673
  function H4({
package/ui/index.umd.js CHANGED
@@ -1707,6 +1707,7 @@ xe.version="2.30.1",Hoe(Wt),xe.fn=Ce,xe.min=Ple,xe.max=Tle,xe.now=Mle,xe.utc=Mi,
1707
1707
  align-items: center;
1708
1708
  font-size: 15px;
1709
1709
  line-height: 23px;
1710
+ opacity: ${({disabled:e})=>e?.2:1};
1710
1711
  `,G0=G.span`
1711
1712
  margin-left: 8px;
1712
1713
  text-align: left;
@@ -1729,7 +1730,7 @@ xe.version="2.30.1",Hoe(Wt),xe.fn=Ce,xe.min=Ple,xe.max=Tle,xe.now=Mle,xe.utc=Mi,
1729
1730
  &::-webkit-calendar-picker-indicator {
1730
1731
  display: none;
1731
1732
  }
1732
- `,zue=({setTime:e,value:t,disabled:r})=>{var f,A;const n=((f=t==null?void 0:t.getHours)==null?void 0:f.call(t))??0,i=((A=t==null?void 0:t.getMinutes)==null?void 0:A.call(t))??0,[a,o]=x.useState(n),[s,c]=x.useState(i),u=x.useCallback(h=>{const[g,m]=h.target.value.split(":");o(Number(g)),c(Number(m))},[]);return x.useEffect(()=>{t&&e("hours",a)},[a]),x.useEffect(()=>{t&&e("minutes",s)},[s]),p.jsx(Be.div,{borderTop:"1px solid",borderColor:"lightGray2",pt:"8px",mb:"8px",children:p.jsxs(z0,{children:[p.jsxs(Be.div,{children:[p.jsx(rt,{icon:"clock"}),p.jsx(G0,{children:je._({id:"dataGrid.filterCell.time",message:"Time"})})]}),p.jsx(Be.div,{display:"flex",alignItems:"center",children:p.jsx(Hue,{type:"time",onChange:u,disabled:r,defaultValue:"00:00"})})]})})};function Hh({onClickPrev:e,onClickSwitch:t,onClickNext:r,switchContent:n,switchColSpan:i,switchProps:a,label:o}){return p.jsxs("tr",{children:[p.jsx("th",{className:"rdtPrev",onClick:e,children:p.jsx("span",{children:"‹"})}),p.jsx("th",{className:"rdtSwitch",colSpan:i,onClick:t,...a,children:n}),p.jsx("th",{className:"rdtNext",onClick:r,children:p.jsx("span",{children:"›"})}),p.jsx("th",{colSpan:2,className:"rdtLabel",children:o&&o})]})}const Gue=({setDate:e,isSecondDatePicker:t})=>{const r=new Date,n=new Date(r.getTime()-24*60*60*1e3),i=new Date(r.getTime()+24*60*60*1e3),a=new Date(r.getTime()-24*60*60*1e3*7),o=new Date(r.getTime()+24*60*60*1e3*7);return p.jsxs(Be.div,{borderTop:"1px solid",borderColor:"lightGray2",mt:"8px",pt:"8px",mb:"8px",children:[p.jsxs(z0,{children:[p.jsxs(Be.div,{display:"flex",alignItems:"center",flex:"1",children:[p.jsx(rt,{icon:"calendar"}),p.jsx(G0,{onClick:e,"data-value":r.getDate(),"data-month":r.getMonth(),"data-year":r.getFullYear(),children:je._({id:"dataGrid.filterCell.today",message:"Today"})})]}),p.jsxs(Be.div,{textTransform:"capitalize",children:[new Intl.DateTimeFormat(void 0,{weekday:"short"}).format(r),","," ",new Intl.DateTimeFormat(void 0,{month:"short"}).format(r)," ",r.getDate()]})]}),p.jsxs(z0,{children:[p.jsxs(Be.div,{display:"flex",alignItems:"center",flex:"1",children:[p.jsx(rt,{icon:"calendar"}),p.jsx(G0,{onClick:e,"data-value":(t?i:n).getDate(),"data-month":(t?i:n).getMonth(),"data-year":(t?i:n).getFullYear(),children:t?je._({id:"dataGrid.filterCell.tomorrow",message:"Tomorrow"}):je._({id:"dataGrid.filterCell.yesterday",message:"Yesterday"})})]}),p.jsx(Be.div,{children:p.jsxs(Be.div,{textTransform:"capitalize",children:[new Intl.DateTimeFormat(void 0,{weekday:"short"}).format(t?i:n),","," ",new Intl.DateTimeFormat(void 0,{month:"short"}).format(t?i:n)," ",t?i.getDate():n.getDate()]})})]}),p.jsxs(z0,{children:[p.jsxs(Be.div,{display:"flex",alignItems:"center",flex:"1",children:[p.jsx(rt,{icon:"calendar"}),p.jsx(G0,{onClick:e,"data-value":t?o.getDate():a.getDate(),"data-month":t?o.getMonth():a.getMonth(),"data-year":t?o.getFullYear():a.getFullYear(),children:t?je._({id:"dataGrid.filterCell.nextWeek",message:"Next week"}):je._({id:"dataGrid.filterCell.lastWeek",message:"Last week"})})]}),p.jsxs(Be.div,{textTransform:"capitalize",children:[new Intl.DateTimeFormat(void 0,{weekday:"short"}).format(t?o:a),","," ",new Intl.DateTimeFormat(void 0,{month:"short"}).format(t?o:a)," ",t?o.getDate():a.getDate()]})]})]})},W4=class W4 extends x.Component{constructor(){super(...arguments),this._setDate=t=>{this.props.updateDate(t)}}render(){return p.jsx("div",{className:"rdtDays",children:p.jsxs("table",{children:[p.jsxs("thead",{children:[this.renderNavigation(),this.renderDayHeaders()]}),p.jsx("tbody",{children:this.renderDays()}),this.renderFooter()]})})}renderNavigation(){const t=this.props.viewDate,r=t.localeData(),n=this.props.label;return p.jsx(Hh,{onClickPrev:()=>this.props.navigate(-1,"months"),onClickSwitch:()=>this.props.showView("months"),onClickNext:()=>this.props.navigate(1,"months"),switchContent:r.months(t,"DD[]MMMM")+" "+t.year(),switchColSpan:3,label:n,switchProps:{"data-value":this.props.viewDate.month()}})}renderDayHeaders(){const t=this.props.viewDate.localeData();let r=Zue(t).map((n,i)=>p.jsx("th",{className:"dow",children:n},n+i));return p.jsx("tr",{children:r})}renderDays(){const t=this.props.viewDate,r=t.clone().startOf("month"),n=t.clone().endOf("month");let i=[[],[],[],[],[],[]],a=t.clone().subtract(1,"months");a.date(a.daysInMonth()).startOf("week");let o=a.clone().add(42,"d"),s=0;for(;a.isBefore(o);)Uue(i,s++).push(this.renderDay(a,r,n)),a.add(1,"d");return i.map((c,u)=>p.jsx("tr",{children:c},`${o.month()}_${u}`))}renderDay(t,r,n){let i=this.props.selectedDate,a=this.props.secondValue,o={key:t.format("M_D"),"data-value":t.date(),"data-month":t.month(),"data-year":t.year()},s="rdtDay";return t.isBefore(r)?s+=" rdtOld":t.isAfter(n)&&(s+=" rdtNew"),a&&t.isBefore(a)&&t.isAfter(i)&&(s+=" rdtActiveRange"),a&&t.isAfter(a)&&t.isBefore(i)&&(s+=" rdtActiveRange"),i&&t.isSame(i,"day")&&(s+=" rdtActive"),a&&t.isSame(a,"day")&&(s+=" rdtActiveSecond"),t.isSame(this.props.moment(),"day")&&(s+=" rdtToday"),this.props.isValidDate(t)?o.onClick=this._setDate:s+=" rdtDisabled",o.className=s,this.props.renderDay(o,t.clone(),i&&i.clone())}renderFooter(){const t=this.props.setTime,r=this._setDate,n=this.props.value,i=this.props.disabled;return p.jsx("tfoot",{children:p.jsx("tr",{children:p.jsxs("td",{colSpan:7,children:[p.jsx(Gue,{setDate:r,isSecondDatePicker:this.props.isSecondDatePicker}),this.props.timeFormat&&p.jsx(zue,{setTime:t,value:n,disabled:i})]})})})}};W4.defaultProps={isValidDate:()=>!0,renderDay:(t,r)=>p.jsx("td",{...t,children:r.date()})};let U0=W4;function Uue(e,t){return e[Math.floor(t/7)]}function Zue(e){const t=e.firstDayOfWeek();let r=[],n=0;return e._weekdaysMin.forEach(function(i){r[(7+n++-t)%7]=i}),r}class Yue extends x.Component{constructor(){super(...arguments),this._updateSelectedMonth=t=>{this.props.updateDate(t)}}render(){return p.jsxs("div",{className:"rdtMonths",children:[p.jsx("table",{children:p.jsx("thead",{children:this.renderNavigation()})}),p.jsx("table",{children:p.jsx("tbody",{children:this.renderMonths()})})]})}renderNavigation(){let t=this.props.viewDate.year();return p.jsx(Hh,{onClickPrev:()=>this.props.navigate(-1,"years"),onClickSwitch:()=>this.props.showView("years"),onClickNext:()=>this.props.navigate(1,"years"),switchContent:t,switchColSpan:"2"})}renderMonths(){let t=[[],[],[]];for(let r=0;r<12;r++)Jue(t,r).push(this.renderMonth(r));return t.map((r,n)=>p.jsx("tr",{children:r},n))}renderMonth(t){const r=this.props.selectedDate;let n="rdtMonth",i;this.isDisabledMonth(t)?n+=" rdtDisabled":i=this._updateSelectedMonth,r&&r.year()===this.props.viewDate.year()&&r.month()===t&&(n+=" rdtActive");let a={key:t,className:n,"data-value":t,onClick:i};return this.props.renderMonth?this.props.renderMonth(a,t,this.props.viewDate.year(),this.props.selectedDate&&this.props.selectedDate.clone()):p.jsx("td",{...a,children:this.getMonthText(t)})}isDisabledMonth(t){let r=this.props.isValidDate;if(!r)return!1;let n=this.props.viewDate.clone().set({month:t}),i=n.endOf("month").date()+1;for(;i-- >1;)if(r(n.date(i)))return!1;return!0}getMonthText(t){const r=this.props.viewDate,n=r.localeData().monthsShort(r.month(t));return Xue(n.substring(0,3))}}function Jue(e,t){return t<4?e[0]:t<8?e[1]:e[2]}function Xue(e){return e.charAt(0).toUpperCase()+e.slice(1)}const H4=class H4 extends x.Component{constructor(){super(...arguments),this.disabledYearsCache={},this._updateSelectedYear=t=>{this.props.updateDate(t)}}render(){return p.jsxs("div",{className:"rdtYears",children:[p.jsx("table",{children:p.jsx("thead",{children:this.renderNavigation()})}),p.jsx("table",{children:p.jsx("tbody",{children:this.renderYears()})})]})}renderNavigation(){const t=this.getViewYear();return p.jsx(Hh,{onClickPrev:()=>this.props.navigate(-10,"years"),onClickSwitch:()=>this.props.showView("years"),onClickNext:()=>this.props.navigate(10,"years"),switchContent:`${t}-${t+9}`})}renderYears(){const t=this.getViewYear();let r=[[],[],[]];for(let n=t-1;n<t+11;n++)_ue(r,n-t).push(this.renderYear(n));return r.map((n,i)=>p.jsx("tr",{children:n},i))}renderYear(t){const r=this.getSelectedYear();let n="rdtYear",i;this.isDisabledYear(t)?n+=" rdtDisabled":i=this._updateSelectedYear,r===t&&(n+=" rdtActive");let a={key:t,className:n,"data-value":t,onClick:i};return this.props.renderYear(a,t,this.props.selectedDate&&this.props.selectedDate.clone())}getViewYear(){return parseInt(this.props.viewDate.year()/10,10)*10}getSelectedYear(){return this.props.selectedDate&&this.props.selectedDate.year()}isDisabledYear(t){let r=this.disabledYearsCache;if(r[t]!==void 0)return r[t];let n=this.props.isValidDate;if(!n)return!1;let i=this.props.viewDate.clone().set({year:t}),a=i.endOf("year").dayOfYear()+1;for(;a-- >1;)if(n(i.dayOfYear(a)))return r[t]=!1,!1;return r[t]=!0,!0}};H4.defaultProps={renderYear:(t,r)=>p.jsx("td",{...t,children:r})};let zh=H4;function _ue(e,t){return t<3?e[0]:t<7?e[1]:e[2]}function Que(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Gh(e,t)}function Gh(e,t){return Gh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Gh(e,t)}function Kue(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function Tx(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function que(e,t,r){return e===t?!0:e.correspondingElement?e.correspondingElement.classList.contains(r):e.classList.contains(r)}function $ue(e,t,r){if(e===t)return!0;for(;e.parentNode||e.host;){if(e.parentNode&&que(e,t,r))return!0;e=e.parentNode||e.host}return e}function ede(e){return document.documentElement.clientWidth<=e.clientX||document.documentElement.clientHeight<=e.clientY}var tde=function(){if(!(typeof window>"u"||typeof window.addEventListener!="function")){var t=!1,r=Object.defineProperty({},"passive",{get:function(){t=!0}}),n=function(){};return window.addEventListener("testPassiveEventSupport",n,r),window.removeEventListener("testPassiveEventSupport",n,r),t}};function rde(e){return e===void 0&&(e=0),function(){return++e}}var nde=rde(),Uh,Z0={},Zh={},ide=["touchstart","touchmove"],ade="ignore-react-onclickoutside";function Mx(e,t){var r={},n=ide.indexOf(t)!==-1;return n&&Uh&&(r.passive=!e.props.preventDefault),r}function ode(e,t){var r,n,i=e.displayName||e.name||"Component";return n=r=function(a){Que(o,a);function o(c){var u;return u=a.call(this,c)||this,u.__outsideClickHandler=function(f){if(typeof u.__clickOutsideHandlerProp=="function"){u.__clickOutsideHandlerProp(f);return}var A=u.getInstance();if(typeof A.props.handleClickOutside=="function"){A.props.handleClickOutside(f);return}if(typeof A.handleClickOutside=="function"){A.handleClickOutside(f);return}throw new Error("WrappedComponent: "+i+" lacks a handleClickOutside(event) function for processing outside click events.")},u.__getComponentNode=function(){var f=u.getInstance();return t&&typeof t.setClickOutsideRef=="function"?t.setClickOutsideRef()(f):typeof f.setClickOutsideRef=="function"?f.setClickOutsideRef():is.findDOMNode(f)},u.enableOnClickOutside=function(){if(!(typeof document>"u"||Zh[u._uid])){typeof Uh>"u"&&(Uh=tde()),Zh[u._uid]=!0;var f=u.props.eventTypes;f.forEach||(f=[f]),Z0[u._uid]=function(A){if(u.componentNode!==null&&(u.props.preventDefault&&A.preventDefault(),u.props.stopPropagation&&A.stopPropagation(),!(u.props.excludeScrollbar&&ede(A)))){var h=A.composed&&A.composedPath&&A.composedPath().shift()||A.target;$ue(h,u.componentNode,u.props.outsideClickIgnoreClass)===document&&u.__outsideClickHandler(A)}},f.forEach(function(A){document.addEventListener(A,Z0[u._uid],Mx(Tx(u),A))})}},u.disableOnClickOutside=function(){delete Zh[u._uid];var f=Z0[u._uid];if(f&&typeof document<"u"){var A=u.props.eventTypes;A.forEach||(A=[A]),A.forEach(function(h){return document.removeEventListener(h,f,Mx(Tx(u),h))}),delete Z0[u._uid]}},u.getRef=function(f){return u.instanceRef=f},u._uid=nde(),u}var s=o.prototype;return s.getInstance=function(){if(e.prototype&&!e.prototype.isReactComponent)return this;var u=this.instanceRef;return u.getInstance?u.getInstance():u},s.componentDidMount=function(){if(!(typeof document>"u"||!document.createElement)){var u=this.getInstance();if(t&&typeof t.handleClickOutside=="function"&&(this.__clickOutsideHandlerProp=t.handleClickOutside(u),typeof this.__clickOutsideHandlerProp!="function"))throw new Error("WrappedComponent: "+i+" lacks a function for processing outside click events specified by the handleClickOutside config option.");this.componentNode=this.__getComponentNode(),!this.props.disableOnClickOutside&&this.enableOnClickOutside()}},s.componentDidUpdate=function(){this.componentNode=this.__getComponentNode()},s.componentWillUnmount=function(){this.disableOnClickOutside()},s.render=function(){var u=this.props;u.excludeScrollbar;var f=Kue(u,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?f.ref=this.getRef:f.wrappedRef=this.getRef,f.disableOnClickOutside=this.disableOnClickOutside,f.enableOnClickOutside=this.enableOnClickOutside,x.createElement(e,f)},o}(x.Component),r.displayName="OnClickOutside("+i+")",r.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:ade,preventDefault:!1,stopPropagation:!1},r.getClass=function(){return e.getClass?e.getClass():e},n}const Ua={YEARS:"years",MONTHS:"months",DAYS:"days",TIME:"time"},Za=function(){},o1=class o1 extends x.Component{constructor(t){super(t),this._renderCalendar=()=>{const r=this.props,n=this.state;let i={viewDate:n.viewDate.clone(),label:r.label,isSecondDatePicker:r.isSecondDatePicker,secondValue:r.secondValue,selectedDate:this.getSelectedDate(),isValidDate:r.isValidDate,updateDate:this._updateDate,navigate:this._viewNavigate,moment:xe,showView:this._showView};switch(n.currentView){case Ua.YEARS:return i.renderYear=r.renderYear,p.jsx(zh,{...i});case Ua.MONTHS:return i.renderMonth=r.renderMonth,p.jsx(Yue,{...i});case Ua.DAYS:return i.renderDay=r.renderDay,i.timeFormat=this.getFormat("time"),i.setTime=this._setTime,i.value=this.props.value,i.disabled=this.props.disabled,p.jsx(U0,{...i});default:return i.renderDay=r.renderDay,i.timeFormat=this.getFormat("time"),i.setTime=this._setTime,i.value=this.props.value,p.jsx(U0,{...i})}},this._showView=(r,n)=>{const i=(n||this.state.viewDate).clone(),a=this.props.onBeforeNavigate(r,this.state.currentView,i);a&&this.state.currentView!==a&&(this.props.onNavigate(a),this.setState({currentView:a}))},this.viewToMethod={days:"date",months:"month",years:"year"},this.nextView={days:"time",months:"days",years:"months"},this._updateDate=r=>{let i=this.state.currentView,a=this.getUpdateOn(this.getFormat("date")),o=this.state.viewDate.clone();o[this.viewToMethod[i]](parseInt(r.target.getAttribute("data-value"),10)),i==="days"&&(o.month(parseInt(r.target.getAttribute("data-month"),10)),o.year(parseInt(r.target.getAttribute("data-year"),10)));let s={viewDate:o};i===a?(s.selectedDate=o.clone(),s.inputValue=o.format(this.getFormat("datetime")),this.props.open===void 0&&this.props.input&&this.props.closeOnSelect&&this._closeCalendar(),this.props.onChange(o.clone())):this._showView(this.nextView[i],o),this.setState(s)},this._viewNavigate=(r,n)=>{let i=this.state.viewDate.clone();i.add(r,n),r>0?this.props.onNavigateForward(r,n):this.props.onNavigateBack(-r,n),this.setState({viewDate:i})},this._setTime=(r,n)=>{let i=(this.getSelectedDate()||this.state.viewDate).clone();i[r](n),this.props.value||this.setState({selectedDate:i,viewDate:i.clone(),inputValue:i.format(this.getFormat("datetime"))}),this.props.onChange(i)},this._openCalendar=()=>{this.isOpen()||this.setState({open:!0},this.props.onOpen)},this._closeCalendar=()=>{this.isOpen()&&this.setState({open:!1},()=>{this.props.onClose(this.state.selectedDate||this.state.inputValue)})},this._handleClickOutside=()=>{let r=this.props;r.input&&this.state.open&&r.open===void 0&&r.closeOnClickOutside&&this._closeCalendar()},this._onInputFocus=r=>{this.callHandler(this.props.inputProps.onFocus,r)&&this._openCalendar()},this._onInputChange=r=>{if(!this.callHandler(this.props.inputProps.onChange,r))return;const n=r.target?r.target.value:r,i=this.localMoment(n,this.getFormat("datetime"));let a={inputValue:n};i.isValid()?(a.selectedDate=i,a.viewDate=i.clone().startOf("month")):a.selectedDate=null,this.setState(a,()=>{this.props.onChange(i.isValid()?i:this.state.inputValue)})},this._onInputKeyDown=r=>{this.callHandler(this.props.inputProps.onKeyDown,r)&&r.which===9&&this.props.closeOnTab&&this._closeCalendar()},this._onInputClick=r=>{this.callHandler(this.props.inputProps.onClick,r)&&this._openCalendar()},this.state=this.getInitialState()}render(){return p.jsxs(lde,{className:this.getClassName(),onClickOut:this._handleClickOutside,children:[this.renderInput(),p.jsx("div",{className:"rdtPicker",children:this.renderView()})]})}renderInput(){if(!this.props.input)return;const t={type:"text",className:"form-control",value:this.getInputValue(),...this.props.inputProps,onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick};return this.props.renderInput?p.jsx("div",{children:this.props.renderInput(t,this._openCalendar,this._closeCalendar)}):p.jsx("input",{...t})}renderView(){return this.props.renderView(this.state.currentView,this._renderCalendar)}getInitialState(){let t=this.props,r=this.getFormat("datetime"),n=this.parseDate(t.value||t.initialValue,r);return this.checkTZ(),{open:!t.input,currentView:t.initialViewMode||this.getInitialView(),viewDate:this.getInitialViewDate(n),selectedDate:n&&n.isValid()?n:void 0,inputValue:this.getInitialInputValue(n)}}getInitialViewDate(t){const r=this.props.initialViewDate;let n;if(r){if(n=this.parseDate(r,this.getFormat("datetime")),n&&n.isValid())return n;console.log('The initialViewDated given "'+r+'" is not valid. Using current date instead.')}else if(t&&t.isValid())return t.clone();return this.getInitialDate()}getInitialDate(){let t=this.localMoment();return t.hour(0).minute(0).second(0).millisecond(0),t}getInitialView(){const t=this.getFormat("date");return t?this.getUpdateOn(t):Ua.TIME}parseDate(t,r){let n;return t&&typeof t=="string"?n=this.localMoment(t,r):t&&(n=this.localMoment(t)),n&&!n.isValid()&&(n=null),n}getClassName(){let t="rdt",r=this.props,n=r.className;return Array.isArray(n)?t+=" "+n.join(" "):n&&(t+=" "+n),r.input||(t+=" rdtStatic"),this.isOpen()&&(t+=" rdtOpen"),t}isOpen(){return!this.props.input||(this.props.open===void 0?this.state.open:this.props.open)}getUpdateOn(t){return this.props.updateOnView?this.props.updateOnView:t.match(/[lLD]/)?Ua.DAYS:t.indexOf("M")!==-1?Ua.MONTHS:t.indexOf("Y")!==-1?Ua.YEARS:Ua.DAYS}getLocaleData(){let t=this.props;return this.localMoment(t.value||t.defaultValue||new Date).localeData()}getDateFormat(){const t=this.getLocaleData();let r=this.props.dateFormat;return r===!0?t.longDateFormat("L"):r||""}getTimeFormat(){const t=this.getLocaleData();let r=this.props.timeFormat;return r===!0?t.longDateFormat("LT"):r||""}getFormat(t){if(t==="date")return this.getDateFormat();if(t==="time")return this.getTimeFormat();let r=this.getDateFormat(),n=this.getTimeFormat();return r&&n?r+" "+n:r||n}updateTime(t,r,n,i){let a={};const o=i?"selectedDate":"viewDate";a[o]=this.state[o].clone()[t](r,n),this.setState(a)}localMoment(t,r,n){n=n||this.props;let i=null;return n.utc?i=xe.utc(t,r,n.strictParsing):n.displayTimeZone?i=xe.tz(t,r,n.displayTimeZone):i=xe(t,r,n.strictParsing),n.locale&&i.locale(n.locale),i}checkTZ(){const{displayTimeZone:t}=this.props;t&&!this.tzWarning&&!xe.tz&&(this.tzWarning=!0)}componentDidUpdate(t){if(t===this.props)return;let r=!1,n=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach(function(i){t[i]!==n[i]&&(r=!0)}),r&&this.regenerateDates(),n.value&&n.value!==t.value&&this.setViewDate(n.value),this.checkTZ()}regenerateDates(){const t=this.props;let r=this.state.viewDate.clone(),n=this.state.selectedDate&&this.state.selectedDate.clone();t.locale&&(r.locale(t.locale),n&&n.locale(t.locale)),t.utc?(r.utc(),n&&n.utc()):t.displayTimeZone?(r.tz(t.displayTimeZone),n&&n.tz(t.displayTimeZone)):(r.locale(),n&&n.locale());let i={viewDate:r,selectedDate:n};n&&n.isValid()&&(i.inputValue=n.format(this.getFormat("datetime"))),this.setState(i)}getSelectedDate(){if(this.props.value===void 0)return this.state.selectedDate;let t=this.parseDate(this.props.value,this.getFormat("datetime"));return t&&t.isValid()?t:!1}getInitialInputValue(t){const r=this.props;return r.inputProps.value?r.inputProps.value:t&&t.isValid()?t.format(this.getFormat("datetime")):r.value&&typeof r.value=="string"?r.value:r.initialValue&&typeof r.initialValue=="string"?r.initialValue:""}getInputValue(){let t=this.getSelectedDate();return t?t.format(this.getFormat("datetime")):this.state.inputValue}setViewDate(t){let r=function(){return console.log("Invalid date passed to the `setViewDate` method: "+t)};if(!t)return r();let n;if(typeof t=="string"?n=this.localMoment(t,this.getFormat("datetime")):n=this.localMoment(t),!n||!n.isValid())return r();this.setState({viewDate:n})}navigate(t){this._showView(t)}callHandler(t,r){return t?t(r)!==!1:!0}};o1.defaultProps={onOpen:Za,onClose:Za,onCalendarOpen:Za,onCalendarClose:Za,onChange:Za,onNavigate:Za,onBeforeNavigate:function(t){return t},onNavigateBack:Za,onNavigateForward:Za,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0,renderView:(t,r)=>r()},o1.moment=xe;let Yh=o1;class sde extends x.Component{constructor(){super(...arguments),this.container=x.createRef()}render(){return p.jsx("div",{className:this.props.className,ref:this.container,children:this.props.children})}handleClickOutside(t){this.props.onClickOut(t)}setClickOutsideRef(){return this.container.current}}const lde=ode(sde);//! moment.js locale configuration
1733
+ `,zue=({setTime:e,value:t,disabled:r})=>{var A,h;const n=((A=t==null?void 0:t.getHours)==null?void 0:A.call(t))??0,i=((h=t==null?void 0:t.getMinutes)==null?void 0:h.call(t))??0,[a,o]=x.useState(n),[s,c]=x.useState(i),u=x.useCallback(g=>{const[m,b]=g.target.value.split(":");o(Number(m)),c(Number(b))},[]);x.useEffect(()=>{t&&e("hours",a)},[a]),x.useEffect(()=>{t&&e("minutes",s)},[s]);const f=`${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`;return p.jsx(Be.div,{borderTop:"1px solid",borderColor:"lightGray2",pt:"8px",mb:"8px",children:p.jsxs(z0,{disabled:r||!t,children:[p.jsxs(Be.div,{children:[p.jsx(rt,{icon:"clock"}),p.jsx(G0,{children:je._({id:"dataGrid.filterCell.time",message:"Time"})})]}),p.jsx(Be.div,{display:"flex",alignItems:"center",children:p.jsx(Hue,{type:"time",onChange:u,disabled:r||!t,value:f})})]})})};function Hh({onClickPrev:e,onClickSwitch:t,onClickNext:r,switchContent:n,switchColSpan:i,switchProps:a,label:o}){return p.jsxs("tr",{children:[p.jsx("th",{className:"rdtPrev",onClick:e,children:p.jsx("span",{children:"‹"})}),p.jsx("th",{className:"rdtSwitch",colSpan:i,onClick:t,...a,children:n}),p.jsx("th",{className:"rdtNext",onClick:r,children:p.jsx("span",{children:"›"})}),p.jsx("th",{colSpan:2,className:"rdtLabel",children:o&&o})]})}const Gue=({setDate:e,isSecondDatePicker:t})=>{const r=new Date,n=new Date(r.getTime()-24*60*60*1e3),i=new Date(r.getTime()+24*60*60*1e3),a=new Date(r.getTime()-24*60*60*1e3*7),o=new Date(r.getTime()+24*60*60*1e3*7);return p.jsxs(Be.div,{borderTop:"1px solid",borderColor:"lightGray2",mt:"8px",pt:"8px",mb:"8px",children:[p.jsxs(z0,{children:[p.jsxs(Be.div,{display:"flex",alignItems:"center",flex:"1",children:[p.jsx(rt,{icon:"calendar"}),p.jsx(G0,{onClick:e,"data-value":r.getDate(),"data-month":r.getMonth(),"data-year":r.getFullYear(),children:je._({id:"dataGrid.filterCell.today",message:"Today"})})]}),p.jsxs(Be.div,{textTransform:"capitalize",children:[new Intl.DateTimeFormat(void 0,{weekday:"short"}).format(r),","," ",new Intl.DateTimeFormat(void 0,{month:"short"}).format(r)," ",r.getDate()]})]}),p.jsxs(z0,{children:[p.jsxs(Be.div,{display:"flex",alignItems:"center",flex:"1",children:[p.jsx(rt,{icon:"calendar"}),p.jsx(G0,{onClick:e,"data-value":(t?i:n).getDate(),"data-month":(t?i:n).getMonth(),"data-year":(t?i:n).getFullYear(),children:t?je._({id:"dataGrid.filterCell.tomorrow",message:"Tomorrow"}):je._({id:"dataGrid.filterCell.yesterday",message:"Yesterday"})})]}),p.jsx(Be.div,{children:p.jsxs(Be.div,{textTransform:"capitalize",children:[new Intl.DateTimeFormat(void 0,{weekday:"short"}).format(t?i:n),","," ",new Intl.DateTimeFormat(void 0,{month:"short"}).format(t?i:n)," ",t?i.getDate():n.getDate()]})})]}),p.jsxs(z0,{children:[p.jsxs(Be.div,{display:"flex",alignItems:"center",flex:"1",children:[p.jsx(rt,{icon:"calendar"}),p.jsx(G0,{onClick:e,"data-value":t?o.getDate():a.getDate(),"data-month":t?o.getMonth():a.getMonth(),"data-year":t?o.getFullYear():a.getFullYear(),children:t?je._({id:"dataGrid.filterCell.nextWeek",message:"Next week"}):je._({id:"dataGrid.filterCell.lastWeek",message:"Last week"})})]}),p.jsxs(Be.div,{textTransform:"capitalize",children:[new Intl.DateTimeFormat(void 0,{weekday:"short"}).format(t?o:a),","," ",new Intl.DateTimeFormat(void 0,{month:"short"}).format(t?o:a)," ",t?o.getDate():a.getDate()]})]})]})},W4=class W4 extends x.Component{constructor(){super(...arguments),this._setDate=t=>{this.props.updateDate(t)}}render(){return p.jsx("div",{className:"rdtDays",children:p.jsxs("table",{children:[p.jsxs("thead",{children:[this.renderNavigation(),this.renderDayHeaders()]}),p.jsx("tbody",{children:this.renderDays()}),this.renderFooter()]})})}renderNavigation(){const t=this.props.viewDate,r=t.localeData(),n=this.props.label;return p.jsx(Hh,{onClickPrev:()=>this.props.navigate(-1,"months"),onClickSwitch:()=>this.props.showView("months"),onClickNext:()=>this.props.navigate(1,"months"),switchContent:r.months(t,"DD[]MMMM")+" "+t.year(),switchColSpan:3,label:n,switchProps:{"data-value":this.props.viewDate.month()}})}renderDayHeaders(){const t=this.props.viewDate.localeData();let r=Zue(t).map((n,i)=>p.jsx("th",{className:"dow",children:n},n+i));return p.jsx("tr",{children:r})}renderDays(){const t=this.props.viewDate,r=t.clone().startOf("month"),n=t.clone().endOf("month");let i=[[],[],[],[],[],[]],a=t.clone().subtract(1,"months");a.date(a.daysInMonth()).startOf("week");let o=a.clone().add(42,"d"),s=0;for(;a.isBefore(o);)Uue(i,s++).push(this.renderDay(a,r,n)),a.add(1,"d");return i.map((c,u)=>p.jsx("tr",{children:c},`${o.month()}_${u}`))}renderDay(t,r,n){let i=this.props.selectedDate,a=this.props.secondValue,o={key:t.format("M_D"),"data-value":t.date(),"data-month":t.month(),"data-year":t.year()},s="rdtDay";return t.isBefore(r)?s+=" rdtOld":t.isAfter(n)&&(s+=" rdtNew"),a&&t.isBefore(a)&&t.isAfter(i)&&(s+=" rdtActiveRange"),a&&t.isAfter(a)&&t.isBefore(i)&&(s+=" rdtActiveRange"),i&&t.isSame(i,"day")&&(s+=" rdtActive"),a&&t.isSame(a,"day")&&(s+=" rdtActiveSecond"),t.isSame(this.props.moment(),"day")&&(s+=" rdtToday"),this.props.isValidDate(t)?o.onClick=this._setDate:s+=" rdtDisabled",o.className=s,this.props.renderDay(o,t.clone(),i&&i.clone())}renderFooter(){const t=this.props.setTime,r=this._setDate,n=this.props.value,i=this.props.disabled;return p.jsx("tfoot",{children:p.jsx("tr",{children:p.jsxs("td",{colSpan:7,children:[p.jsx(Gue,{setDate:r,isSecondDatePicker:this.props.isSecondDatePicker}),this.props.timeFormat&&p.jsx(zue,{setTime:t,value:n,disabled:i})]})})})}};W4.defaultProps={isValidDate:()=>!0,renderDay:(t,r)=>p.jsx("td",{...t,children:r.date()})};let U0=W4;function Uue(e,t){return e[Math.floor(t/7)]}function Zue(e){const t=e.firstDayOfWeek();let r=[],n=0;return e._weekdaysMin.forEach(function(i){r[(7+n++-t)%7]=i}),r}class Yue extends x.Component{constructor(){super(...arguments),this._updateSelectedMonth=t=>{this.props.updateDate(t)}}render(){return p.jsxs("div",{className:"rdtMonths",children:[p.jsx("table",{children:p.jsx("thead",{children:this.renderNavigation()})}),p.jsx("table",{children:p.jsx("tbody",{children:this.renderMonths()})})]})}renderNavigation(){let t=this.props.viewDate.year();return p.jsx(Hh,{onClickPrev:()=>this.props.navigate(-1,"years"),onClickSwitch:()=>this.props.showView("years"),onClickNext:()=>this.props.navigate(1,"years"),switchContent:t,switchColSpan:"2"})}renderMonths(){let t=[[],[],[]];for(let r=0;r<12;r++)Jue(t,r).push(this.renderMonth(r));return t.map((r,n)=>p.jsx("tr",{children:r},n))}renderMonth(t){const r=this.props.selectedDate;let n="rdtMonth",i;this.isDisabledMonth(t)?n+=" rdtDisabled":i=this._updateSelectedMonth,r&&r.year()===this.props.viewDate.year()&&r.month()===t&&(n+=" rdtActive");let a={key:t,className:n,"data-value":t,onClick:i};return this.props.renderMonth?this.props.renderMonth(a,t,this.props.viewDate.year(),this.props.selectedDate&&this.props.selectedDate.clone()):p.jsx("td",{...a,children:this.getMonthText(t)})}isDisabledMonth(t){let r=this.props.isValidDate;if(!r)return!1;let n=this.props.viewDate.clone().set({month:t}),i=n.endOf("month").date()+1;for(;i-- >1;)if(r(n.date(i)))return!1;return!0}getMonthText(t){const r=this.props.viewDate,n=r.localeData().monthsShort(r.month(t));return Xue(n.substring(0,3))}}function Jue(e,t){return t<4?e[0]:t<8?e[1]:e[2]}function Xue(e){return e.charAt(0).toUpperCase()+e.slice(1)}const H4=class H4 extends x.Component{constructor(){super(...arguments),this.disabledYearsCache={},this._updateSelectedYear=t=>{this.props.updateDate(t)}}render(){return p.jsxs("div",{className:"rdtYears",children:[p.jsx("table",{children:p.jsx("thead",{children:this.renderNavigation()})}),p.jsx("table",{children:p.jsx("tbody",{children:this.renderYears()})})]})}renderNavigation(){const t=this.getViewYear();return p.jsx(Hh,{onClickPrev:()=>this.props.navigate(-10,"years"),onClickSwitch:()=>this.props.showView("years"),onClickNext:()=>this.props.navigate(10,"years"),switchContent:`${t}-${t+9}`})}renderYears(){const t=this.getViewYear();let r=[[],[],[]];for(let n=t-1;n<t+11;n++)_ue(r,n-t).push(this.renderYear(n));return r.map((n,i)=>p.jsx("tr",{children:n},i))}renderYear(t){const r=this.getSelectedYear();let n="rdtYear",i;this.isDisabledYear(t)?n+=" rdtDisabled":i=this._updateSelectedYear,r===t&&(n+=" rdtActive");let a={key:t,className:n,"data-value":t,onClick:i};return this.props.renderYear(a,t,this.props.selectedDate&&this.props.selectedDate.clone())}getViewYear(){return parseInt(this.props.viewDate.year()/10,10)*10}getSelectedYear(){return this.props.selectedDate&&this.props.selectedDate.year()}isDisabledYear(t){let r=this.disabledYearsCache;if(r[t]!==void 0)return r[t];let n=this.props.isValidDate;if(!n)return!1;let i=this.props.viewDate.clone().set({year:t}),a=i.endOf("year").dayOfYear()+1;for(;a-- >1;)if(n(i.dayOfYear(a)))return r[t]=!1,!1;return r[t]=!0,!0}};H4.defaultProps={renderYear:(t,r)=>p.jsx("td",{...t,children:r})};let zh=H4;function _ue(e,t){return t<3?e[0]:t<7?e[1]:e[2]}function Que(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Gh(e,t)}function Gh(e,t){return Gh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Gh(e,t)}function Kue(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function Tx(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function que(e,t,r){return e===t?!0:e.correspondingElement?e.correspondingElement.classList.contains(r):e.classList.contains(r)}function $ue(e,t,r){if(e===t)return!0;for(;e.parentNode||e.host;){if(e.parentNode&&que(e,t,r))return!0;e=e.parentNode||e.host}return e}function ede(e){return document.documentElement.clientWidth<=e.clientX||document.documentElement.clientHeight<=e.clientY}var tde=function(){if(!(typeof window>"u"||typeof window.addEventListener!="function")){var t=!1,r=Object.defineProperty({},"passive",{get:function(){t=!0}}),n=function(){};return window.addEventListener("testPassiveEventSupport",n,r),window.removeEventListener("testPassiveEventSupport",n,r),t}};function rde(e){return e===void 0&&(e=0),function(){return++e}}var nde=rde(),Uh,Z0={},Zh={},ide=["touchstart","touchmove"],ade="ignore-react-onclickoutside";function Mx(e,t){var r={},n=ide.indexOf(t)!==-1;return n&&Uh&&(r.passive=!e.props.preventDefault),r}function ode(e,t){var r,n,i=e.displayName||e.name||"Component";return n=r=function(a){Que(o,a);function o(c){var u;return u=a.call(this,c)||this,u.__outsideClickHandler=function(f){if(typeof u.__clickOutsideHandlerProp=="function"){u.__clickOutsideHandlerProp(f);return}var A=u.getInstance();if(typeof A.props.handleClickOutside=="function"){A.props.handleClickOutside(f);return}if(typeof A.handleClickOutside=="function"){A.handleClickOutside(f);return}throw new Error("WrappedComponent: "+i+" lacks a handleClickOutside(event) function for processing outside click events.")},u.__getComponentNode=function(){var f=u.getInstance();return t&&typeof t.setClickOutsideRef=="function"?t.setClickOutsideRef()(f):typeof f.setClickOutsideRef=="function"?f.setClickOutsideRef():is.findDOMNode(f)},u.enableOnClickOutside=function(){if(!(typeof document>"u"||Zh[u._uid])){typeof Uh>"u"&&(Uh=tde()),Zh[u._uid]=!0;var f=u.props.eventTypes;f.forEach||(f=[f]),Z0[u._uid]=function(A){if(u.componentNode!==null&&(u.props.preventDefault&&A.preventDefault(),u.props.stopPropagation&&A.stopPropagation(),!(u.props.excludeScrollbar&&ede(A)))){var h=A.composed&&A.composedPath&&A.composedPath().shift()||A.target;$ue(h,u.componentNode,u.props.outsideClickIgnoreClass)===document&&u.__outsideClickHandler(A)}},f.forEach(function(A){document.addEventListener(A,Z0[u._uid],Mx(Tx(u),A))})}},u.disableOnClickOutside=function(){delete Zh[u._uid];var f=Z0[u._uid];if(f&&typeof document<"u"){var A=u.props.eventTypes;A.forEach||(A=[A]),A.forEach(function(h){return document.removeEventListener(h,f,Mx(Tx(u),h))}),delete Z0[u._uid]}},u.getRef=function(f){return u.instanceRef=f},u._uid=nde(),u}var s=o.prototype;return s.getInstance=function(){if(e.prototype&&!e.prototype.isReactComponent)return this;var u=this.instanceRef;return u.getInstance?u.getInstance():u},s.componentDidMount=function(){if(!(typeof document>"u"||!document.createElement)){var u=this.getInstance();if(t&&typeof t.handleClickOutside=="function"&&(this.__clickOutsideHandlerProp=t.handleClickOutside(u),typeof this.__clickOutsideHandlerProp!="function"))throw new Error("WrappedComponent: "+i+" lacks a function for processing outside click events specified by the handleClickOutside config option.");this.componentNode=this.__getComponentNode(),!this.props.disableOnClickOutside&&this.enableOnClickOutside()}},s.componentDidUpdate=function(){this.componentNode=this.__getComponentNode()},s.componentWillUnmount=function(){this.disableOnClickOutside()},s.render=function(){var u=this.props;u.excludeScrollbar;var f=Kue(u,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?f.ref=this.getRef:f.wrappedRef=this.getRef,f.disableOnClickOutside=this.disableOnClickOutside,f.enableOnClickOutside=this.enableOnClickOutside,x.createElement(e,f)},o}(x.Component),r.displayName="OnClickOutside("+i+")",r.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:ade,preventDefault:!1,stopPropagation:!1},r.getClass=function(){return e.getClass?e.getClass():e},n}const Ua={YEARS:"years",MONTHS:"months",DAYS:"days",TIME:"time"},Za=function(){},o1=class o1 extends x.Component{constructor(t){super(t),this._renderCalendar=()=>{const r=this.props,n=this.state;let i={viewDate:n.viewDate.clone(),label:r.label,isSecondDatePicker:r.isSecondDatePicker,secondValue:r.secondValue,selectedDate:this.getSelectedDate(),isValidDate:r.isValidDate,updateDate:this._updateDate,navigate:this._viewNavigate,moment:xe,showView:this._showView};switch(n.currentView){case Ua.YEARS:return i.renderYear=r.renderYear,p.jsx(zh,{...i});case Ua.MONTHS:return i.renderMonth=r.renderMonth,p.jsx(Yue,{...i});case Ua.DAYS:return i.renderDay=r.renderDay,i.timeFormat=this.getFormat("time"),i.setTime=this._setTime,i.value=this.props.value,i.disabled=this.props.disabled,p.jsx(U0,{...i});default:return i.renderDay=r.renderDay,i.timeFormat=this.getFormat("time"),i.setTime=this._setTime,i.value=this.props.value,p.jsx(U0,{...i})}},this._showView=(r,n)=>{const i=(n||this.state.viewDate).clone(),a=this.props.onBeforeNavigate(r,this.state.currentView,i);a&&this.state.currentView!==a&&(this.props.onNavigate(a),this.setState({currentView:a}))},this.viewToMethod={days:"date",months:"month",years:"year"},this.nextView={days:"time",months:"days",years:"months"},this._updateDate=r=>{let i=this.state.currentView,a=this.getUpdateOn(this.getFormat("date")),o=this.state.viewDate.clone();o[this.viewToMethod[i]](parseInt(r.target.getAttribute("data-value"),10)),i==="days"&&(o.month(parseInt(r.target.getAttribute("data-month"),10)),o.year(parseInt(r.target.getAttribute("data-year"),10)));let s={viewDate:o};i===a?(s.selectedDate=o.clone(),s.inputValue=o.format(this.getFormat("datetime")),this.props.open===void 0&&this.props.input&&this.props.closeOnSelect&&this._closeCalendar(),this.props.onChange(o.clone())):this._showView(this.nextView[i],o),this.setState(s)},this._viewNavigate=(r,n)=>{let i=this.state.viewDate.clone();i.add(r,n),r>0?this.props.onNavigateForward(r,n):this.props.onNavigateBack(-r,n),this.setState({viewDate:i})},this._setTime=(r,n)=>{let i=(this.getSelectedDate()||this.state.viewDate).clone();i[r](n),this.props.value||this.setState({selectedDate:i,viewDate:i.clone(),inputValue:i.format(this.getFormat("datetime"))}),this.props.onChange(i)},this._openCalendar=()=>{this.isOpen()||this.setState({open:!0},this.props.onOpen)},this._closeCalendar=()=>{this.isOpen()&&this.setState({open:!1},()=>{this.props.onClose(this.state.selectedDate||this.state.inputValue)})},this._handleClickOutside=()=>{let r=this.props;r.input&&this.state.open&&r.open===void 0&&r.closeOnClickOutside&&this._closeCalendar()},this._onInputFocus=r=>{this.callHandler(this.props.inputProps.onFocus,r)&&this._openCalendar()},this._onInputChange=r=>{if(!this.callHandler(this.props.inputProps.onChange,r))return;const n=r.target?r.target.value:r,i=this.localMoment(n,this.getFormat("datetime"));let a={inputValue:n};i.isValid()?(a.selectedDate=i,a.viewDate=i.clone().startOf("month")):a.selectedDate=null,this.setState(a,()=>{this.props.onChange(i.isValid()?i:this.state.inputValue)})},this._onInputKeyDown=r=>{this.callHandler(this.props.inputProps.onKeyDown,r)&&r.which===9&&this.props.closeOnTab&&this._closeCalendar()},this._onInputClick=r=>{this.callHandler(this.props.inputProps.onClick,r)&&this._openCalendar()},this.state=this.getInitialState()}render(){return p.jsxs(lde,{className:this.getClassName(),onClickOut:this._handleClickOutside,children:[this.renderInput(),p.jsx("div",{className:"rdtPicker",children:this.renderView()})]})}renderInput(){if(!this.props.input)return;const t={type:"text",className:"form-control",value:this.getInputValue(),...this.props.inputProps,onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick};return this.props.renderInput?p.jsx("div",{children:this.props.renderInput(t,this._openCalendar,this._closeCalendar)}):p.jsx("input",{...t})}renderView(){return this.props.renderView(this.state.currentView,this._renderCalendar)}getInitialState(){let t=this.props,r=this.getFormat("datetime"),n=this.parseDate(t.value||t.initialValue,r);return this.checkTZ(),{open:!t.input,currentView:t.initialViewMode||this.getInitialView(),viewDate:this.getInitialViewDate(n),selectedDate:n&&n.isValid()?n:void 0,inputValue:this.getInitialInputValue(n)}}getInitialViewDate(t){const r=this.props.initialViewDate;let n;if(r){if(n=this.parseDate(r,this.getFormat("datetime")),n&&n.isValid())return n;console.log('The initialViewDated given "'+r+'" is not valid. Using current date instead.')}else if(t&&t.isValid())return t.clone();return this.getInitialDate()}getInitialDate(){let t=this.localMoment();return t.hour(0).minute(0).second(0).millisecond(0),t}getInitialView(){const t=this.getFormat("date");return t?this.getUpdateOn(t):Ua.TIME}parseDate(t,r){let n;return t&&typeof t=="string"?n=this.localMoment(t,r):t&&(n=this.localMoment(t)),n&&!n.isValid()&&(n=null),n}getClassName(){let t="rdt",r=this.props,n=r.className;return Array.isArray(n)?t+=" "+n.join(" "):n&&(t+=" "+n),r.input||(t+=" rdtStatic"),this.isOpen()&&(t+=" rdtOpen"),t}isOpen(){return!this.props.input||(this.props.open===void 0?this.state.open:this.props.open)}getUpdateOn(t){return this.props.updateOnView?this.props.updateOnView:t.match(/[lLD]/)?Ua.DAYS:t.indexOf("M")!==-1?Ua.MONTHS:t.indexOf("Y")!==-1?Ua.YEARS:Ua.DAYS}getLocaleData(){let t=this.props;return this.localMoment(t.value||t.defaultValue||new Date).localeData()}getDateFormat(){const t=this.getLocaleData();let r=this.props.dateFormat;return r===!0?t.longDateFormat("L"):r||""}getTimeFormat(){const t=this.getLocaleData();let r=this.props.timeFormat;return r===!0?t.longDateFormat("LT"):r||""}getFormat(t){if(t==="date")return this.getDateFormat();if(t==="time")return this.getTimeFormat();let r=this.getDateFormat(),n=this.getTimeFormat();return r&&n?r+" "+n:r||n}updateTime(t,r,n,i){let a={};const o=i?"selectedDate":"viewDate";a[o]=this.state[o].clone()[t](r,n),this.setState(a)}localMoment(t,r,n){n=n||this.props;let i=null;return n.utc?i=xe.utc(t,r,n.strictParsing):n.displayTimeZone?i=xe.tz(t,r,n.displayTimeZone):i=xe(t,r,n.strictParsing),n.locale&&i.locale(n.locale),i}checkTZ(){const{displayTimeZone:t}=this.props;t&&!this.tzWarning&&!xe.tz&&(this.tzWarning=!0)}componentDidUpdate(t){if(t===this.props)return;let r=!1,n=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach(function(i){t[i]!==n[i]&&(r=!0)}),r&&this.regenerateDates(),n.value&&n.value!==t.value&&this.setViewDate(n.value),this.checkTZ()}regenerateDates(){const t=this.props;let r=this.state.viewDate.clone(),n=this.state.selectedDate&&this.state.selectedDate.clone();t.locale&&(r.locale(t.locale),n&&n.locale(t.locale)),t.utc?(r.utc(),n&&n.utc()):t.displayTimeZone?(r.tz(t.displayTimeZone),n&&n.tz(t.displayTimeZone)):(r.locale(),n&&n.locale());let i={viewDate:r,selectedDate:n};n&&n.isValid()&&(i.inputValue=n.format(this.getFormat("datetime"))),this.setState(i)}getSelectedDate(){if(this.props.value===void 0)return this.state.selectedDate;let t=this.parseDate(this.props.value,this.getFormat("datetime"));return t&&t.isValid()?t:!1}getInitialInputValue(t){const r=this.props;return r.inputProps.value?r.inputProps.value:t&&t.isValid()?t.format(this.getFormat("datetime")):r.value&&typeof r.value=="string"?r.value:r.initialValue&&typeof r.initialValue=="string"?r.initialValue:""}getInputValue(){let t=this.getSelectedDate();return t?t.format(this.getFormat("datetime")):this.state.inputValue}setViewDate(t){let r=function(){return console.log("Invalid date passed to the `setViewDate` method: "+t)};if(!t)return r();let n;if(typeof t=="string"?n=this.localMoment(t,this.getFormat("datetime")):n=this.localMoment(t),!n||!n.isValid())return r();this.setState({viewDate:n})}navigate(t){this._showView(t)}callHandler(t,r){return t?t(r)!==!1:!0}};o1.defaultProps={onOpen:Za,onClose:Za,onCalendarOpen:Za,onCalendarClose:Za,onChange:Za,onNavigate:Za,onBeforeNavigate:function(t){return t},onNavigateBack:Za,onNavigateForward:Za,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0,renderView:(t,r)=>r()},o1.moment=xe;let Yh=o1;class sde extends x.Component{constructor(){super(...arguments),this.container=x.createRef()}render(){return p.jsx("div",{className:this.props.className,ref:this.container,children:this.props.children})}handleClickOutside(t){this.props.onClickOut(t)}setClickOutsideRef(){return this.container.current}}const lde=ode(sde);//! moment.js locale configuration
1733
1734
  //! locale : Czech [cs]
1734
1735
  //! author : petrbela : https://github.com/petrbela
1735
1736
  var cde={standalone:"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),format:"ledna_února_března_dubna_května_června_července_srpna_září_října_listopadu_prosince".split("_"),isFormat:/DD?[o.]?(\[[^\[\]]*\]|\s)+MMMM/},ude="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),Jh=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],Dx=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function Ys(e){return e>1&&e<5&&~~(e/10)!==1}function Hn(e,t,r,n){var i=e+" ";switch(r){case"s":return t||n?"pár sekund":"pár sekundami";case"ss":return t||n?i+(Ys(e)?"sekundy":"sekund"):i+"sekundami";case"m":return t?"minuta":n?"minutu":"minutou";case"mm":return t||n?i+(Ys(e)?"minuty":"minut"):i+"minutami";case"h":return t?"hodina":n?"hodinu":"hodinou";case"hh":return t||n?i+(Ys(e)?"hodiny":"hodin"):i+"hodinami";case"d":return t||n?"den":"dnem";case"dd":return t||n?i+(Ys(e)?"dny":"dní"):i+"dny";case"M":return t||n?"měsíc":"měsícem";case"MM":return t||n?i+(Ys(e)?"měsíce":"měsíců"):i+"měsíci";case"y":return t||n?"rok":"rokem";case"yy":return t||n?i+(Ys(e)?"roky":"let"):i+"lety"}}xe.defineLocale("cs",{months:cde,monthsShort:ude,monthsRegex:Dx,monthsShortRegex:Dx,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:Jh,longMonthsParse:Jh,shortMonthsParse:Jh,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:Hn,ss:Hn,m:Hn,mm:Hn,h:Hn,hh:Hn,d:Hn,dd:Hn,M:Hn,MM:Hn,y:Hn,yy:Hn},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});//! moment.js locale configuration