@codeandfunction/callaloo 4.9.5 → 4.9.7
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/callaloo.global.js +1 -1
- package/dist/chunks/{CLButton.vue_vue_type_style_index_0_lang-3vGTMU-k.js → CLButton.vue_vue_type_style_index_0_lang-hEXnJ7H1.js} +1 -1
- package/dist/chunks/{CLCalendar.vue_vue_type_style_index_0_lang-BAfGE35e.js → CLCalendar.vue_vue_type_style_index_0_lang-BqrGuMVB.js} +1 -1
- package/dist/chunks/{CLCard.vue_vue_type_style_index_0_lang-DPQxSLkQ.js → CLCard.vue_vue_type_style_index_0_lang-BGKjh5vA.js} +1 -1
- package/dist/chunks/CLIcon.vue_vue_type_style_index_0_lang-Cjt6fX90.js +2 -0
- package/dist/chunks/{CLLink.vue_vue_type_style_index_0_lang-CCyY39MJ.js → CLLink.vue_vue_type_style_index_0_lang-C9_EwMBi.js} +1 -1
- package/dist/chunks/{CLModal.vue_vue_type_style_index_0_lang-CwdYGfO9.js → CLModal.vue_vue_type_style_index_0_lang-DroQPRWC.js} +1 -1
- package/dist/chunks/{CLNavLink.vue_vue_type_script_setup_true_lang-Ds2aJNK9.js → CLNavLink.vue_vue_type_script_setup_true_lang-Dqr8A_2Z.js} +1 -1
- package/dist/chunks/{CLPill.vue_vue_type_style_index_0_lang-BVsLNnfE.js → CLPill.vue_vue_type_style_index_0_lang-DCtH-u0_.js} +1 -1
- package/dist/chunks/{CLToast.vue_vue_type_style_index_0_lang-BIehrtqC.js → CLToast.vue_vue_type_style_index_0_lang-CtXJMlF9.js} +1 -1
- package/dist/components/Buttons/CLButton/CLButton.js +1 -1
- package/dist/components/CLIcon/CLIcon.js +1 -1
- package/dist/components/Containers/CLCard/CLCard.js +1 -1
- package/dist/components/Containers/CLCarousel/CLCarousel.js +1 -1
- package/dist/components/Containers/CLDisclosure/CLDisclosure.js +1 -1
- package/dist/components/Form/CLCalendar/CLCalendar.js +1 -1
- package/dist/components/Form/CLCheckbox/CLCheckbox.js +1 -1
- package/dist/components/Form/CLInput/CLInput.js +1 -1
- package/dist/components/Form/CLInputDatePicker/CLInputDatePicker.js +1 -1
- package/dist/components/Form/CLSelect/CLSelect.js +1 -1
- package/dist/components/Indicators/CLBanner/CLBanner.css +1 -1
- package/dist/components/Indicators/CLBanner/CLBanner.js +1 -1
- package/dist/components/Indicators/CLPill/CLPill.js +1 -1
- package/dist/components/Modals/CLModal/CLModal.js +1 -1
- package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.js +1 -1
- package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.vue.d.ts +0 -3
- package/dist/components/Navigation/CLLink/CLLink.js +1 -1
- package/dist/components/Navigation/CLNavLink/CLNavLink.js +1 -1
- package/dist/components/Navigation/CLNavSection/CLNavSection.js +1 -1
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.js +1 -1
- package/dist/components/Popups/CLToast/CLToast.js +1 -1
- package/dist/components/Providers/CLToastProvider/CLToastProvider.js +1 -1
- package/dist/composables/useDatePicker.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/chunks/CLIcon.vue_vue_type_style_index_0_lang-yF4CdZbV.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLModalDatePicker.css';
|
|
3
|
-
import{defineComponent as e,mergeModels as a,ref as t,computed as l,useModel as d,
|
|
3
|
+
import{defineComponent as e,mergeModels as a,ref as t,computed as l,useModel as d,onMounted as o,onBeforeUnmount as i,createElementBlock as u,openBlock as n,normalizeClass as r,unref as s,createVNode as b,withCtx as c,createTextVNode as f,toDisplayString as p,createElementVNode as v,nextTick as m}from"vue";import{_ as y}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-hEXnJ7H1.js";import{_}from"../../../chunks/CLModal.vue_vue_type_style_index_0_lang-DroQPRWC.js";import{_ as L}from"../../../chunks/CLCalendar.vue_vue_type_style_index_0_lang-BqrGuMVB.js";import{CLSizes as X,CLIconSizes as g,CLIconNames as k,CLBorderRadius as $,CLColorVariants as h,CLColors as C}from"../../../index.js";import{i as w}from"../../../chunks/helper-C542dSLs.js";import{useDatePicker as S}from"../../../composables/useDatePicker.js";const B=["data-testid"],z=/* @__PURE__ */e({name:"CLModalDatePicker",__name:"CLModalDatePicker",props:/* @__PURE__ */a({buttonAriaLabel:{default:void 0},buttonBorderRadius:{default:void 0},buttonColor:{default:C.Primary},buttonLabel:{default:"Select dates"},buttonSize:{default:X.Small},buttonVariant:{default:h.Soft},buttonWidth:{default:"auto"},buttonWrapped:{type:Boolean,default:!1},busy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fluid:{type:Boolean,default:!1},id:{},isRange:{type:Boolean,default:!0},onBlur:{type:Function,default:void 0},onChange:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},testId:{default:"clll-date-picker-modal"},title:{default:"Select dates"}},{modelValue:{default:()=>({end:null,start:null})},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=e,z="clll-date-picker-modal",R=t(!1),V=l(()=>`date-picker-modal-${a.id}`),x=t(),M=d(e,"modelValue"),{rangeLabel:E}=S({appliedStart:l(()=>M.value?.start??null),appliedEnd:l(()=>M.value?.end??null),isRange:a.isRange}),F=t(!1),j=()=>{w&&(F.value=window.innerWidth<480)},P=()=>{if(a.disabled||a.busy)return;j(),R.value=!0,m(()=>{x.value?.initializeDraft()});const e=new FocusEvent("focus",{bubbles:!0,cancelable:!0});a.onFocus?.(e)},D=()=>{R.value=!1,x.value?.cancel();const e=new FocusEvent("blur",{bubbles:!0,cancelable:!0});a.onBlur?.(e)},W=()=>{x.value?.apply(),R.value=!1,a.onChange?.()},A=()=>{x.value?.reset(),a.onChange?.()},I=l(()=>F.value);o(()=>{w&&(j(),window.addEventListener("resize",j))}),i(()=>{w&&window.removeEventListener("resize",j)});const N={[X.Tiny]:g.Tiny,[X.Small]:g.Small,[X.Medium]:g.Medium,[X.Large]:g.Large,[X.XL]:g.XL,[X.XXL]:g.XXL,[X.XXXL]:g.XXXL,[X.XXXXL]:g.XXXXL},G=l(()=>[z,a.buttonBorderRadius?`${z}--${a.buttonBorderRadius}`:"",a.busy?`${z}--busy`:`${z}--ready`,`${z}--${a.buttonColor}`,`${z}--${a.buttonSize}`,`${z}--${a.buttonVariant}`,a.disabled||a.busy?`${z}--disabled`:`${z}--active`,a.fluid?`${z}--fluid`:`${z}--fixed`]),T=l(()=>{const e=x.value?.draftStart,t=x.value?.draftEnd;return a.isRange?!!e&&!!t:!!e});return(a,t)=>(n(),u("div",{class:r(s(G)),"data-testid":e.testId},[b(s(y),{"aria-label":e.buttonAriaLabel||"Open date picker","border-radius":e.buttonBorderRadius,busy:e.busy,color:e.buttonColor,disabled:e.disabled||e.busy,"icon-before":s(k).Calendar,"icon-size":N[e.buttonSize],"on-click":P,"test-id":`${e.testId}__trigger`,size:e.buttonSize,variant:e.buttonVariant,width:e.buttonWidth,wrap:e.buttonWrapped},{default:c(()=>[f(p(s(E)||e.buttonLabel),1)]),_:1},8,["aria-label","border-radius","busy","color","disabled","icon-before","icon-size","test-id","size","variant","width","wrap"]),b(s(_),{"border-radius":s(I)?s($).None:s($).Medium,fullscreen:s(I),"is-open":s(R),"max-width":"336px","modal-id":s(V),"on-close":D,title:e.title},{body:c(()=>[b(s(L),{ref_key:"calendarRef",ref:x,modelValue:M.value,"onUpdate:modelValue":t[0]||(t[0]=e=>M.value=e),busy:e.busy,disabled:e.disabled,fluid:s(I),"is-range":e.isRange},null,8,["modelValue","busy","disabled","fluid","is-range"])]),footer:c(()=>[v("div",{class:r(`${z}__footer-actions`)},[b(s(y),{color:s(C).Neutral,"on-click":D,variant:s(h).Ghost},{default:c(()=>[...t[1]||(t[1]=[f(" Cancel ",-1)])]),_:1},8,["color","variant"]),v("div",{class:r(`${z}__footer-right`)},[b(s(y),{color:s(C).Neutral,disabled:!s(x)?.draftStart&&!s(x)?.draftEnd,"on-click":A,variant:s(h).Ghost},{default:c(()=>[...t[2]||(t[2]=[f(" Reset ",-1)])]),_:1},8,["color","disabled","variant"]),b(s(y),{color:s(C).Primary,disabled:!s(T),"on-click":W},{default:c(()=>[...t[3]||(t[3]=[f(" Apply ",-1)])]),_:1},8,["color","disabled"])],2)],2)]),_:1},8,["border-radius","fullscreen","is-open","modal-id","title"])],10,B))}});export{z as CLModalDatePicker,z as default};
|
|
@@ -32,8 +32,6 @@ export interface CLModalDatePickerProps {
|
|
|
32
32
|
onChange?: CLGenericFunction;
|
|
33
33
|
/** A callback function which handles when the date picker gains focus. */
|
|
34
34
|
onFocus?: CLGenericFocusFunction;
|
|
35
|
-
/** When set to `false` it will not render with rounded corners. */
|
|
36
|
-
rounded?: boolean;
|
|
37
35
|
/** Sets a custom ID used for unit tests. */
|
|
38
36
|
testId?: string;
|
|
39
37
|
/** The title content of the Modal. */
|
|
@@ -62,7 +60,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
62
60
|
}>, {
|
|
63
61
|
title: string;
|
|
64
62
|
fluid: boolean;
|
|
65
|
-
rounded: boolean;
|
|
66
63
|
testId: string;
|
|
67
64
|
onFocus: CLGenericFocusFunction;
|
|
68
65
|
onBlur: CLGenericFocusFunction;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLLink.css';
|
|
3
|
-
import{_ as e}from"../../../chunks/CLLink.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{_ as e}from"../../../chunks/CLLink.vue_vue_type_style_index_0_lang-C9_EwMBi.js";export{e as CLLink,e as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
|
-
import{_ as a}from"../../../chunks/CLNavLink.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import{_ as a}from"../../../chunks/CLNavLink.vue_vue_type_script_setup_true_lang-Dqr8A_2Z.js";export{a as CLNavLink,a as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLNavSection.css';
|
|
3
|
-
import{defineComponent as e,computed as t,createElementBlock as a,openBlock as l,normalizeClass as r,unref as n,Fragment as i,renderList as o,createVNode as s,withCtx as c,createTextVNode as _,toDisplayString as u}from"vue";import{_ as d}from"../../../chunks/CLNavLink.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import{defineComponent as e,computed as t,createElementBlock as a,openBlock as l,normalizeClass as r,unref as n,Fragment as i,renderList as o,createVNode as s,withCtx as c,createTextVNode as _,toDisplayString as u}from"vue";import{_ as d}from"../../../chunks/CLNavLink.vue_vue_type_script_setup_true_lang-Dqr8A_2Z.js";import{_ as p}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-CMXJdE-D.js";import{CLOrientation as f,CLColors as m}from"../../../index.js";const v=["data-testid"],k=/* @__PURE__ */e({name:"CLNavSection",__name:"CLNavSection",props:{color:{default:m.Primary},navItems:{},testId:{default:"clll-nav-section"},type:{default:f.Horizontal}},setup(e){const f=e,m="clll-nav-section",k=t(()=>[m,`${m}--${f.type}`]);return(t,f)=>(l(),a("ul",{class:r(n(k)),"data-testid":e.testId},[(l(!0),a(i,null,o(e.navItems,(t,r)=>(l(),a("li",{key:`link-${t.id}-${r}`,class:"clll-nav-section__item"},[s(n(d),{id:t.id,"aria-label":t.ariaLabel,color:e.color,external:t.external,href:t.href,rel:t.rel,target:t.target,"on-click":t.onClick},{default:c(()=>[s(n(p),{as:"span"},{default:c(()=>[_(u(t.label),1)]),_:2},1024)]),_:2},1032,["id","aria-label","color","external","href","rel","target","on-click"])]))),128))],10,v))}});export{k as CLNavSection,k as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLDropdownMenu.css';
|
|
3
|
-
import{defineComponent as e,ref as o,computed as t,onBeforeUnmount as n,createElementBlock as a,openBlock as d,normalizeClass as r,createVNode as l,createCommentVNode as i,unref as s,withCtx as u,createTextVNode as c,toDisplayString as p,normalizeStyle as b,renderSlot as f}from"vue";import{u as m,a as _,f as v,o as w,s as h}from"../../../chunks/floating-ui.vue-C0JWy0Dz.js";import{_ as y}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{defineComponent as e,ref as o,computed as t,onBeforeUnmount as n,createElementBlock as a,openBlock as d,normalizeClass as r,createVNode as l,createCommentVNode as i,unref as s,withCtx as u,createTextVNode as c,toDisplayString as p,normalizeStyle as b,renderSlot as f}from"vue";import{u as m,a as _,f as v,o as w,s as h}from"../../../chunks/floating-ui.vue-C0JWy0Dz.js";import{_ as y}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-hEXnJ7H1.js";import{_ as g}from"../../../chunks/CLCard.vue_vue_type_style_index_0_lang-BGKjh5vA.js";import{c as B,i as $}from"../../../chunks/helper-C542dSLs.js";import{useDropdown as z}from"../../../composables/useDropdown.js";import{useEsc as x}from"../../../composables/useEsc.js";import{CLPlacement as I,CLIconSizes as k,CLIconNames as E,CLColorVariants as L,CLSizes as C,CLColors as D}from"../../../index.js";const S=["data-testid"],H=["id","aria-labelledby","aria-hidden"],j=/* @__PURE__ */e({name:"CLDropdownMenu",__name:"CLDropdownMenu",props:{buttonAriaLabel:{},buttonBorderRadius:{},buttonBusy:{type:Boolean},buttonColor:{default:D.Secondary},buttonDisabled:{type:Boolean},buttonHeight:{default:"auto"},buttonSize:{default:C.Small},buttonVariant:{default:L.Soft},buttonWidth:{default:"auto"},buttonWrapped:{type:Boolean},containerBordered:{type:Boolean,default:!0},containerBorderRadius:{},containerElevated:{type:Boolean,default:!1},contentWidth:{default:"auto"},dropdownId:{},iconAfter:{default:E.ChevronDown},iconBefore:{},iconSize:{default:k.Tiny},isOpen:{type:Boolean,default:!1},label:{},onCloseHandler:{},onOpenHandler:{},placement:{default:I.BottomStart},testId:{default:"clll-dropdown-menu"},zIndex:{default:30}},setup(e,{expose:I}){const k=e;let E=o(),C=o();const j=o(),O=o(),W=o(k.isOpen),R=o(k.placement),A="clll-dropdown-menu",M=t(()=>"auto"===k.zIndex||B(k.zIndex)?k.zIndex:k.zIndex.toString()),V=e=>{e&&(E.value=e)},G=e=>{e&&(C.value=e)},N=()=>{T.value?F():q()},{open:T,openDropdown:q,closeDropdown:F,clearEventListeners:J}=z({triggerElem:E,dropdownRef:O,openDropdownHandler:()=>{W.value=!0,k?.onOpenHandler?.(),P(),$&&document.addEventListener("click",Q)},closeDropdownHandler:()=>{W.value=!1,k?.onCloseHandler?.(),$&&document.removeEventListener("click",Q),U(),J()}});I({close:()=>{F(),J(),U()},open:()=>{q()}});const{floatingStyles:K,update:P}=m(j,O,{middleware:[v(),w(10),h()],placement:R,open:W,whileElementsMounted:_}),Q=e=>{W.value&&O.value?.contains(e?.target)&&F()},{clearEventListeners:U}=x({escHandler:F,triggerElem:E});return n(()=>{$&&document.removeEventListener("click",Q),U(),J()}),(o,t)=>(d(),a("div",{class:r([`${A}__menu`]),"data-testid":e.testId},[l(s(y),{id:`${A}__toggle--${e.dropdownId}`,ref_key:"anchor",ref:j,"aria-controls":`${A}--${e.dropdownId}`,"aria-expanded":s(W)||e.isOpen,"aria-label":e.buttonAriaLabel,busy:e.buttonBusy,disabled:e.buttonDisabled||e.buttonBusy,class:r(`${A}__toggle`),color:e.buttonColor,"border-radius":e.buttonBorderRadius,"forward-ref":V,height:e.buttonHeight,"icon-after":e.iconAfter,"icon-before":e.iconBefore,"icon-size":e.iconSize,size:e.buttonSize,"test-id":`${A}__toggle`,variant:e.buttonVariant,width:e.buttonWidth,wrap:e.buttonWrapped,"on-click":N},{default:u(()=>[c(p(e.label),1)]),_:1},8,["id","aria-controls","aria-expanded","aria-label","busy","disabled","class","color","border-radius","height","icon-after","icon-before","icon-size","size","test-id","variant","width","wrap"]),s(W)||e.isOpen?(d(),a("div",{key:0,id:`${A}--${e.dropdownId}`,ref_key:"dropdownElem",ref:O,"aria-labelledby":`${A}__toggle--${e.dropdownId}`,"aria-hidden":!(s(W)||e.isOpen),class:r([`${A}__dropdown`,`${A}__dropdown--${s(R)}`]),style:b({...s(K),zIndex:s(M)})},[l(s(g),{bordered:e.containerBordered,"border-radius":e.containerBorderRadius,color:s(D).Neutral,elevated:e.containerElevated,"forward-ref":G,padded:!1,"test-id":`${A}__content`,variant:s(L).Ghost,width:e.contentWidth},{default:u(()=>[f(o.$slots,"content")]),_:3},8,["bordered","border-radius","color","elevated","test-id","variant","width"])],14,H)):i("",!0)],10,S))}});export{j as CLDropdownMenu,j as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLToast.css';
|
|
3
|
-
import{_ as s}from"../../../chunks/CLToast.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{_ as s}from"../../../chunks/CLToast.vue_vue_type_style_index_0_lang-CtXJMlF9.js";export{s as CLToast,s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
|
-
import{defineComponent as s,ref as i,provide as o,createElementBlock as e,openBlock as r,createBlock as a,createCommentVNode as t,renderSlot as d,unref as u,mergeProps as l}from"vue";import{_ as m}from"../../../chunks/CLToast.vue_vue_type_style_index_0_lang-
|
|
2
|
+
import{defineComponent as s,ref as i,provide as o,createElementBlock as e,openBlock as r,createBlock as a,createCommentVNode as t,renderSlot as d,unref as u,mergeProps as l}from"vue";import{_ as m}from"../../../chunks/CLToast.vue_vue_type_style_index_0_lang-CtXJMlF9.js";import{T as n}from"../../../chunks/context-JmPivI9V.js";const v={class:"clll-toast-provider"},p=/* @__PURE__ */s({name:"CLToastProvider",__name:"CLToastProvider",props:{borderRadius:{},dismissTimer:{},position:{}},setup(s){const p=s,T=i({}),_=i(!1),c=()=>{_.value=!1,T.value={}};return o(n,{visible:_,showToast:s=>{T.value={...s,borderRadius:s.borderRadius??p.borderRadius,dismissTimer:s.dismissTimer??p.dismissTimer,position:s.position??p.position},_.value=!0},hideToast:c}),(s,i)=>(r(),e("div",v,[_.value?(r(),a(u(m),l({key:0},T.value,{"on-dismiss":c}),null,16)):t("",!0),d(s.$slots,"default")]))}});export{p as CLToastProvider,n as ToastInjectionKey,p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../assets/core.css';
|
|
2
|
-
import{ref as e,
|
|
2
|
+
import{ref as e,onMounted as a,computed as t,unref as l}from"vue";const u=({appliedEnd:u,appliedStart:n,isRange:r=!0}={})=>{const o=e(/* @__PURE__ */new Date),v=e(null),i=e(null),g=e(!1);a(()=>{g.value=!0});const d=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,D=e=>/* @__PURE__ */new Date(`${e}T00:00:00`),s=e=>g.value?D(e).toLocaleDateString("default",{day:"numeric",month:"long",weekday:"long",year:"numeric"}):e,c=e=>{const a=D(e);return`${a.getMonth()+1}/${String(a.getDate())}`},h=e=>{const a=D(e);return`${a.getMonth()+1}/${String(a.getDate())}/${String(a.getFullYear()).slice(-2)}`},f=()=>{const e=n?.value?D(n.value):/* @__PURE__ */new Date;o.value=new Date(e.getFullYear(),e.getMonth(),1)},$=t(()=>{if(!g.value){return`${o.value.getMonth()+1}/${o.value.getFullYear()}`}return o.value.toLocaleString("default",{month:"long",year:"numeric"})}),S=t(()=>{const e=n?.value??null,a=u?.value??null;if(!e)return;if(!l(r))return h(e);if(!a)return h(e);return D(e).getFullYear()!==D(a).getFullYear()?`${h(e)} - ${h(a)}`:`${c(e)} - ${c(a)}`}),m=e=>i.value===e,M=e=>v.value===e,w=e=>!!l(r)&&(!!i.value&&(v.value?e>=i.value&&e<=v.value:e===i.value));return{calendarGrid:t(()=>{const e=o.value.getFullYear(),a=o.value.getMonth(),t=new Date(e,a,1),l=new Date(e,a+1,0).getDate(),u=new Date(e,a,0).getDate(),n=t.getDay(),r=[];for(let o=0;o<n;o++){const t=u-(n-1-o),l=d(new Date(e,a-1,t));r.push({day:t,date:l,isOutsideMonth:!0})}for(let o=1;o<=l;o++){const t=d(new Date(e,a,o));r.push({day:o,date:t,isOutsideMonth:!1})}let v=1;for(;r.length<42;){const t=d(new Date(e,a+1,v));r.push({day:v,date:t,isOutsideMonth:!0}),v++}return r}),cancelDraft:()=>{i.value=n?.value??null,v.value=u?.value??null},clearDraft:()=>{n&&(n.value=null),u&&(u.value=null),i.value=null,v.value=null},currentDate:o,currentMonthLabel:$,draftEnd:v,draftStart:i,formatDateToISO:d,formatHumanDate:e=>g.value?D(e).toLocaleDateString("default",{day:"numeric",month:"short",year:"numeric"}):e,formatLongDate:s,formatShortNoYear:c,formatShortWithYear:h,getDayAriaLabel:e=>l(r)?m(e)?`${s(e)} (start date)`:M(e)?`${s(e)} (end date)`:w(e)?`${s(e)} (in range)`:s(e):m(e)?`${s(e)} (selected)`:s(e),handleNextMonth:()=>{o.value=new Date(o.value.getFullYear(),o.value.getMonth()+1,1)},handlePrevMonth:()=>{o.value=new Date(o.value.getFullYear(),o.value.getMonth()-1,1)},initializeDraft:()=>{f(),i.value=n?.value??null,v.value=u?.value??null},isDraftEnd:M,isDraftStart:m,isInDraftRange:w,isoToLocalDate:D,onDayClick:e=>{if(e)return l(r)?!i.value||i.value&&v.value?(i.value=e,void(v.value=null)):e<i.value?(v.value=i.value,void(i.value=e)):void(v.value=e):(i.value=e,void(v.value=null))},rangeLabel:S,setCalendarMonthToAppliedOrToday:f,weekDays:["Su","Mo","Tu","We","Th","Fr","Sa"]}};export{u as useDatePicker};
|