@bikdotai/bik-component-library 0.0.718-beta.1 → 0.0.718-beta.11
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/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +1 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/datePicker/DatePicker.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +1 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/datePicker/DatePicker.js +1 -1
- package/package.json +1 -1
|
@@ -29,5 +29,6 @@ export interface AnalyticsTrendInterface {
|
|
|
29
29
|
relativePercentageDiff?: number;
|
|
30
30
|
isInternationalStore?: boolean;
|
|
31
31
|
Icon?: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
|
|
32
|
+
tooltipTimelineText?: string;
|
|
32
33
|
}
|
|
33
34
|
export declare const AnalyticsTrend: React.FC<AnalyticsTrendInterface>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),s=require("../../constants/Theme.js"),r=require("../../assets/icons/arrow_down.svg.js"),o=require("../../assets/icons/arrow_up.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),s=require("../../constants/Theme.js"),r=require("../../assets/icons/arrow_down.svg.js"),o=require("../../assets/icons/arrow_up.svg.js"),l=require("../../assets/icons/info.svg.js"),a=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),x=require("../TypographyStyle.js"),u=require("./chart/utils/calcPercentage.js"),d=require("./CommonStyles.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=m(t);const j=n=>{let{percent:l,direction:a,timeline:d,customRange:m,trendRaw:p,prefixSymbol:j,trendIconStyle:g,isInternationalStore:h,tooltipTimelineText:y}=n;const R=()=>{const e=((null!=p?p:0)>0?"+":"")+(null!=j?j:"");return void 0===p?"--":`${null!=e?e:""}${(()=>{let e="--";if(p)return e=String(h?u.truncateValueForInternationalStore(Math.abs(p)):u.truncateValueForIndianStore(Math.abs(p))),p<0?"-"+e:e})()}`},[b,f]=t.useState(R()),[O,S]=t.useState("");t.useEffect((()=>{S("today"===d?"vs yesterday":"yesterday"===d?"vs 1 day before":"7 days"===d?"vs last 7 days":"30 days"===d?"vs last 30 days":"custom"===d&&m?i.default.getAnalyticsCustomDateTimelineText(m):"")}),[d,m]),t.useEffect((()=>{f(R())}),[p]);const v="negative"===a?r.default:o.default,E="negative"===a?s.COLORS.background.negative.vibrant:"positive"===a?s.COLORS.background.positive.vibrant:s.COLORS.content.placeholder;return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof l&&e.jsxRuntimeExports.jsx(v,{color:E,height:16,width:16,style:Object.assign({marginRight:2},null!=g?g:{})}),"number"==typeof l&&a&&e.jsxRuntimeExports.jsxs(x.Caption,Object.assign({style:{color:E}},{children:["neutral"===a?0:l<1e3?l:">999","%"]})),!!p&&e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:`(${b})`})),d&&(y?e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:y,placement:"bottom"},{children:e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:O}))})):e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:O})))]}))};exports.AnalyticsTrend=t=>{let{title:i,value:r,trendPercent:o,type:m="horizontal",timeline:g,customRange:h,tooltip:y,card:R=!0,rightSeparator:b=!1,size:f="big",share:O=!1,formatVal:S,prefixSymbol:v,trailingIcon:E,onTrailIconClick:T,iconTooltipBody:C,funnelPercent:w,isLoading:I,trendRaw:$,suffixText:L,trendStyle:q,trendContainerStyle:D,trendIconStyle:F,containerStyle:M,prevTrendDiff:k,relativePercentageDiff:P,isInternationalStore:V,Icon:_,iconContainerStyle:z,tooltipTimelineText:A}=t;const N="big"===f?x.TitleLarge:x.TitleMedium,B=void 0!==o?o<0?"negative":0===o?"neutral":"positive":void 0,W=void 0!==o?O?Math.round(o):Math.abs(Math.round(o)):void 0;return e.jsxRuntimeExports.jsx(d.AnalyticsTrendContainer,Object.assign({card:R,style:Object.assign({},M)},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:_?12:4,borderRightWidth:b?1:0,borderRightColor:s.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:R?0:24,paddingRight:R?0:24,height:"100%",justifyContent:_?"flex-start":"space-between",alignItems:"center"},null!=D?D:{})},{children:[!!_&&e.jsxRuntimeExports.jsx(d.IconContainer,Object.assign({style:Object.assign({},z)},{children:e.jsxRuntimeExports.jsx(_,{})})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=q?q:{})},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsxRuntimeExports.jsx(x.BodyCaption,Object.assign({style:{color:s.COLORS.content.secondary}},{children:i})),y&&e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:y,placement:"right",width:300},{children:e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsxRuntimeExports.jsx(l.default,{color:s.COLORS.content.primary,height:16,width:16})}))}))]})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},O?{justifyContent:"space-between"}:{})},{children:[I&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{width:108,height:26}),!I&&e.jsxRuntimeExports.jsx(N,Object.assign({style:{color:s.COLORS.content.primary}},{children:void 0===r?"--":"number"==typeof r&&S?r>999?V?`${null!=v?v:""}${u.truncateValueForInternationalStore(r)} ${null!=L?L:""}`:`${null!=v?v:""}${u.truncateValueForIndianStore(r)} ${null!=L?L:""}`:`${null!=v?v:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(r)} ${null!=L?L:""}`:`${null!=v?v:""}${r} ${null!=L?L:""}`})),"number"==typeof P&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${P}%`,theme:"light",type:"neutral"}),"horizontal"===m&&!I&&!O&&e.jsxRuntimeExports.jsx(j,{timeline:g,customRange:h,percent:W,direction:B,trendRaw:$,prefixSymbol:v,trendIconStyle:F,isInternationalStore:V,tooltipTimelineText:A}),I&&!O&&"horizontal"===m&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6}),"vertical"===m&&!I&&void 0!==w&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${w} %`,theme:"light",type:"neutral"}),O&&!I&&void 0!==W&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${W} %`,theme:"light",type:"neutral"}),O||I||!k||0==k?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsx(a.Tag,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(k),theme:"light",type:"neutral"})]})),"vertical"===m&&!I&&!O&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsxRuntimeExports.jsx(j,{timeline:g,customRange:h,percent:W,direction:B,trendRaw:$,prefixSymbol:v,trendIconStyle:F,isInternationalStore:V,tooltipTimelineText:A})})),I&&"vertical"===m&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6})]})),C&&!I&&e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:C,placement:"right"},{children:E&&e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--holder",onClick:T},{children:p.default.createElement(E,{height:20,width:20,color:s.COLORS.content.secondary})}))}))]}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),s=require("react-calendar"),n=require("../button/Button.js"),i=require("./DatePicker.styled.js"),r=require("./TimePicker.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(s);exports.DatePicker=s=>{const[a,o]=t.useState(),[c,u]=t.useState("00:00"),[m,d]=t.useState("23:59");t.useEffect((()=>{if(s.selectedDates){if(o(s.selectedDates),s.showTimePicker){if(s.selectedDates[0]){const e=s.selectedDates[0].getHours(),t=s.selectedDates[0].getMinutes();u(`${e.toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`)}if(s.selectedDates[1]){const e=s.selectedDates[1].getHours(),t=s.selectedDates[1].getMinutes();d(`${e.toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`)}}}else o([null,null]),s.showTimePicker&&(u("00:00"),d("23:59"))}),[s.selectedDates,s.showTimePicker]);const[f,x]=t.useState(s.selectedDate),g=null===s.maxRangeLimit?null:void 0===s.maxRangeLimit?180:s.maxRangeLimit;function p(e,t){var n;if(Array.isArray(a)&&a[0]&&a[1]){if(e){const[t,s]=e.split(":").map(Number);a[0].setHours(t,s,0,0)}if(t){const[e,s]=t.split(":").map(Number);a[1].setHours(e,s,0,0)}s.showTimePicker||null===(n=s.onSelectRange)||void 0===n||n.call(s,a[0],a[1])}}return e.jsxRuntimeExports.jsxs(i.PickerContainer,Object.assign({selectRange:s.selectRange},{children:[e.jsxRuntimeExports.jsx(l.default,{onChange:e=>{s.selectRange&&s.onSelectRange?function(e){var t;if(s.showTimePicker&&c){const[t,s]=c.split(":").map(Number);e[0].setHours(t,s,0,0)}if(s.showTimePicker&&m){const[t,s]=m.split(":").map(Number);e[1].setHours(t,s,0,0)}s.showTimePicker||null===(t=s.onSelectRange)||void 0===t||t.call(s,e[0],e[1]),o([e[0],e[1]])}(e):s.onSelectDate&&function(e){var t;if(s.showTimePicker&&c){const[t,s]=c.split(":").map(Number);e.setHours(t,s,0,0)}s.showTimePicker||null===(t=s.onSelectDate)||void 0===t||t.call(s,e),x(e)}(e)},tileDisabled:e=>{let{date:t,view:s}=e;if(!Array.isArray(a))return!1;const[n,i]=a;if(n&&!i&&null!==g){const e=Math.round((t-n)/864e5);return"month"===s&&(e<-g||e>g)}return!1},onClickDay:function(e){if(!Array.isArray(a))return void o([e,null]);const[t,s]=a;o(t&&t&&!s?[t,e]:[e,null])},value:s.selectRange?a:f,selectRange:s.selectRange,minDate:s.minDate,maxDate:s.maxDate},"bik-calendar"),s.showTimePicker&&s.selectRange&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(r.TimePicker,{fromTime:c,toTime:m,onFromTimeChange:function(e){u(e),p(e,m)},onToTimeChange:function(e){d(e),p(c,e)},timeInterval:s.timeInterval}),e.jsxRuntimeExports.jsx("div",Object.assign({className:"date-picker-save-button-container",style:{display:"flex",justifyContent:"flex-end",padding:"16px"}},{children:e.jsxRuntimeExports.jsx(n.Button,{buttonType:"primary",size:"small",buttonText:"Save",onClick:function(){var e,t;s.selectRange&&Array.isArray(a)&&a[0]&&a[1]?null===(e=s.onSelectRange)||void 0===e||e.call(s,a[0],a[1]):!s.selectRange&&f&&(null===(t=s.onSelectDate)||void 0===t||t.call(s,f))}})}))]})]}))};
|
|
@@ -29,5 +29,6 @@ export interface AnalyticsTrendInterface {
|
|
|
29
29
|
relativePercentageDiff?: number;
|
|
30
30
|
isInternationalStore?: boolean;
|
|
31
31
|
Icon?: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
|
|
32
|
+
tooltipTimelineText?: string;
|
|
32
33
|
}
|
|
33
34
|
export declare const AnalyticsTrend: React.FC<AnalyticsTrendInterface>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";import t,{useState as i,useEffect as n}from"react";import{ShimmerComponentStyled as r}from"../shimmer/ShimmerComponent/ShimmerStyled.js";import s from"../../utils/DateUtils.js";import{COLORS as o}from"../../constants/Theme.js";import l from"../../assets/icons/arrow_down.svg.js";import a from"../../assets/icons/arrow_up.svg.js";import c from"../../assets/icons/info.svg.js";import{Tag as d}from"../tag/Tag.js";import{Tooltip as
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import t,{useState as i,useEffect as n}from"react";import{ShimmerComponentStyled as r}from"../shimmer/ShimmerComponent/ShimmerStyled.js";import s from"../../utils/DateUtils.js";import{COLORS as o}from"../../constants/Theme.js";import l from"../../assets/icons/arrow_down.svg.js";import a from"../../assets/icons/arrow_up.svg.js";import c from"../../assets/icons/info.svg.js";import{Tag as d}from"../tag/Tag.js";import{Tooltip as m}from"../tooltips/Tooltip.js";import{BodyCaption as g,Caption as h,TitleLarge as p,TitleMedium as j}from"../TypographyStyle.js";import{truncateValueForInternationalStore as y,truncateValueForIndianStore as x}from"./chart/utils/calcPercentage.js";import{AnalyticsTrendContainer as b,IconContainer as u}from"./CommonStyles.js";const f=i=>{let{title:n,value:s,trendPercent:l,type:a="horizontal",timeline:h,customRange:f,tooltip:O,card:T=!0,rightSeparator:S=!1,size:w="big",share:$=!1,formatVal:I,prefixSymbol:R,trailingIcon:C,onTrailIconClick:D,iconTooltipBody:M,funnelPercent:k,isLoading:L,trendRaw:z,suffixText:F,trendStyle:P,trendContainerStyle:N,trendIconStyle:_,containerStyle:W,prevTrendDiff:A,relativePercentageDiff:B,isInternationalStore:E,Icon:U,iconContainerStyle:V,tooltipTimelineText:q}=i;const G="big"===w?p:j,H=void 0!==l?l<0?"negative":0===l?"neutral":"positive":void 0,J=void 0!==l?$?Math.round(l):Math.abs(Math.round(l)):void 0;return e.jsx(b,Object.assign({card:T,style:Object.assign({},W)},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:U?12:4,borderRightWidth:S?1:0,borderRightColor:o.stroke.primary,borderRightStyle:"solid",paddingLeft:T?0:24,paddingRight:T?0:24,height:"100%",justifyContent:U?"flex-start":"space-between",alignItems:"center"},null!=N?N:{})},{children:[!!U&&e.jsx(u,Object.assign({style:Object.assign({},V)},{children:e.jsx(U,{})})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=P?P:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(g,Object.assign({style:{color:o.content.secondary}},{children:n})),O&&e.jsx(m,Object.assign({body:O,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsx(c,{color:o.content.primary,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},$?{justifyContent:"space-between"}:{})},{children:[L&&e.jsx(r,{width:108,height:26}),!L&&e.jsx(G,Object.assign({style:{color:o.content.primary}},{children:void 0===s?"--":"number"==typeof s&&I?s>999?E?`${null!=R?R:""}${y(s)} ${null!=F?F:""}`:`${null!=R?R:""}${x(s)} ${null!=F?F:""}`:`${null!=R?R:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(s)} ${null!=F?F:""}`:`${null!=R?R:""}${s} ${null!=F?F:""}`})),"number"==typeof B&&e.jsx(d,{tagText:`${B}%`,theme:"light",type:"neutral"}),"horizontal"===a&&!L&&!$&&e.jsx(v,{timeline:h,customRange:f,percent:J,direction:H,trendRaw:z,prefixSymbol:R,trendIconStyle:_,isInternationalStore:E,tooltipTimelineText:q}),L&&!$&&"horizontal"===a&&e.jsx(r,{height:20,width:141,marginTop:6}),"vertical"===a&&!L&&void 0!==k&&e.jsx(d,{tagText:`${k} %`,theme:"light",type:"neutral"}),$&&!L&&void 0!==J&&e.jsx(d,{tagText:`${J} %`,theme:"light",type:"neutral"}),$||L||!A||0==A?e.jsx(e.Fragment,{}):e.jsx(d,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(A),theme:"light",type:"neutral"})]})),"vertical"===a&&!L&&!$&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(v,{timeline:h,customRange:f,percent:J,direction:H,trendRaw:z,prefixSymbol:R,trendIconStyle:_,isInternationalStore:E,tooltipTimelineText:q})})),L&&"vertical"===a&&e.jsx(r,{height:20,width:141,marginTop:6})]})),M&&!L&&e.jsx(m,Object.assign({body:M,placement:"right"},{children:C&&e.jsx("div",Object.assign({className:"icon--holder",onClick:D},{children:t.createElement(C,{height:20,width:20,color:o.content.secondary})}))}))]}))}))},v=t=>{let{percent:r,direction:c,timeline:d,customRange:g,trendRaw:p,prefixSymbol:j,trendIconStyle:b,isInternationalStore:u,tooltipTimelineText:f}=t;const v=()=>{const e=((null!=p?p:0)>0?"+":"")+(null!=j?j:"");return void 0===p?"--":`${null!=e?e:""}${(()=>{let e="--";if(p)return e=String(u?y(Math.abs(p)):x(Math.abs(p))),p<0?"-"+e:e})()}`},[O,T]=i(v()),[S,w]=i("");n((()=>{w("today"===d?"vs yesterday":"yesterday"===d?"vs 1 day before":"7 days"===d?"vs last 7 days":"30 days"===d?"vs last 30 days":"custom"===d&&g?s.getAnalyticsCustomDateTimelineText(g):"")}),[d,g]),n((()=>{T(v())}),[p]);const $="negative"===c?l:a,I="negative"===c?o.background.negative.vibrant:"positive"===c?o.background.positive.vibrant:o.content.placeholder;return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof r&&e.jsx($,{color:I,height:16,width:16,style:Object.assign({marginRight:2},null!=b?b:{})}),"number"==typeof r&&c&&e.jsxs(h,Object.assign({style:{color:I}},{children:["neutral"===c?0:r<1e3?r:">999","%"]})),!!p&&e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:`(${O})`})),d&&(f?e.jsx(m,Object.assign({body:f,placement:"bottom"},{children:e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:S}))})):e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:S})))]}))};export{f as AnalyticsTrend};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useEffect as n}from"react";import i from"react-calendar";import{Button as
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useEffect as n}from"react";import i from"react-calendar";import{Button as s}from"../button/Button.js";import{PickerContainer as a}from"./DatePicker.styled.js";import{TimePicker as r}from"./TimePicker.js";const l=l=>{const[o,c]=t(),[m,u]=t("00:00"),[d,g]=t("23:59");n((()=>{if(l.selectedDates){if(c(l.selectedDates),l.showTimePicker){if(l.selectedDates[0]){const e=l.selectedDates[0].getHours(),t=l.selectedDates[0].getMinutes();u(`${e.toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`)}if(l.selectedDates[1]){const e=l.selectedDates[1].getHours(),t=l.selectedDates[1].getMinutes();g(`${e.toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`)}}}else c([null,null]),l.showTimePicker&&(u("00:00"),g("23:59"))}),[l.selectedDates,l.showTimePicker]);const[f,p]=t(l.selectedDate),D=null===l.maxRangeLimit?null:void 0===l.maxRangeLimit?180:l.maxRangeLimit;function h(e,t){var n;if(Array.isArray(o)&&o[0]&&o[1]){if(e){const[t,n]=e.split(":").map(Number);o[0].setHours(t,n,0,0)}if(t){const[e,n]=t.split(":").map(Number);o[1].setHours(e,n,0,0)}l.showTimePicker||null===(n=l.onSelectRange)||void 0===n||n.call(l,o[0],o[1])}}return e.jsxs(a,Object.assign({selectRange:l.selectRange},{children:[e.jsx(i,{onChange:e=>{l.selectRange&&l.onSelectRange?function(e){var t;if(l.showTimePicker&&m){const[t,n]=m.split(":").map(Number);e[0].setHours(t,n,0,0)}if(l.showTimePicker&&d){const[t,n]=d.split(":").map(Number);e[1].setHours(t,n,0,0)}l.showTimePicker||null===(t=l.onSelectRange)||void 0===t||t.call(l,e[0],e[1]),c([e[0],e[1]])}(e):l.onSelectDate&&function(e){var t;if(l.showTimePicker&&m){const[t,n]=m.split(":").map(Number);e.setHours(t,n,0,0)}l.showTimePicker||null===(t=l.onSelectDate)||void 0===t||t.call(l,e),p(e)}(e)},tileDisabled:e=>{let{date:t,view:n}=e;if(!Array.isArray(o))return!1;const[i,s]=o;if(i&&!s&&null!==D){const e=Math.round((t-i)/864e5);return"month"===n&&(e<-D||e>D)}return!1},onClickDay:function(e){if(!Array.isArray(o))return void c([e,null]);const[t,n]=o;c(t&&t&&!n?[t,e]:[e,null])},value:l.selectRange?o:f,selectRange:l.selectRange,minDate:l.minDate,maxDate:l.maxDate},"bik-calendar"),l.showTimePicker&&l.selectRange&&e.jsxs(e.Fragment,{children:[e.jsx(r,{fromTime:m,toTime:d,onFromTimeChange:function(e){u(e),h(e,d)},onToTimeChange:function(e){g(e),h(m,e)},timeInterval:l.timeInterval}),e.jsx("div",Object.assign({className:"date-picker-save-button-container",style:{display:"flex",justifyContent:"flex-end",padding:"16px"}},{children:e.jsx(s,{buttonType:"primary",size:"small",buttonText:"Save",onClick:function(){var e,t;l.selectRange&&Array.isArray(o)&&o[0]&&o[1]?null===(e=l.onSelectRange)||void 0===e||e.call(l,o[0],o[1]):!l.selectRange&&f&&(null===(t=l.onSelectDate)||void 0===t||t.call(l,f))}})}))]})]}))};export{l as DatePicker};
|