@codeandfunction/callaloo 5.16.0 → 5.17.1
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/CLCalendar.vue_vue_type_style_index_0_lang-D35OH5qI.js +2 -0
- package/dist/chunks/{CLCard.vue_vue_type_style_index_0_lang-CY-Qr_CV.js → CLCard.vue_vue_type_style_index_0_lang-CAg8Jmzv.js} +1 -1
- package/dist/chunks/{CLFormLabel.vue_vue_type_script_setup_true_lang-DoM5X-sA.js → CLFormLabel.vue_vue_type_script_setup_true_lang-Cv4WHr_X.js} +1 -1
- package/dist/chunks/{CLHeading.vue_vue_type_style_index_0_lang-PCOhAZkN.js → CLHeading.vue_vue_type_style_index_0_lang-CYgxrrIE.js} +1 -1
- package/dist/chunks/{CLModal.vue_vue_type_style_index_0_lang-DLUfvRC_.js → CLModal.vue_vue_type_style_index_0_lang-DFQqYIGs.js} +1 -1
- package/dist/chunks/CLPill.vue_vue_type_style_index_0_lang-CY8F0FJJ.js +2 -0
- package/dist/chunks/{CLText.vue_vue_type_style_index_0_lang-CdA4TW0N.js → CLText.vue_vue_type_style_index_0_lang-DR2zoTEJ.js} +1 -1
- package/dist/chunks/{CLToast.vue_vue_type_style_index_0_lang-D7KGFx9t.js → CLToast.vue_vue_type_style_index_0_lang-DM_9Iykj.js} +1 -1
- package/dist/chunks/utils-DNuPk_OL.js +1 -0
- package/dist/components/Buttons/CLButton/CLButton.vue.d.ts +4 -4
- package/dist/components/CLTable/CLTable.js +1 -1
- package/dist/components/Containers/CLCard/CLCard.js +1 -1
- package/dist/components/Containers/CLCard/CLCard.vue.d.ts +2 -2
- package/dist/components/Containers/CLCarousel/CLCarousel.js +1 -1
- package/dist/components/Containers/CLCarousel/CLCarousel.vue.d.ts +1 -1
- package/dist/components/Containers/CLDisclosure/CLDisclosure.js +1 -1
- package/dist/components/Containers/CLDrawer/CLDrawer.vue.d.ts +2 -2
- package/dist/components/Form/CLCalendar/CLCalendar.css +1 -1
- package/dist/components/Form/CLCalendar/CLCalendar.js +1 -1
- package/dist/components/Form/CLCalendar/CLCalendar.vue.d.ts +14 -11
- package/dist/components/Form/CLCheckbox/CLCheckbox.js +1 -1
- package/dist/components/Form/CLCheckbox/CLCheckbox.vue.d.ts +3 -3
- package/dist/components/Form/CLInput/CLInput.js +1 -1
- package/dist/components/Form/CLInput/CLInput.vue.d.ts +3 -3
- package/dist/components/Form/CLInputDatePicker/CLInputDatePicker.js +1 -1
- package/dist/components/Form/CLInputDatePicker/CLInputDatePicker.vue.d.ts +25 -23
- package/dist/components/Form/CLInputTimePicker/CLInputTimePicker.js +1 -1
- package/dist/components/Form/CLInputTimePicker/CLInputTimePicker.vue.d.ts +10 -10
- package/dist/components/Form/CLInputTimePicker/index.d.ts +10 -10
- package/dist/components/Form/CLRadioButton/CLRadioButton.js +1 -1
- package/dist/components/Form/CLSelect/CLSelect.js +1 -1
- package/dist/components/Form/CLTextArea/CLTextArea.js +1 -1
- package/dist/components/Form/CLTimePicker/CLTimePicker.js +1 -1
- package/dist/components/Form/CLTimePicker/CLTimePicker.vue.d.ts +1 -1
- package/dist/components/Form/CLTimePicker/index.d.ts +1 -1
- package/dist/components/Indicators/CLBanner/CLBanner.js +1 -1
- package/dist/components/Indicators/CLBanner/CLBanner.vue.d.ts +2 -2
- package/dist/components/Indicators/CLPill/CLPill.css +1 -1
- package/dist/components/Indicators/CLPill/CLPill.js +1 -1
- package/dist/components/Indicators/CLProgress/CLProgress.js +1 -1
- package/dist/components/Loading/CLSkeleton/CLSkeleton.vue.d.ts +2 -2
- package/dist/components/Modals/CLModal/CLModal.js +1 -1
- package/dist/components/Modals/CLModal/CLModal.vue.d.ts +1 -1
- package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.js +1 -1
- package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.vue.d.ts +24 -18
- package/dist/components/Modals/CLModalTimePicker/CLModalTimePicker.js +1 -1
- package/dist/components/Modals/CLModalTimePicker/CLModalTimePicker.vue.d.ts +5 -5
- package/dist/components/Modals/CLModalTimePicker/index.d.ts +5 -5
- package/dist/components/Navigation/CLNavSection/CLNavSection.js +1 -1
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.js +1 -1
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.vue.d.ts +9 -9
- package/dist/components/Popups/CLToast/CLToast.js +1 -1
- package/dist/components/Popups/CLToast/CLToast.vue.d.ts +1 -1
- package/dist/components/Providers/CLToastProvider/CLToastProvider.js +1 -1
- package/dist/components/Typography/CLHeading/CLHeading.js +1 -1
- package/dist/components/Typography/CLText/CLText.js +1 -1
- package/dist/composables/useDatePicker.d.ts +31 -21
- package/dist/composables/useDatePicker.js +1 -1
- package/dist/composables/useTheme.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/CLCalendar.vue_vue_type_style_index_0_lang-PiGGhTHo.js +0 -2
- package/dist/chunks/CLPill.vue_vue_type_style_index_0_lang-BjrbTAI3.js +0 -2
- package/dist/chunks/utils-BfamOHei.js +0 -1
|
@@ -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
|
|
3
|
+
import{defineComponent as e,mergeModels as a,ref as t,computed as l,useModel as d,toRef as o,onMounted as i,onBeforeUnmount as r,createBlock as u,openBlock as n,withCtx as s,createElementVNode as b,normalizeClass as c,unref as f,createCommentVNode as p,createVNode as m,createElementBlock as _,createTextVNode as v,toDisplayString as y,nextTick as h}from"vue";import{_ as L}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-pE0JrYmS.js";import{_ as k}from"../../../chunks/CLFormField.vue_vue_type_style_index_0_lang-Rf_Mo_VS.js";import{_ as $}from"../../../chunks/CLFormLabel.vue_vue_type_script_setup_true_lang-Cv4WHr_X.js";import{_ as w}from"../../../chunks/CLModal.vue_vue_type_style_index_0_lang-DFQqYIGs.js";import{_ as g}from"../../../chunks/CLCalendar.vue_vue_type_style_index_0_lang-D35OH5qI.js";import{c as X,e as C,f as B,h as R,a as z,b as S}from"../../../chunks/index-DsloP0ml.js";import{a as x}from"../../../chunks/index-wkMXT2wB.js";import{i as D}from"../../../chunks/helper-BlxFN3eF.js";import{useDatePicker as F}from"../../../composables/useDatePicker.js";const j=["data-testid"],q=["name","value","required"],V=/* @__PURE__ */e({name:"CLModalDatePicker",__name:"CLModalDatePicker",props:/* @__PURE__ */a({allowedDates:{type:[Array,Object,Function],default:void 0},buttonAriaLabel:{default:void 0},buttonBorderRadius:{default:void 0},buttonColor:{default:S.Primary},buttonLabel:{default:"Select dates"},buttonSize:{default:X.Small},buttonVariant:{default:z.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},label:{default:void 0},name:{default:void 0},onBlur:{type:Function,default:void 0},onChange:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},onReset:{},orientation:{default:x.Vertical},required:{type:Boolean,default:!1},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,V="clll-date-picker-modal",M=t(!1),E=l(()=>`date-picker-modal-${a.id}`),P=t(),W=d(e,"modelValue"),{rangeLabel:A}=F({allowedDates:o(a,"allowedDates"),appliedStart:l(()=>W.value?.start??null),appliedEnd:l(()=>W.value?.end??null),isRange:a.isRange}),I=t(!1),N=()=>{D&&(I.value=window.innerWidth<480)},G=()=>{if(a.disabled||a.busy)return;N(),M.value=!0,h(()=>{P.value?.initializeDraft()});const e=new FocusEvent("focus",{bubbles:!0,cancelable:!0});a.onFocus?.(e)},O=()=>{M.value=!1,P.value?.cancel();const e=new FocusEvent("blur",{bubbles:!0,cancelable:!0});a.onBlur?.(e)},T=()=>{P.value?.apply(),M.value=!1,a.onChange?.()},H=()=>{P.value?.reset(),a.onReset?.()},U=l(()=>I.value);i(()=>{D&&(N(),window.addEventListener("resize",N))}),r(()=>{D&&window.removeEventListener("resize",N)});const J={[X.Tiny]:C.Tiny,[X.Small]:C.Small,[X.Medium]:C.Medium,[X.Large]:C.Large,[X.XL]:C.XL,[X.XXL]:C.XXL,[X.XXXL]:C.XXXL,[X.XXXXL]:C.XXXXL},K=l(()=>[V,a.buttonBorderRadius?`${V}--${a.buttonBorderRadius}`:"",a.busy?`${V}--busy`:`${V}--ready`,`${V}--${a.buttonColor}`,`${V}--${a.buttonSize}`,`${V}--${a.buttonVariant}`,a.disabled||a.busy?`${V}--disabled`:`${V}--active`,a.fluid||a.orientation===x.Horizontal?`${V}--fluid`:`${V}--fixed`,a.label?`${V}--haslabel`:"",a.orientation?`${V}--${a.orientation}`:"",a.required?`${V}--required`:`${V}--optional`]),Q=l(()=>{const e=P.value?.draftStart,t=P.value?.draftEnd;return a.allowedDates?!!e:a.isRange?!!e&&!!t:!!e});return(a,t)=>(n(),u(k,{fluid:e.fluid,orientation:e.orientation},{default:s(()=>[b("div",{class:c(f(K)),"data-testid":e.testId},[e.label?(n(),u($,{key:0,"css-prefix":V,"html-for":e.id,label:e.label,required:e.required,size:e.buttonSize,onClick:G},null,8,["html-for","label","required","size"])):p("",!0),m(f(L),{id:e.id,"aria-label":e.buttonAriaLabel||"Open date picker","border-radius":e.buttonBorderRadius,busy:e.busy,color:e.buttonColor,disabled:e.disabled||e.busy,"icon-before":f(B).Calendar,"icon-size":J[e.buttonSize],"on-click":G,"test-id":`${e.testId}__trigger`,size:e.buttonSize,variant:e.buttonVariant,width:e.buttonWidth,wrap:e.buttonWrapped},{default:s(()=>[v(y(f(A)||e.buttonLabel),1)]),_:1},8,["id","aria-label","border-radius","busy","color","disabled","icon-before","icon-size","test-id","size","variant","width","wrap"]),e.name||e.required?(n(),_("input",{key:1,class:c(`${V}__hidden-input`),name:e.name,value:f(A)||"",required:e.required,tabindex:"-1","aria-hidden":"true"},null,10,q)):p("",!0),m(f(w),{"border-radius":f(U)?f(R).None:f(R).Medium,fullscreen:f(U),"is-open":f(M),"max-width":"336px","modal-id":f(E),"on-close":O,title:e.title},{body:s(()=>[m(f(g),{ref_key:"calendarRef",ref:P,modelValue:W.value,"onUpdate:modelValue":t[0]||(t[0]=e=>W.value=e),"allowed-dates":e.allowedDates,busy:e.busy,disabled:e.disabled,fluid:f(U),"is-range":!e.allowedDates&&e.isRange},null,8,["modelValue","allowed-dates","busy","disabled","fluid","is-range"])]),footer:s(()=>[b("div",{class:c(`${V}__footer-actions`)},[m(f(L),{"border-radius":e.buttonBorderRadius,color:f(S).Neutral,"on-click":O,variant:f(z).Ghost},{default:s(()=>[...t[1]||(t[1]=[v(" Cancel ",-1)])]),_:1},8,["border-radius","color","variant"]),b("div",{class:c(`${V}__footer-right`)},[m(f(L),{"border-radius":e.buttonBorderRadius,color:f(S).Neutral,disabled:!f(P)?.draftStart&&!f(P)?.draftEnd,"on-click":H,variant:f(z).Ghost},{default:s(()=>[...t[2]||(t[2]=[v(" Reset ",-1)])]),_:1},8,["border-radius","color","disabled","variant"]),m(f(L),{"border-radius":e.buttonBorderRadius,color:f(S).Primary,disabled:!f(Q),"on-click":T},{default:s(()=>[...t[3]||(t[3]=[v(" Apply ",-1)])]),_:1},8,["border-radius","color","disabled"])],2)],2)]),_:1},8,["border-radius","fullscreen","is-open","modal-id","title"])],10,j)]),_:1},8,["fluid","orientation"]))}});export{V as CLModalDatePicker,V as default};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { CLBorderRadius, CLColors, CLColorVariants, CLGenericFocusFunction, CLGenericFunction, CLOrientation, CLSizes } from '../../../index.ts';
|
|
2
|
+
import { CLAllowedDates } from '../../../composables/useDatePicker';
|
|
2
3
|
export interface CLModalDatePickerProps {
|
|
4
|
+
/** Allowed dates or range of dates that can be selected. When specified, all other dates appear disabled and the picker allows single date selection. */
|
|
5
|
+
allowedDates?: CLAllowedDates;
|
|
3
6
|
/** Sets the aria-label on the trigger button. It should be used when there is no label present. */
|
|
4
7
|
buttonAriaLabel?: string;
|
|
5
8
|
/** The border radius size. The property can be one of `CLBorderRadius`, e.g. `CLBorderRadius.Medium`. */
|
|
@@ -68,18 +71,19 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
68
71
|
start: string | null;
|
|
69
72
|
} | null) => any) | undefined;
|
|
70
73
|
}>, {
|
|
71
|
-
fluid: boolean;
|
|
72
|
-
testId: string;
|
|
73
|
-
name: string;
|
|
74
74
|
label: string;
|
|
75
75
|
title: string;
|
|
76
|
+
allowedDates: CLAllowedDates;
|
|
77
|
+
isRange: boolean;
|
|
78
|
+
name: string;
|
|
79
|
+
fluid: boolean;
|
|
80
|
+
testId: string;
|
|
76
81
|
onFocus: CLGenericFocusFunction;
|
|
77
82
|
onBlur: CLGenericFocusFunction;
|
|
78
83
|
onChange: CLGenericFunction;
|
|
79
84
|
required: boolean;
|
|
80
85
|
busy: boolean;
|
|
81
86
|
disabled: boolean;
|
|
82
|
-
isRange: boolean;
|
|
83
87
|
orientation: CLOrientation;
|
|
84
88
|
buttonAriaLabel: string;
|
|
85
89
|
buttonBorderRadius: CLBorderRadius;
|
|
@@ -92,13 +96,13 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
92
96
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
93
97
|
calendarRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
94
98
|
modelValue?: {
|
|
95
|
-
end: import('../../../
|
|
96
|
-
start: import('../../../
|
|
99
|
+
end: import('../../../index.ts').CLISODate | null;
|
|
100
|
+
start: import('../../../index.ts').CLISODate | null;
|
|
97
101
|
} | null;
|
|
98
102
|
} & import('../../Form/CLCalendar/CLCalendar.vue').CLCalendarProps> & Readonly<{
|
|
99
103
|
"onUpdate:modelValue"?: ((value: {
|
|
100
|
-
end: import('../../../
|
|
101
|
-
start: import('../../../
|
|
104
|
+
end: import('../../../index.ts').CLISODate | null;
|
|
105
|
+
start: import('../../../index.ts').CLISODate | null;
|
|
102
106
|
} | null) => any) | undefined;
|
|
103
107
|
"onDate-select"?: ((date: string) => any) | undefined;
|
|
104
108
|
}>, {
|
|
@@ -110,18 +114,19 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
110
114
|
reset: () => void;
|
|
111
115
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
112
116
|
"update:modelValue": (value: {
|
|
113
|
-
end: import('../../../
|
|
114
|
-
start: import('../../../
|
|
117
|
+
end: import('../../../index.ts').CLISODate | null;
|
|
118
|
+
start: import('../../../index.ts').CLISODate | null;
|
|
115
119
|
} | null) => any;
|
|
116
120
|
"date-select": (date: string) => any;
|
|
117
121
|
}, import('vue').PublicProps, {
|
|
122
|
+
width: string;
|
|
123
|
+
allowedDates: CLAllowedDates;
|
|
124
|
+
isRange: boolean;
|
|
118
125
|
color: CLColors;
|
|
119
126
|
fluid: boolean;
|
|
120
127
|
testId: string;
|
|
121
|
-
width: string;
|
|
122
128
|
busy: boolean;
|
|
123
129
|
disabled: boolean;
|
|
124
|
-
isRange: boolean;
|
|
125
130
|
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
126
131
|
P: {};
|
|
127
132
|
B: {};
|
|
@@ -131,13 +136,13 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
131
136
|
Defaults: {};
|
|
132
137
|
}, Readonly<{
|
|
133
138
|
modelValue?: {
|
|
134
|
-
end: import('../../../
|
|
135
|
-
start: import('../../../
|
|
139
|
+
end: import('../../../index.ts').CLISODate | null;
|
|
140
|
+
start: import('../../../index.ts').CLISODate | null;
|
|
136
141
|
} | null;
|
|
137
142
|
} & import('../../Form/CLCalendar/CLCalendar.vue').CLCalendarProps> & Readonly<{
|
|
138
143
|
"onUpdate:modelValue"?: ((value: {
|
|
139
|
-
end: import('../../../
|
|
140
|
-
start: import('../../../
|
|
144
|
+
end: import('../../../index.ts').CLISODate | null;
|
|
145
|
+
start: import('../../../index.ts').CLISODate | null;
|
|
141
146
|
} | null) => any) | undefined;
|
|
142
147
|
"onDate-select"?: ((date: string) => any) | undefined;
|
|
143
148
|
}>, {
|
|
@@ -148,13 +153,14 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
148
153
|
initializeDraft: () => void;
|
|
149
154
|
reset: () => void;
|
|
150
155
|
}, {}, {}, {}, {
|
|
156
|
+
width: string;
|
|
157
|
+
allowedDates: CLAllowedDates;
|
|
158
|
+
isRange: boolean;
|
|
151
159
|
color: CLColors;
|
|
152
160
|
fluid: boolean;
|
|
153
161
|
testId: string;
|
|
154
|
-
width: string;
|
|
155
162
|
busy: boolean;
|
|
156
163
|
disabled: boolean;
|
|
157
|
-
isRange: boolean;
|
|
158
164
|
}> | null;
|
|
159
165
|
}, HTMLDivElement>;
|
|
160
166
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLModalTimePicker.css';
|
|
3
|
-
import{defineComponent as e,mergeModels as t,ref as a,computed as o,useModel as i,onMounted as l,onBeforeUnmount as u,createBlock as r,openBlock as d,withCtx as n,createElementVNode as s,normalizeClass as b,createCommentVNode as c,createVNode as m,createElementBlock as f,unref as p,createTextVNode as v,toDisplayString as _,nextTick as y}from"vue";import{_ as h}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-pE0JrYmS.js";import{_ as k}from"../../../chunks/CLFormField.vue_vue_type_style_index_0_lang-Rf_Mo_VS.js";import{_ as L}from"../../../chunks/CLFormLabel.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import{defineComponent as e,mergeModels as t,ref as a,computed as o,useModel as i,onMounted as l,onBeforeUnmount as u,createBlock as r,openBlock as d,withCtx as n,createElementVNode as s,normalizeClass as b,createCommentVNode as c,createVNode as m,createElementBlock as f,unref as p,createTextVNode as v,toDisplayString as _,nextTick as y}from"vue";import{_ as h}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-pE0JrYmS.js";import{_ as k}from"../../../chunks/CLFormField.vue_vue_type_style_index_0_lang-Rf_Mo_VS.js";import{_ as L}from"../../../chunks/CLFormLabel.vue_vue_type_script_setup_true_lang-Cv4WHr_X.js";import{CLTimePicker as $}from"../../Form/CLTimePicker/CLTimePicker.js";import{_ as X}from"../../../chunks/CLModal.vue_vue_type_style_index_0_lang-DFQqYIGs.js";import{c as C,e as B,f as z,h as w,a as g,b as F}from"../../../chunks/index-DsloP0ml.js";import{a as x}from"../../../chunks/index-wkMXT2wB.js";import{useTimePicker as R}from"../../../composables/useTimePicker.js";import{i as S}from"../../../chunks/helper-BlxFN3eF.js";const q=["data-testid"],V=["name","value","required"],j=/* @__PURE__ */e({name:"CLModalTimePicker",__name:"CLModalTimePicker",props:/* @__PURE__ */t({buttonAriaLabel:{default:void 0},buttonBorderRadius:{default:void 0},buttonColor:{default:F.Primary},buttonLabel:{default:"Select time"},buttonSize:{default:C.Small},buttonVariant:{default:g.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:{},label:{default:void 0},name:{default:void 0},onBlur:{type:Function,default:void 0},onChange:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},onReset:{type:Function,default:void 0},orientation:{default:x.Vertical},required:{type:Boolean,default:!1},testId:{default:"clll-time-picker-modal"},title:{default:"Select time"},use24Hour:{type:Boolean,default:!1}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,j="clll-time-picker-modal",P=a(!1),T=o(()=>`time-picker-modal-${t.id}`),M=a(),H=i(e,"modelValue"),{formattedLabel:W}=R({appliedTime:H,use24Hour:t.use24Hour}),E=a(!1),A=()=>{S&&(E.value=window.innerWidth<480)},I=()=>{if(t.disabled||t.busy)return;A(),P.value=!0,y(()=>{M.value?.initializeDraft()});const e=new FocusEvent("focus",{bubbles:!0,cancelable:!0});t.onFocus?.(e)},N=()=>{P.value=!1,M.value?.cancel();const e=new FocusEvent("blur",{bubbles:!0,cancelable:!0});t.onBlur?.(e)},G=()=>{M.value?.apply(),P.value=!1,t.onChange?.()},D=()=>{M.value?.reset(),t.onReset?.(),t.onChange?.()},O=o(()=>E.value);l(()=>{S&&(A(),window.addEventListener("resize",A))}),u(()=>{S&&window.removeEventListener("resize",A)});const U={[C.Tiny]:B.Tiny,[C.Small]:B.Small,[C.Medium]:B.Medium,[C.Large]:B.Large,[C.XL]:B.XL,[C.XXL]:B.XXL,[C.XXXL]:B.XXXL,[C.XXXXL]:B.XXXXL},J=o(()=>[j,t.buttonBorderRadius?`${j}--${t.buttonBorderRadius}`:"",t.busy?`${j}--busy`:`${j}--ready`,`${j}--${t.buttonColor}`,`${j}--${t.buttonSize}`,`${j}--${t.buttonVariant}`,t.disabled||t.busy?`${j}--disabled`:`${j}--active`,t.fluid||t.orientation===x.Horizontal?`${j}--fluid`:`${j}--fixed`,t.label?`${j}--haslabel`:"",t.orientation?`${j}--${t.orientation}`:"",t.required?`${j}--required`:`${j}--optional`]);return(t,a)=>(d(),r(k,{fluid:e.fluid,orientation:e.orientation},{default:n(()=>[s("div",{class:b(J.value),"data-testid":e.testId},[e.label?(d(),r(L,{key:0,"css-prefix":j,"html-for":e.id,label:e.label,required:e.required,size:e.buttonSize,onClick:I},null,8,["html-for","label","required","size"])):c("",!0),m(p(h),{id:e.id,"aria-label":e.buttonAriaLabel||"Open time picker","border-radius":e.buttonBorderRadius,busy:e.busy,color:e.buttonColor,disabled:e.disabled||e.busy,"icon-before":p(z).Clock,"icon-size":U[e.buttonSize],"on-click":I,"test-id":`${e.testId}__trigger`,size:e.buttonSize,variant:e.buttonVariant,width:e.buttonWidth,wrap:e.buttonWrapped},{default:n(()=>[v(_(p(W)||e.buttonLabel),1)]),_:1},8,["id","aria-label","border-radius","busy","color","disabled","icon-before","icon-size","test-id","size","variant","width","wrap"]),e.name||e.required?(d(),f("input",{key:1,class:b(`${j}__hidden-input`),name:e.name,value:p(W)||"",required:e.required,tabindex:"-1","aria-hidden":"true"},null,10,V)):c("",!0),m(p(X),{"border-radius":O.value?p(w).None:p(w).Medium,fullscreen:O.value,"is-open":P.value,"max-width":"340px","modal-id":T.value,"on-close":N,title:e.title},{body:n(()=>[m(p($),{ref_key:"timePickerRef",ref:M,modelValue:H.value,"onUpdate:modelValue":a[0]||(a[0]=e=>H.value=e),busy:e.busy,disabled:e.disabled,fluid:O.value,"use24-hour":e.use24Hour},null,8,["modelValue","busy","disabled","fluid","use24-hour"])]),footer:n(()=>[s("div",{class:b(`${j}__footer-actions`)},[m(p(h),{"border-radius":e.buttonBorderRadius,color:p(F).Neutral,variant:p(g).Ghost,"on-click":N},{default:n(()=>[...a[1]||(a[1]=[v(" Cancel ",-1)])]),_:1},8,["border-radius","color","variant"]),s("div",{class:b(`${j}__footer-right`)},[m(p(h),{"border-radius":e.buttonBorderRadius,color:p(F).Neutral,variant:p(g).Ghost,"on-click":D},{default:n(()=>[...a[2]||(a[2]=[v(" Reset ",-1)])]),_:1},8,["border-radius","color","variant"]),m(p(h),{"border-radius":e.buttonBorderRadius,color:p(F).Primary,"on-click":G},{default:n(()=>[...a[3]||(a[3]=[v(" Apply ",-1)])]),_:1},8,["border-radius","color"])],2)],2)]),_:1},8,["border-radius","fullscreen","is-open","modal-id","title"])],10,q)]),_:1},8,["fluid","orientation"]))}});export{j as CLModalTimePicker,j as default};
|
|
@@ -56,11 +56,11 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
56
56
|
} & CLModalTimePickerProps> & Readonly<{
|
|
57
57
|
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
58
58
|
}>, {
|
|
59
|
-
fluid: boolean;
|
|
60
|
-
testId: string;
|
|
61
|
-
name: string;
|
|
62
59
|
label: string;
|
|
63
60
|
title: string;
|
|
61
|
+
name: string;
|
|
62
|
+
fluid: boolean;
|
|
63
|
+
testId: string;
|
|
64
64
|
onFocus: CLGenericFocusFunction;
|
|
65
65
|
onBlur: CLGenericFocusFunction;
|
|
66
66
|
onChange: CLGenericFunction;
|
|
@@ -97,10 +97,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
97
97
|
"update:modelValue": (value: string | null) => any;
|
|
98
98
|
"time-select": (time: string) => any;
|
|
99
99
|
}, import('vue').PublicProps, {
|
|
100
|
+
width: string;
|
|
100
101
|
color: CLColors;
|
|
101
102
|
fluid: boolean;
|
|
102
103
|
testId: string;
|
|
103
|
-
width: string;
|
|
104
104
|
use24Hour: boolean;
|
|
105
105
|
busy: boolean;
|
|
106
106
|
disabled: boolean;
|
|
@@ -127,10 +127,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
127
127
|
initializeDraft: () => void;
|
|
128
128
|
reset: () => void;
|
|
129
129
|
}, {}, {}, {}, {
|
|
130
|
+
width: string;
|
|
130
131
|
color: CLColors;
|
|
131
132
|
fluid: boolean;
|
|
132
133
|
testId: string;
|
|
133
|
-
width: string;
|
|
134
134
|
use24Hour: boolean;
|
|
135
135
|
busy: boolean;
|
|
136
136
|
disabled: boolean;
|
|
@@ -8,11 +8,11 @@ export declare const CLModalTimePicker: import('vue').DefineComponent<{
|
|
|
8
8
|
} & import('./CLModalTimePicker.vue').CLModalTimePickerProps> & Readonly<{
|
|
9
9
|
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
10
10
|
}>, {
|
|
11
|
-
fluid: boolean;
|
|
12
|
-
testId: string;
|
|
13
|
-
name: string;
|
|
14
11
|
label: string;
|
|
15
12
|
title: string;
|
|
13
|
+
name: string;
|
|
14
|
+
fluid: boolean;
|
|
15
|
+
testId: string;
|
|
16
16
|
onFocus: import('../../..').CLGenericFocusFunction;
|
|
17
17
|
onBlur: import('../../..').CLGenericFocusFunction;
|
|
18
18
|
onChange: import('../../..').CLGenericFunction;
|
|
@@ -49,10 +49,10 @@ export declare const CLModalTimePicker: import('vue').DefineComponent<{
|
|
|
49
49
|
"update:modelValue": (value: string | null) => any;
|
|
50
50
|
"time-select": (time: string) => any;
|
|
51
51
|
}, import('vue').PublicProps, {
|
|
52
|
+
width: string;
|
|
52
53
|
color: import('@codeandfunction/callaloo-tokens').CLColors;
|
|
53
54
|
fluid: boolean;
|
|
54
55
|
testId: string;
|
|
55
|
-
width: string;
|
|
56
56
|
use24Hour: boolean;
|
|
57
57
|
busy: boolean;
|
|
58
58
|
disabled: boolean;
|
|
@@ -79,10 +79,10 @@ export declare const CLModalTimePicker: import('vue').DefineComponent<{
|
|
|
79
79
|
initializeDraft: () => void;
|
|
80
80
|
reset: () => void;
|
|
81
81
|
}, {}, {}, {}, {
|
|
82
|
+
width: string;
|
|
82
83
|
color: import('@codeandfunction/callaloo-tokens').CLColors;
|
|
83
84
|
fluid: boolean;
|
|
84
85
|
testId: string;
|
|
85
|
-
width: string;
|
|
86
86
|
use24Hour: boolean;
|
|
87
87
|
busy: boolean;
|
|
88
88
|
disabled: boolean;
|
|
@@ -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 s,renderList as i,createVNode as o,withCtx as c,createTextVNode as u,toDisplayString as d}from"vue";import{_}from"../../../chunks/CLNavLink.vue_vue_type_script_setup_true_lang-BXjSe15F.js";import{_ as m}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{defineComponent as e,computed as t,createElementBlock as a,openBlock as l,normalizeClass as r,unref as n,Fragment as s,renderList as i,createVNode as o,withCtx as c,createTextVNode as u,toDisplayString as d}from"vue";import{_}from"../../../chunks/CLNavLink.vue_vue_type_script_setup_true_lang-BXjSe15F.js";import{_ as m}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-DR2zoTEJ.js";import{b as p}from"../../../chunks/index-DsloP0ml.js";import{a as f}from"../../../chunks/index-wkMXT2wB.js";const v=["data-testid"],k=/* @__PURE__ */e({name:"CLNavSection",__name:"CLNavSection",props:{color:{default:p.Primary},navItems:{},testId:{default:"clll-nav-section"},type:{default:f.Horizontal}},setup(e){const p=e,f="clll-nav-section",k=t(()=>[f,`${f}--${p.type}`]);return(t,p)=>(l(),a("ul",{class:r(n(k)),"data-testid":e.testId},[(l(!0),a(s,null,i(e.navItems,(t,r)=>(l(),a("li",{key:`link-${t.id}-${r}`,class:"clll-nav-section__item"},[o(n(_),{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(()=>[o(n(m),{as:"span"},{default:c(()=>[u(d(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 t,computed as o,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 f,renderSlot as b}from"vue";import{u as m,a as _,f as v,o as w,s as g}from"../../../chunks/floating-ui.vue-C0JWy0Dz.js";import{_ as h}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-pE0JrYmS.js";import{_ as y}from"../../../chunks/CLCard.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{defineComponent as e,ref as t,computed as o,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 f,renderSlot as b}from"vue";import{u as m,a as _,f as v,o as w,s as g}from"../../../chunks/floating-ui.vue-C0JWy0Dz.js";import{_ as h}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-pE0JrYmS.js";import{_ as y}from"../../../chunks/CLCard.vue_vue_type_style_index_0_lang-CAg8Jmzv.js";import{b as B,i as $}from"../../../chunks/helper-BlxFN3eF.js";import{useDropdown as z}from"../../../composables/useDropdown.js";import{useEsc as k}from"../../../composables/useEsc.js";import{n as x,e as I,f as C,a as E,c as L,b as D,i as S}from"../../../chunks/index-DsloP0ml.js";const H=["data-testid"],j=["id","aria-labelledby","aria-hidden"],O=/* @__PURE__ */e({name:"CLDropdownMenu",__name:"CLDropdownMenu",props:{buttonAlign:{default:S.Center},buttonAriaLabel:{},buttonBorderRadius:{},buttonBusy:{type:Boolean},buttonColor:{default:D.Secondary},buttonDisabled:{type:Boolean},buttonHeight:{default:"auto"},buttonSize:{default:L.Small},buttonVariant:{default:E.Soft},buttonWidth:{default:"auto"},buttonWrapped:{type:Boolean},containerBordered:{type:Boolean,default:!0},containerBorderRadius:{},containerElevated:{type:Boolean,default:!1},contentWidth:{default:"auto"},dropdownId:{},fluid:{type:Boolean,default:!1},iconAfter:{default:C.ChevronDown},iconBefore:{},iconSize:{default:I.Tiny},isOpen:{type:Boolean,default:!1},label:{},onCloseHandler:{},onOpenHandler:{},placement:{default:x.BottomStart},testId:{default:"clll-dropdown-menu"},zIndex:{default:30}},setup(e,{expose:x}){const I=e;let C=t(),L=t();const S=t(),O=t(),A=t(I.isOpen),W=t(I.placement),R="clll-dropdown-menu",M=o(()=>"auto"===I.zIndex||B(I.zIndex)?I.zIndex:I.zIndex.toString()),V=e=>{e&&(C.value=e)},G=e=>{e&&(L.value=e)},N=()=>{T.value?F():q()},{open:T,openDropdown:q,closeDropdown:F,clearEventListeners:J}=z({triggerElem:C,dropdownRef:O,openDropdownHandler:()=>{A.value=!0,I?.onOpenHandler?.(),P(),$&&document.addEventListener("click",Q)},closeDropdownHandler:()=>{A.value=!1,I?.onCloseHandler?.(),$&&document.removeEventListener("click",Q),U(),J()}});x({close:()=>{F(),J(),U()},open:()=>{q()}});const{floatingStyles:K,update:P}=m(S,O,{middleware:[v(),w(10),g()],placement:W,open:A,whileElementsMounted:_}),Q=e=>{A.value&&O.value?.contains(e?.target)&&F()},{clearEventListeners:U}=k({escHandler:F,triggerElem:C});return n(()=>{$&&document.removeEventListener("click",Q),U(),J()}),(t,o)=>(d(),a("div",{class:r([`${R}__menu`,e.fluid?`${R}__menu--fluid`:""]),"data-testid":e.testId},[l(s(h),{id:`${R}__toggle--${e.dropdownId}`,ref_key:"anchor",ref:S,"aria-controls":`${R}--${e.dropdownId}`,"aria-expanded":s(A)||e.isOpen,"aria-label":e.buttonAriaLabel,"align-content":e.buttonAlign,busy:e.buttonBusy,disabled:e.buttonDisabled||e.buttonBusy,class:r(`${R}__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":`${R}__toggle`,variant:e.buttonVariant,width:e.fluid?"100%":e.buttonWidth,wrap:e.buttonWrapped,"on-click":N},{default:u(()=>[c(p(e.label),1)]),_:1},8,["id","aria-controls","aria-expanded","aria-label","align-content","busy","disabled","class","color","border-radius","height","icon-after","icon-before","icon-size","size","test-id","variant","width","wrap"]),s(A)||e.isOpen?(d(),a("div",{key:0,id:`${R}--${e.dropdownId}`,ref_key:"dropdownElem",ref:O,"aria-labelledby":`${R}__toggle--${e.dropdownId}`,"aria-hidden":!(s(A)||e.isOpen),class:r([`${R}__dropdown`,`${R}__dropdown--${s(W)}`]),style:f({...s(K),zIndex:s(M)})},[l(s(y),{bordered:e.containerBordered,"border-radius":e.containerBorderRadius,color:s(D).Neutral,elevated:e.containerElevated,"forward-ref":G,padded:!1,"test-id":`${R}__content`,variant:s(E).Ghost,width:e.contentWidth},{default:u(()=>[b(t.$slots,"content")]),_:3},8,["bordered","border-radius","color","elevated","test-id","variant","width"])],14,j)):i("",!0)],10,H))}});export{O as CLDropdownMenu,O as default};
|
|
@@ -126,18 +126,18 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<CL
|
|
|
126
126
|
$emit: (event: string, ...args: any[]) => void;
|
|
127
127
|
$el: any;
|
|
128
128
|
$options: import('vue').ComponentOptionsBase<Readonly<import('../../Buttons/CLButton/CLButton.vue').CLButtonProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
129
|
+
width: string;
|
|
130
|
+
height: string;
|
|
131
|
+
form: string;
|
|
132
|
+
title: string;
|
|
129
133
|
size: CLSizes;
|
|
130
134
|
color: CLColors;
|
|
131
135
|
variant: CLColorVariants;
|
|
132
136
|
rounded: boolean;
|
|
133
137
|
testId: string;
|
|
134
138
|
type: import('../../../types').CLButtonTypes;
|
|
135
|
-
form: string;
|
|
136
|
-
title: string;
|
|
137
139
|
onClick: (event?: Event) => void;
|
|
138
140
|
target: import('@codeandfunction/callaloo-types').CLLinkTarget;
|
|
139
|
-
width: string;
|
|
140
|
-
height: string;
|
|
141
141
|
borderRadius: CLBorderRadius;
|
|
142
142
|
iconFilled: boolean;
|
|
143
143
|
iconSize: CLIconSizes;
|
|
@@ -175,18 +175,18 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<CL
|
|
|
175
175
|
$nextTick: typeof import('vue').nextTick;
|
|
176
176
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
177
177
|
} & Readonly<{
|
|
178
|
+
width: string;
|
|
179
|
+
height: string;
|
|
180
|
+
form: string;
|
|
181
|
+
title: string;
|
|
178
182
|
size: CLSizes;
|
|
179
183
|
color: CLColors;
|
|
180
184
|
variant: CLColorVariants;
|
|
181
185
|
rounded: boolean;
|
|
182
186
|
testId: string;
|
|
183
187
|
type: import('../../../types').CLButtonTypes;
|
|
184
|
-
form: string;
|
|
185
|
-
title: string;
|
|
186
188
|
onClick: (event?: Event) => void;
|
|
187
189
|
target: import('@codeandfunction/callaloo-types').CLLinkTarget;
|
|
188
|
-
width: string;
|
|
189
|
-
height: string;
|
|
190
190
|
borderRadius: CLBorderRadius;
|
|
191
191
|
iconFilled: boolean;
|
|
192
192
|
iconSize: CLIconSizes;
|
|
@@ -203,7 +203,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<CL
|
|
|
203
203
|
iconBefore: CLIconNames | null;
|
|
204
204
|
pill: boolean;
|
|
205
205
|
wrap: boolean;
|
|
206
|
-
}> & Omit<Readonly<import('../../Buttons/CLButton/CLButton.vue').CLButtonProps> & Readonly<{}>, "
|
|
206
|
+
}> & Omit<Readonly<import('../../Buttons/CLButton/CLButton.vue').CLButtonProps> & Readonly<{}>, "width" | "height" | "form" | "title" | "size" | "color" | "variant" | "rounded" | "testId" | "type" | "onClick" | "target" | "borderRadius" | "iconFilled" | "iconSize" | "href" | "active" | "alignContent" | "ariaLabel" | "as" | "busy" | "disabled" | "elevated" | "forwardRef" | "iconAfter" | "iconBefore" | "pill" | "wrap"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
207
207
|
$slots: {
|
|
208
208
|
default?(_: {}): any;
|
|
209
209
|
};
|
|
@@ -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-DM_9Iykj.js";export{s as CLToast,s as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CLIconSizes, CLColors, CLToastPosition, CLToastProps } from '../../../index.ts';
|
|
2
2
|
declare const _default: import('vue').DefineComponent<CLToastProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CLToastProps> & Readonly<{}>, {
|
|
3
|
+
width: string;
|
|
3
4
|
color: CLColors;
|
|
4
5
|
rounded: boolean;
|
|
5
6
|
testId: string;
|
|
6
|
-
width: string;
|
|
7
7
|
dismissTimer: number;
|
|
8
8
|
iconFilled: boolean;
|
|
9
9
|
iconSize: CLIconSizes;
|
|
@@ -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-DM_9Iykj.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,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLHeading.css';
|
|
3
|
-
import{_ as e}from"../../../chunks/CLHeading.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{_ as e}from"../../../chunks/CLHeading.vue_vue_type_style_index_0_lang-CYgxrrIE.js";export{e as CLHeading,e as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLText.css';
|
|
3
|
-
import{_ as e}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{_ as e}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-DR2zoTEJ.js";export{e as CLText,e as default};
|
|
@@ -1,41 +1,51 @@
|
|
|
1
1
|
import { ComputedRef, MaybeRef, Ref } from 'vue';
|
|
2
|
-
export type
|
|
3
|
-
export
|
|
4
|
-
|
|
2
|
+
export type CLISODate = string;
|
|
3
|
+
export type ISODate = CLISODate;
|
|
4
|
+
export type CLAllowedDates = CLISODate[] | {
|
|
5
|
+
end?: CLISODate | null;
|
|
6
|
+
start?: CLISODate | null;
|
|
7
|
+
} | ((date: CLISODate) => boolean);
|
|
8
|
+
export type AllowedDates = CLAllowedDates;
|
|
9
|
+
export interface CLCalendarCell {
|
|
10
|
+
date: CLISODate | null;
|
|
5
11
|
day: number | null;
|
|
12
|
+
isDisabled: boolean;
|
|
6
13
|
isOutsideMonth: boolean;
|
|
7
14
|
}
|
|
15
|
+
export type CalendarCell = CLCalendarCell;
|
|
8
16
|
interface Input {
|
|
9
|
-
|
|
10
|
-
|
|
17
|
+
allowedDates?: MaybeRef<CLAllowedDates | undefined>;
|
|
18
|
+
appliedEnd?: Ref<CLISODate | null>;
|
|
19
|
+
appliedStart?: Ref<CLISODate | null>;
|
|
11
20
|
isRange?: MaybeRef<boolean>;
|
|
12
21
|
}
|
|
13
22
|
interface Return {
|
|
14
|
-
calendarGrid: ComputedRef<
|
|
23
|
+
calendarGrid: ComputedRef<CLCalendarCell[]>;
|
|
15
24
|
cancelDraft: () => void;
|
|
16
25
|
clearDraft: () => void;
|
|
17
26
|
currentDate: Ref<Date>;
|
|
18
27
|
currentMonthLabel: ComputedRef<string>;
|
|
19
|
-
draftEnd: Ref<
|
|
20
|
-
draftStart: Ref<
|
|
21
|
-
formatDateToISO: (date: Date) =>
|
|
22
|
-
formatHumanDate: (iso:
|
|
23
|
-
formatLongDate: (iso:
|
|
24
|
-
formatShortNoYear: (iso:
|
|
25
|
-
formatShortWithYear: (iso:
|
|
26
|
-
getDayAriaLabel: (iso:
|
|
28
|
+
draftEnd: Ref<CLISODate | null>;
|
|
29
|
+
draftStart: Ref<CLISODate | null>;
|
|
30
|
+
formatDateToISO: (date: Date) => CLISODate;
|
|
31
|
+
formatHumanDate: (iso: CLISODate) => string;
|
|
32
|
+
formatLongDate: (iso: CLISODate) => string;
|
|
33
|
+
formatShortNoYear: (iso: CLISODate) => string;
|
|
34
|
+
formatShortWithYear: (iso: CLISODate) => string;
|
|
35
|
+
getDayAriaLabel: (iso: CLISODate) => string;
|
|
27
36
|
handleNextMonth: () => void;
|
|
28
37
|
handlePrevMonth: () => void;
|
|
29
38
|
initializeDraft: () => void;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
isDateDisabled: (iso: CLISODate) => boolean;
|
|
40
|
+
isDraftEnd: (iso: CLISODate) => boolean;
|
|
41
|
+
isDraftSameDay: (iso: CLISODate) => boolean;
|
|
42
|
+
isDraftStart: (iso: CLISODate) => boolean;
|
|
43
|
+
isInDraftRange: (iso: CLISODate) => boolean;
|
|
44
|
+
isoToLocalDate: (iso: CLISODate) => Date;
|
|
45
|
+
onDayClick: (iso: CLISODate | null) => void;
|
|
36
46
|
rangeLabel: ComputedRef<string | undefined>;
|
|
37
47
|
setCalendarMonthToAppliedOrToday: () => void;
|
|
38
48
|
weekDays: string[];
|
|
39
49
|
}
|
|
40
|
-
export declare const useDatePicker: ({ appliedEnd, appliedStart, isRange }?: Input) => Return;
|
|
50
|
+
export declare const useDatePicker: ({ allowedDates, appliedEnd, appliedStart, isRange }?: Input) => Return;
|
|
41
51
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../assets/core.css';
|
|
2
|
-
import{ref as e,onMounted as a,computed as t,unref as l}from"vue";const u=({
|
|
2
|
+
import{ref as e,onMounted as a,computed as t,unref as l}from"vue";const u=({allowedDates:u,appliedEnd:n,appliedStart:r,isRange:o=!0}={})=>{const v=e(/* @__PURE__ */new Date),i=e(null),s=e(null),d=e(!1);a(()=>{d.value=!0});const g=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`),c=e=>d.value?D(e).toLocaleDateString("default",{day:"numeric",month:"long",weekday:"long",year:"numeric"}):e,f=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)}`},y=t(()=>{const e=l(u);return null==e&&!!l(o)}),$=e=>{const a=l(u);return null!=a&&(Array.isArray(a)?!a.includes(e):"function"==typeof a?!a(e):"object"==typeof a&&(!!(a.start&&e<a.start)||!!(a.end&&e>a.end)))},S=()=>{let e;if(r?.value)e=D(r.value);else{const a=/* @__PURE__ */new Date,t=g(a),n=l(u);e=n&&$(t)?Array.isArray(n)&&n.length>0?D(n[0]):"object"==typeof n&&"start"in n&&n.start?D(n.start):a:a}v.value=new Date(e.getFullYear(),e.getMonth(),1)},m=t(()=>{if(!d.value){return`${v.value.getMonth()+1}/${v.value.getFullYear()}`}return v.value.toLocaleString("default",{month:"long",year:"numeric"})}),p=t(()=>{const e=r?.value??null,a=n?.value??null;if(!e)return;if(!y.value)return h(e);if(!a)return h(e);return D(e).getFullYear()!==D(a).getFullYear()?`${h(e)} - ${h(a)}`:`${f(e)} - ${f(a)}`}),M=e=>s.value===e,w=e=>i.value===e,Y=e=>Boolean(y.value&&s.value&&i.value&&s.value===i.value&&s.value===e),b=e=>!!y.value&&(!!s.value&&(i.value?e>=s.value&&e<=i.value:e===s.value));return{calendarGrid:t(()=>{const e=v.value.getFullYear(),a=v.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 v=0;v<n;v++){const t=u-(n-1-v),l=g(new Date(e,a-1,t));r.push({day:t,date:l,isDisabled:$(l),isOutsideMonth:!0})}for(let v=1;v<=l;v++){const t=g(new Date(e,a,v));r.push({day:v,date:t,isDisabled:$(t),isOutsideMonth:!1})}let o=1;for(;r.length<42;){const t=g(new Date(e,a+1,o));r.push({day:o,date:t,isDisabled:$(t),isOutsideMonth:!0}),o++}return r}),cancelDraft:()=>{s.value=r?.value??null,i.value=n?.value??null},clearDraft:()=>{r&&(r.value=null),n&&(n.value=null),s.value=null,i.value=null},currentDate:v,currentMonthLabel:m,draftEnd:i,draftStart:s,formatDateToISO:g,formatHumanDate:e=>d.value?D(e).toLocaleDateString("default",{day:"numeric",month:"short",year:"numeric"}):e,formatLongDate:c,formatShortNoYear:f,formatShortWithYear:h,getDayAriaLabel:e=>$(e)?`${c(e)} (disabled)`:y.value?Y(e)?`${c(e)} (same day selected)`:M(e)?`${c(e)} (start date)`:w(e)?`${c(e)} (end date)`:b(e)?`${c(e)} (in range)`:c(e):M(e)?`${c(e)} (selected)`:c(e),handleNextMonth:()=>{v.value=new Date(v.value.getFullYear(),v.value.getMonth()+1,1)},handlePrevMonth:()=>{v.value=new Date(v.value.getFullYear(),v.value.getMonth()-1,1)},initializeDraft:()=>{S(),s.value=r?.value??null,i.value=n?.value??null},isDateDisabled:$,isDraftEnd:w,isDraftSameDay:Y,isDraftStart:M,isInDraftRange:b,isoToLocalDate:D,onDayClick:e=>{if(e&&!$(e))return y.value?!s.value||s.value&&i.value?(s.value=e,void(i.value=null)):e<s.value?(i.value=s.value,void(s.value=e)):void(i.value=e):(s.value=e,void(i.value=null))},rangeLabel:p,setCalendarMonthToAppliedOrToday:S,weekDays:["Su","Mo","Tu","We","Th","Fr","Sa"]}};export{u as useDatePicker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../assets/core.css';
|
|
2
|
-
import{ref as
|
|
2
|
+
import{T as o}from"../chunks/context-BrNC8CsD.js";import{ref as e,getCurrentInstance as r,inject as a}from"vue";import{D as n}from"../chunks/index-DsloP0ml.js";const s=e(n.borderRadius),t=e(n.darkMode),l=e(n.fontFamily),u=e(n.colors||{primary:{},secondary:{},neutral:{},danger:{},warning:{},success:{},info:{}}),m=()=>{const e=r(),n=e?.type.name||"(anonymous component)",m=a(o,null);return m||(console.warn(`[Callaloo]: useTheme() must be used within a <CLThemeProvider />. Called from component: ${n}`,(new Error).stack),{borderRadius:s,colors:u,darkMode:t,fontFamily:l,setBorderRadius:o=>{s.value=o},setColors:o=>{u.value={...u.value,...o}},setDarkMode:o=>{t.value=o},setFontFamily:o=>{l.value=o}})};export{m as useTheme};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { CLAlign, CLBorderRadius, CLButtonTypes, CLCardTypes, CLCharCounterLayout, CLColors, CLColorVariants, CLHeadingLevels, CLHeadingTypes, CLIconSizes, CLIconNames, CLInputTypes, CLLinkTarget, CLLoading, CLMessageType, CLMode, CLOrientation, CLOverflow, CLOrder, CLPaginationType, CLPlacement, CLPosition, CLDrawerPosition, CLSizes, CLTableTypes, CLTextTypes, CLToastPosition } from './types';
|
|
2
|
-
export type { CLBlockTextHtmlTags, CLButtonTags, CLButtonForwardRefFunction, CLGenericFunction, CLGenericFocusFunction, CLGenericInputFunction, CLInlineTextHtmlTags, CLNavItem, CLOption, CLPalette, CLPaletteKeys, CLShades, CLTextHtmlTags, CLThemeConfig, CLToastProps } from './types';
|
|
2
|
+
export type { CLAllowedDates, CLBlockTextHtmlTags, CLButtonTags, CLButtonForwardRefFunction, CLCalendarCell, CLGenericFunction, CLGenericFocusFunction, CLGenericInputFunction, CLInlineTextHtmlTags, CLISODate, CLNavItem, CLOption, CLPalette, CLPaletteKeys, CLShades, CLTextHtmlTags, CLThemeConfig, CLToastProps } from './types';
|