@codeandfunction/callaloo 5.15.0 → 5.15.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-CSvstf_s.js → CLCalendar.vue_vue_type_style_index_0_lang-BsB4QKTu.js} +1 -1
- package/dist/chunks/{CLCard.vue_vue_type_style_index_0_lang-BVlHv7LY.js → CLCard.vue_vue_type_style_index_0_lang-D3JriMVx.js} +1 -1
- package/dist/chunks/{CLFormLabel.vue_vue_type_script_setup_true_lang-BogK17TG.js → CLFormLabel.vue_vue_type_script_setup_true_lang-D7UZMu_6.js} +1 -1
- package/dist/chunks/{CLHeading.vue_vue_type_style_index_0_lang-C2wvAR1Y.js → CLHeading.vue_vue_type_style_index_0_lang-Bp0Hmc-g.js} +1 -1
- package/dist/chunks/{CLInputMessages.vue_vue_type_style_index_0_lang-mu7Jj66U.js → CLInputMessages.vue_vue_type_style_index_0_lang-CtGriC2l.js} +1 -1
- package/dist/chunks/CLModal.vue_vue_type_style_index_0_lang-DNUsoevN.js +2 -0
- package/dist/chunks/{CLPill.vue_vue_type_style_index_0_lang-DhHSCMrs.js → CLPill.vue_vue_type_style_index_0_lang-mVxJKPLS.js} +1 -1
- package/dist/chunks/{CLText.vue_vue_type_style_index_0_lang-DefqjMCJ.js → CLText.vue_vue_type_style_index_0_lang-BZQzsJMF.js} +1 -1
- package/dist/chunks/{CLToast.vue_vue_type_style_index_0_lang-mVNY-T64.js → CLToast.vue_vue_type_style_index_0_lang-D2V4LMvh.js} +1 -1
- package/dist/chunks/{utils-BfPF8gBW.js → utils-BDThP-Sb.js} +1 -1
- package/dist/chunks/utils-DxfNBBvx.js +1 -0
- package/dist/components/CLTable/CLTable.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/CLInputTimePicker/CLInputTimePicker.js +1 -1
- 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.css +1 -1
- package/dist/components/Form/CLTimePicker/CLTimePicker.js +1 -1
- package/dist/components/Form/utils.d.ts +1 -0
- package/dist/components/Indicators/CLBanner/CLBanner.js +1 -1
- package/dist/components/Indicators/CLPill/CLPill.js +1 -1
- package/dist/components/Indicators/CLProgress/CLProgress.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/CLModalTimePicker/CLModalTimePicker.js +1 -1
- package/dist/components/Modals/utils.d.ts +5 -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/components/Typography/CLHeading/CLHeading.js +1 -1
- package/dist/components/Typography/CLText/CLText.js +1 -1
- package/dist/composables/useTheme.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/chunks/CLModal.vue_vue_type_style_index_0_lang-Dvchz9BJ.js +0 -2
- package/dist/chunks/utils-CfJLUMQf.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../components/Form/CLCalendar/CLCalendar.css';
|
|
2
|
-
import{defineComponent as e,mergeModels as a,useCssVars as l,useModel as t,ref as i,toRef as d,watch as r,onMounted as s,createElementBlock as o,openBlock as n,normalizeStyle as u,normalizeClass as c,unref as p,createElementVNode as f,createVNode as v,withCtx as m,createTextVNode as y,toDisplayString as _,Fragment as h,renderList as b,createBlock as g,createCommentVNode as D}from"vue";import{_ as k}from"./CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{_ as x}from"./CLText.vue_vue_type_style_index_0_lang-
|
|
2
|
+
import{defineComponent as e,mergeModels as a,useCssVars as l,useModel as t,ref as i,toRef as d,watch as r,onMounted as s,createElementBlock as o,openBlock as n,normalizeStyle as u,normalizeClass as c,unref as p,createElementVNode as f,createVNode as v,withCtx as m,createTextVNode as y,toDisplayString as _,Fragment as h,renderList as b,createBlock as g,createCommentVNode as D}from"vue";import{_ as k}from"./CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{_ as x}from"./CLText.vue_vue_type_style_index_0_lang-BZQzsJMF.js";import{c as z,C,e as w,f as S,h as $,a as L,d as j,i as M}from"./index-DwjW-Z-U.js";import{c as T}from"./utils-BDThP-Sb.js";import{useDatePicker as B}from"../composables/useDatePicker.js";import{useTheme as P}from"../composables/useTheme.js";const R=["data-testid"],E=/* @__PURE__ */e({name:"CLCalendar",__name:"CLCalendar",props:/* @__PURE__ */a({color:{default:j.Primary},disabled:{type:Boolean,default:!1},busy:{type:Boolean,default:!1},isRange:{type:Boolean,default:!0},fluid:{type:Boolean,default:!1},testId:{default:"clll-calendar"},width:{default:"280px"}},{modelValue:{},modelModifiers:{}}),emits:/* @__PURE__ */a(["date-select"],["update:modelValue"]),setup(e,{expose:a,emit:E}){l(e=>({v5d82e3ae:e.width}));const G=e,F=E,I=P(),N="clll-calendar",V=t(e,"modelValue"),A=i(V.value?.end??null),O=i(V.value?.start??null),{calendarGrid:q,cancelDraft:H,clearDraft:J,currentMonthLabel:K,draftEnd:Q,draftStart:U,getDayAriaLabel:W,handleNextMonth:X,handlePrevMonth:Y,initializeDraft:Z,isDraftEnd:ee,isDraftSameDay:ae,isDraftStart:le,isInDraftRange:te,onDayClick:ie,weekDays:de}=B({appliedEnd:A,appliedStart:O,isRange:d(G,"isRange")});r(V,e=>{O.value=e?.start??null,A.value=e?.end??null,Z()},{deep:!0}),s(()=>{Z()});return a({apply:()=>{O.value=U.value,A.value=Q.value,V.value={end:A.value,start:O.value}},cancel:()=>{H()},draftEnd:Q,draftStart:U,initializeDraft:Z,reset:()=>{J(),O.value=null,A.value=null,V.value=null}}),(a,l)=>(n(),o("div",{class:c([N,e.fluid?`${N}__fluid`:""]),"data-testid":e.testId,style:u(p(T)(p(I)))},[f("div",{class:c(`${N}__header`)},[v(p(k),{"aria-label":"Previous month","border-radius":p($).Full,"icon-before":p(S).ChevronLeft,"icon-size":p(w).Tiny,"on-click":p(Y),size:p(C).Tiny,variant:p(z).Ghost,height:"32px",width:"32px",wrap:""},null,8,["border-radius","icon-before","icon-size","on-click","size","variant"]),v(p(x),{type:p(L).Medium,medium:""},{default:m(()=>[y(_(p(K)),1)]),_:1},8,["type"]),v(p(k),{"aria-label":"Next month","border-radius":p($).Full,"icon-before":p(S).ChevronRight,"icon-size":p(w).Tiny,"on-click":p(X),size:p(C).Tiny,variant:p(z).Ghost,height:"32px",width:"32px",wrap:""},null,8,["border-radius","icon-before","icon-size","on-click","size","variant"])],2),f("div",{class:c(`${N}__grid`)},[(n(!0),o(h,null,b(p(de),e=>(n(),o("div",{key:e,class:c(`${N}__weekday`)},[v(p(x),{align:p(M).Center,color:p(j).Neutral,type:p(L).Small},{default:m(()=>[y(_(e),1)]),_:2},1032,["align","color","type"])],2))),128)),(n(!0),o(h,null,b(p(q),(a,l)=>(n(),o("div",{key:a.date??`pad-${l}`,class:c([`${N}__cell`,a.isOutsideMonth?`${N}__cell--outside`:"",a.date&&p(ae)(a.date)?`${N}__cell--same-day`:""])},[a.day&&a.date?(n(),g(p(k),{key:0,"aria-label":p(W)(a.date),"border-radius":p($).Full,color:p(le)(a.date)||p(ee)(a.date)?e.color:p(j).Secondary,disabled:e.disabled||e.busy,size:p(C).Small,height:"100%",width:"100%","on-click":e=>((e,a)=>{a?.preventDefault(),a?.stopPropagation(),G.disabled||G.busy||!e||(ie(e),F("date-select",e))})(a.date,e),variant:p(le)(a.date)||p(ee)(a.date)?p(z).Solid:p(te)(a.date)?p(z).Soft:p(z).Ghost,wrap:""},{default:m(()=>[y(_(a.day),1)]),_:2},1032,["aria-label","border-radius","color","disabled","size","on-click","variant"])):D("",!0)],2))),128))],2)],14,R))}});export{E as _};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../components/Containers/CLCard/CLCard.css';
|
|
2
|
-
import{defineComponent as e,useSlots as a,ref as t,computed as l,onMounted as i,nextTick as r,createElementBlock as o,openBlock as d,withKeys as s,normalizeStyle as n,normalizeClass as u,unref as c,createCommentVNode as g,createElementVNode as h,createBlock as y,renderSlot as m,Fragment as f,withCtx as b,createTextVNode as _,toDisplayString as v}from"vue";import{_ as $}from"./CLHeading.vue_vue_type_style_index_0_lang-
|
|
2
|
+
import{defineComponent as e,useSlots as a,ref as t,computed as l,onMounted as i,nextTick as r,createElementBlock as o,openBlock as d,withKeys as s,normalizeStyle as n,normalizeClass as u,unref as c,createCommentVNode as g,createElementVNode as h,createBlock as y,renderSlot as m,Fragment as f,withCtx as b,createTextVNode as _,toDisplayString as v}from"vue";import{_ as $}from"./CLHeading.vue_vue_type_style_index_0_lang-Bp0Hmc-g.js";import{_ as p}from"./CLLink.vue_vue_type_style_index_0_lang-DoqyJ8FL.js";import{_ as k}from"./CLSkeleton.vue_vue_type_style_index_0_lang-B6zTBcne.js";import{_ as C}from"./CLText.vue_vue_type_style_index_0_lang-BZQzsJMF.js";import{c as w,k as x,l as L,d as H,i as T,a as R}from"./index-DwjW-Z-U.js";import{b as j,a as B,c as S,d as A,e as O}from"./index-C9S3C1LU.js";import{c as W}from"./utils-CYyJsKfZ.js";import{useHasSlotContent as q}from"../composables/useHasSlotContent.js";import{useTheme as E}from"../composables/useTheme.js";const I=["data-testid","tabindex"],N=["alt","loading","src"],G={key:0,class:"clll-card__header-skeleton"},K=["alt","loading","src"],M=["aria-label","href","target"],z=/* @__PURE__ */e({name:"CLCard",__name:"CLCard",props:{active:{type:Boolean,default:!1},align:{default:T.Left},ariaLabel:{},borderRadius:{},bordered:{type:Boolean,default:!0},busy:{type:Boolean,default:!1},byline:{},color:{default:H.Neutral},compact:{type:Boolean,default:!1},elevated:{type:Boolean,default:!1},forwardRef:{},height:{default:"auto"},href:{},image:{},imageAltText:{default:""},imageHeight:{default:"auto"},imageLoading:{default:A.Eager},imageOrder:{},imageWidth:{default:"auto"},onClick:{},overflow:{default:S.Hidden},padded:{type:Boolean,default:!0},rounded:{type:Boolean,default:!0},target:{default:B.Self},testId:{default:"clll-card"},title:{},titleHLevel:{default:j.H2},titleType:{default:L.SubSection},truncateTitle:{type:Boolean,default:!1},type:{default:x.Medium},variant:{default:w.Soft},width:{default:"auto"}},setup(e){const x="clll-card",L=E(),H=e,T=q(),j=a(),B=t(),S=t(),A=["a","button"],z=t(),D=l(()=>[x,`${x}--${H.type}`,`${x}--${H.color}-${H.variant}`,`${x}--${H.variant}`,`${x}--align-${H.align}`,H.rounded?`${x}--rounded`:`${x}--box`,H.bordered?`${x}--bordered`:"",H.borderRadius?`${x}--${H.borderRadius}`:"",H.busy?`${x}--busy`:`${x}--ready`,H.compact?`${x}--compact`:`${x}--no-compact`,H.title||H.byline?`${x}--has-header`:`${x}--no-header`,H.byline?`${x}--has-byline`:`${x}--no-byline`,B.value?`${x}--has-heading`:`${x}--no-heading`,T.value?`${x}--has-content`:`${x}--no-content`,S.value?`${x}--has-footer`:`${x}--no-footer`,H.image?`${x}--has-image`:`${x}--has-no-image`,H.imageOrder?`${x}--image-${H.imageOrder}`:"",H.active?`${x}--active`:`${x}--inactive`,H.onClick?`${x}--has-link`:"",H.truncateTitle?`${x}--has-truncated-title`:"",H.elevated?`${x}--elevated`:"",H.overflow?`${x}--overflow-${H.overflow}`:"",H.padded?"":`${x}--no-padding`]),F=e=>{if(H.busy||!H.onClick)return;const{target:a}=e,t=a?a.closest("a,button"):void 0,l=[...z.value?.querySelectorAll("[data-expand-click-area]")??[]];if(l.length){const a=l[0],i=t?A.includes(t.tagName.toLowerCase()):null;t||a===e.target||i||a.click()}};return i(async()=>{await r(),z.value&&H.forwardRef?.(z.value),B.value=j?.heading,S.value=j?.footer}),(a,t)=>(d(),o("div",{ref_key:"refExpandedArea",ref:z,class:u(c(D)),style:n({...c(W)({color:e.color,variant:e.variant,theme:c(L)}),width:e.width,height:e.height,overflow:e.overflow}),"data-testid":e.testId,tabindex:e.onClick?0:void 0,onClick:F,onKeyup:s(F,["enter"])},[!e.image||e.imageOrder!==c(O).Before&&e.imageOrder?g("",!0):(d(),o("div",{key:0,class:u(["clll-card__image",{busy:e.busy}]),style:n({width:e.imageWidth,height:e.imageHeight})},[e.busy?(d(),y(c(k),{key:0,"border-radius":e.borderRadius,width:e.imageWidth,height:e.imageHeight,rounded:!1},null,8,["border-radius","width","height"])):g("",!0),e.image?(d(),o("img",{key:1,alt:e.imageAltText,class:u(`${x}__image__elem`),loading:e.imageLoading,src:e.image},null,10,N)):g("",!0)],6)),h("div",{class:u(`${x}__content`)},[h("div",{class:u(["clll-card__header",{busy:e.busy}])},[e.busy&&(c(B)||e.title||e.byline)?(d(),o("div",G,[c(B)||e.title?(d(),y(c(k),{key:0,"border-radius":e.borderRadius,height:"27px"},null,8,["border-radius"])):g("",!0),e.byline?(d(),y(c(k),{key:1,"border-radius":e.borderRadius,width:"70%",height:"20px"},null,8,["border-radius"])):g("",!0)])):g("",!0),e.onClick||e.href?e.title||c(B)&&(e.onClick||e.href)?(d(),y(c(p),{key:2,"aria-label":e.ariaLabel,color:e.color,href:e.href,target:e.target,"on-click":e.onClick,"data-expand-click-area":""},{default:b(()=>[m(a.$slots,"heading"),e.title?(d(),y(c($),{key:0,align:e.align,class:u(`${x}__heading`),color:e.color,level:e.titleHLevel,truncate:e.truncateTitle,type:e.titleType},{default:b(()=>[_(v(e.title),1)]),_:1},8,["align","class","color","level","truncate","type"])):g("",!0)]),_:3},8,["aria-label","color","href","target","on-click"])):g("",!0):(d(),o(f,{key:1},[m(a.$slots,"heading"),e.title?(d(),y(c($),{key:0,align:e.align,class:u(`${x}__heading`),color:e.color,level:e.titleHLevel,truncate:e.truncateTitle,type:e.titleType},{default:b(()=>[_(v(e.title),1)]),_:1},8,["align","class","color","level","truncate","type"])):g("",!0)],64)),m(a.$slots,"byline"),e.byline?(d(),y(c(C),{key:3,align:e.align,class:u(`${x}__byline`),color:e.color,type:c(R).Small},{default:b(()=>[_(v(e.byline),1)]),_:1},8,["align","class","color","type"])):g("",!0)],2),h("div",{class:u(`${x}__slot`)},[h("div",{ref:"slot-content",class:u([`${x}__slot-content`,{busy:e.busy}])},[c(T)&&e.busy?(d(),y(c(k),{key:0,"border-radius":e.borderRadius,width:"100%",height:"100%"},null,8,["border-radius"])):g("",!0),h("div",null,[m(a.$slots,"default")])],2)],2),h("div",{class:u(["clll-card__footer",{busy:e.busy}])},[c(S)&&e.busy?(d(),y(c(k),{key:0,"border-radius":e.borderRadius,width:"100%",height:"20px"},null,8,["border-radius"])):g("",!0),m(a.$slots,"footer")],2)],2),e.image&&e.imageOrder===c(O).After?(d(),o("div",{key:1,class:u(["clll-card__image",{busy:e.busy}]),style:n({width:e.imageWidth,height:e.imageHeight})},[e.busy?(d(),y(c(k),{key:0,"border-radius":e.borderRadius,width:e.imageWidth,height:e.imageHeight,rounded:!1},null,8,["border-radius","width","height"])):g("",!0),m(a.$slots,"image"),e.image?(d(),o("img",{key:1,alt:e.imageAltText,class:u(`${x}__image__elem`),loading:e.imageLoading,src:e.image},null,10,K)):g("",!0)],6)):g("",!0),e.title||!e.onClick&&!e.href?g("",!0):(d(),o("a",{key:2,"aria-label":e.ariaLabel,class:"sr-only",href:e.href,target:e.target,"data-expand-click-area":"",onClick:t[0]||(t[0]=(...a)=>e.onClick&&e.onClick(...a))},null,8,M)),e.onClick&&e.variant!==c(w).Ghost?(d(),o("div",{key:3,class:u(`${x}__hover-elem`)},null,2)):g("",!0)],46,I))}});export{z as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,createElementBlock as l,openBlock as a,normalizeClass as s,createVNode as t,unref as r,withCtx as o,createTextVNode as X,toDisplayString as d}from"vue";import{_ as i}from"./CLText.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import{defineComponent as e,createElementBlock as l,openBlock as a,normalizeClass as s,createVNode as t,unref as r,withCtx as o,createTextVNode as X,toDisplayString as d}from"vue";import{_ as i}from"./CLText.vue_vue_type_style_index_0_lang-BZQzsJMF.js";import{C as m,a as f}from"./index-DwjW-Z-U.js";const u=["for","data-testid"],_=/* @__PURE__ */e({name:"CLFormLabel",__name:"CLFormLabel",props:{cssPrefix:{default:"clll-form"},htmlFor:{},label:{},required:{type:Boolean,default:!1},size:{default:m.Small},testId:{default:"clll-form-label"}},setup(e){const _={[m.Tiny]:f.Tiny,[m.Small]:f.Small,[m.Medium]:f.Medium,[m.Large]:f.Body,[m.XL]:f.XL,[m.XXL]:f.XXL,[m.XXXL]:f.XXXL,[m.XXXXL]:f.XXXXL};return(m,f)=>(a(),l("label",{for:e.htmlFor,class:s(`${e.cssPrefix}__label`),"data-testid":e.testId},[t(r(i),{as:"span",type:_[e.size],class:s(e.required?`${e.cssPrefix}__label--required`:"")},{default:o(()=>[X(d(e.label),1)]),_:1},8,["type","class"])],10,u))}});export{_};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../components/Typography/CLHeading/CLHeading.css';
|
|
2
|
-
import{defineComponent as e,computed as t,createBlock as l,openBlock as a,resolveDynamicComponent as o,unref as s,normalizeStyle as r,normalizeClass as d,withCtx as n,renderSlot as i}from"vue";import{l as c,d as u,i as p}from"./index-DwjW-Z-U.js";import{b as f}from"./index-C9S3C1LU.js";import{t as m}from"./utils-
|
|
2
|
+
import{defineComponent as e,computed as t,createBlock as l,openBlock as a,resolveDynamicComponent as o,unref as s,normalizeStyle as r,normalizeClass as d,withCtx as n,renderSlot as i}from"vue";import{l as c,d as u,i as p}from"./index-DwjW-Z-U.js";import{b as f}from"./index-C9S3C1LU.js";import{t as m}from"./utils-DxfNBBvx.js";import{useTheme as $}from"../composables/useTheme.js";const y=/* @__PURE__ */e({name:"CLHeading",__name:"CLHeading",props:{align:{default:p.Left},bolder:{type:Boolean,default:!1},color:{default:u.Secondary},level:{},testId:{default:"clll-heading"},truncate:{type:Boolean,default:!1},type:{default:c.Title}},setup(e){const u=e,p=$(),y="clll-heading",g=t(()=>{if(u.level)return u.level;switch(u.type){case c.Section:return f.H2;case c.SubSection:return f.H3;case c.PageTitle:case c.Title:default:return f.H1}}),b=t(()=>[y,`${y}--${u.align}`,`${y}--${u.color}`,`${y}--${u.truncate?"wrap":"nowrap"}`,`${y}--${u.type}`,u.bolder?`${y}--bolder`:""]);return(t,c)=>(a(),l(o(s(g)),{class:d(s(b)),"data-testid":e.testId,style:r(s(m)({color:e.color,theme:s(p)}))},{default:n(()=>[i(t.$slots,"default")]),_:3},8,["class","data-testid","style"]))}});export{y as _};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../assets/CLInputMessages.css';
|
|
2
|
-
import{defineComponent as e,createElementBlock as s,openBlock as a,normalizeClass as o,unref as l,renderSlot as t,Fragment as i,renderList as r,normalizeStyle as n,createElementVNode as p,toDisplayString as m}from"vue";import{f as u}from"./index-C9S3C1LU.js";import{d}from"./index-DwjW-Z-U.js";import{b as f}from"./utils-
|
|
2
|
+
import{defineComponent as e,createElementBlock as s,openBlock as a,normalizeClass as o,unref as l,renderSlot as t,Fragment as i,renderList as r,normalizeStyle as n,createElementVNode as p,toDisplayString as m}from"vue";import{f as u}from"./index-C9S3C1LU.js";import{d}from"./index-DwjW-Z-U.js";import{b as f}from"./utils-BDThP-Sb.js";const $="clll-form-field",h=/* @__PURE__ */e({__name:"CLFormField",props:{fluid:{type:Boolean},hasPill:{type:Boolean},hasCharCounter:{type:Boolean},orientation:{}},setup:e=>(i,r)=>(a(),s("div",{class:o([$,e.fluid||e.orientation===l(u).Horizontal?`${$}--fluid`:`${$}--fixed`,e.orientation?`${$}--${e.orientation}`:"",e.hasPill?`${$}--haspill`:"",e.hasCharCounter?`${$}--hascharcounter`:""])},[t(i.$slots,"default")],2))}),c="clll-input__message",_=/* @__PURE__ */e({__name:"CLInputMessages",props:{id:{},messages:{},messageType:{default:d.Neutral}},setup:e=>(t,u)=>(a(!0),s(i,null,r(e.messages,(t,i)=>(a(),s("span",{key:`${e.id}-message-${i}`,class:o([c,`${c}--${e.messageType}`]),style:n(l(f)({color:e.messageType}))},[p("span",{class:o([`${c}__text`])},m(t),3)],6))),128))});export{h as _,_ as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import '../components/Modals/CLModal/CLModal.css';
|
|
2
|
+
import{defineComponent as e,useTemplateRef as o,useSlots as t,ref as l,computed as a,watch as d,onMounted as n,onBeforeUnmount as s,createBlock as r,openBlock as i,Teleport as c,createElementBlock as _,createCommentVNode as u,normalizeStyle as v,normalizeClass as m,unref as f,createElementVNode as p,renderSlot as y,withCtx as b,createTextVNode as h,toDisplayString as $}from"vue";import{_ as w}from"./CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{_ as x}from"./CLHeading.vue_vue_type_style_index_0_lang-Bp0Hmc-g.js";import{b as I,g as z,d as g,c as k,h as L,e as B,f as C,l as T}from"./index-DwjW-Z-U.js";import{useTheme as j}from"../composables/useTheme.js";import{useEsc as R}from"../composables/useEsc.js";import{b as E,i as O}from"./helper-BlxFN3eF.js";const M=e=>{const{borderRadius:o,colors:t,darkMode:l,fontFamily:a}=e??j(),d=l.value?I.Dark:I.Light,n=z({color:g.Neutral,colors:t.value,mode:d,variant:k.Solid}),s=l.value?"black":"white",r=o?.value?`var(--clll-${o.value})`:void 0;return{"--clll-modal-overlay-bg":n?.bg??"transparent","--clll-modal-content-bg":s,"--clll-default-radius":r,"--clll-modal-theme-radius":r??"var(--clll-default-radius)","--clll-font-family":a?.value}},S=["id","data-testid"],F=["aria-labelledby"],D=/* @__PURE__ */e({name:"CLModal",__name:"CLModal",props:{borderRadius:{default:void 0},close:{type:Boolean,default:!0},closeBorderRadius:{default:L.Full},dismissible:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!1},isOpen:{type:Boolean,default:!1},maxWidth:{default:"640px"},modalId:{},onClose:{type:Function,default:void 0},overlay:{type:Boolean,default:!0},teleport:{type:Boolean,default:!0},teleportTo:{default:"body"},testId:{default:"clll-modal"},title:{default:void 0},zIndex:{default:100}},emits:["modal-open","modal-close"],setup(e,{emit:I}){const z=I,L=j(),D=o("modal-window"),H=t(),N=e,W="clll-modal",q="clll-prevent-scroll",A=l(),G=()=>{O&&window?.document.body.classList.add(q)},J=()=>{O&&window?.document.body.classList.remove(q)},K=a(()=>[W,"clll-theme-provider","--clll-color-theme-"+(L.darkMode?.value?"dark":"light")]),P=a(()=>[`${W}__window`,N.fullscreen?`${W}__window--fullscreen`:""]),Q=a(()=>[`${W}__content`,N.borderRadius?`${W}__content--${N.borderRadius}`:"",N.close?`${W}__content--has-close-button`:`${W}__content--has-no-close-button`,H.body?`${W}__content--has-body`:`${W}__content--has-no-body`,H.footer?`${W}__content--has-footer`:`${W}__content--has-no-footer`,H.header||N.title?`${W}__content--has-header`:`${W}__content--has-no-header`,N.title?`${W}__content--has-title`:`${W}__content--has-no-title`]),U=a(()=>"auto"===N.zIndex||E(N.zIndex)?N.zIndex:N.zIndex.toString()),V=a(()=>{if("auto"===N.zIndex)return N.zIndex;return((E(N.zIndex)?parseInt(N.zIndex,10):N.zIndex)+100).toString()}),X=e=>{try{(e=>{try{const o=e?.target,t=D.value;return!(!O||!t||t.contains(o))||void 0}catch(o){return void console.error(o)}})(e)&&(O&&window.removeEventListener("mousedown",X),ee())}catch(o){console.error(o)}},Y=()=>{O&&window.removeEventListener("mousedown",X)},Z=()=>{O&&(A.value&&O&&window.clearTimeout(A.value),Y(),J())},ee=()=>{N.isOpen&&(N.onClose?.(),Z())};d(N,e=>{e.isOpen?(z("modal-open"),G(),D.value&&D.value.focus(),O&&e.dismissible&&(Y(),A.value=window.setTimeout(()=>{window.addEventListener("mousedown",X)},100))):(D.value&&D.value.blur(),J(),Y(),A.value&&O&&window.clearTimeout(A.value),z("modal-close"))}),n(()=>{N.isOpen&&O&&(G(),D.value&&D.value.focus())});const{clearEventListeners:oe}=R({escHandler:N.dismissible?ee:void 0});return s(()=>{Z(),oe()}),(o,t)=>(i(),r(c,{to:e.teleportTo,disabled:!e.teleport},[e.isOpen?(i(),_("div",{key:0,id:e.modalId,class:m(f(K)),"data-testid":e.testId,style:v({...f(M)(f(L)),zIndex:f(U)})},[p("div",{class:m(f(P)),style:v({zIndex:f(V)})},[p("div",{ref:"modal-window","aria-modal":"true","aria-labelledby":`${W}__content__header__title`,class:m(f(Q)),role:"dialog",tabindex:-1,style:v({"--clll-modal-max-width":e.maxWidth})},[p("div",{class:m(`${W}__close-button`)},[e.onClose&&e.close?(i(),r(f(w),{key:0,"aria-label":"Close modal","border-radius":e.closeBorderRadius,color:f(g).Neutral,"icon-before":f(C).Delete,"icon-size":f(B).Tiny,"on-click":e.onClose,"test-id":`${W}__close-button`,variant:f(k).Text},null,8,["border-radius","color","icon-before","icon-size","on-click","test-id","variant"])):u("",!0)],2),p("div",{class:m(`${W}__content__header`)},[p("div",{class:m(`${W}__content__title`)},[p("div",{class:m(`${W}__content__header__container`)},[e.title?(i(),r(f(x),{key:0,id:`${W}__content__header__title`,class:m(`${W}__content__header__title`),type:f(T).Section},{default:b(()=>[h($(e.title),1)]),_:1},8,["id","class","type"])):u("",!0),y(o.$slots,"header")],2)],2)],2),p("div",{class:m(`${W}__content__scroller`)},[p("div",{class:m(`${W}__content__body`)},[y(o.$slots,"body")],2)],2),p("div",{class:m(`${W}__content__footer`)},[y(o.$slots,"footer")],2)],14,F)],6),e.overlay?(i(),_("div",{key:0,ref:"overlay-ref",class:m(`${W}__overlay`),style:v({zIndex:e.zIndex})},null,6)):u("",!0)],14,S)):u("",!0)],8,["to","disabled"]))}});export{D as _};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../components/Indicators/CLPill/CLPill.css';
|
|
2
|
-
import{defineComponent as e,computed as l,createElementBlock as a,openBlock as n,normalizeStyle as s,normalizeClass as o,unref as i,createCommentVNode as t,createBlock as c,createVNode as d,withCtx as r,createTextVNode as u,toDisplayString as _,createElementVNode as m}from"vue";import{_ as p}from"./CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{_ as y}from"./CLIcon.vue_vue_type_style_index_0_lang-BN_rKLKK.js";import{_ as f}from"./CLText.vue_vue_type_style_index_0_lang-
|
|
2
|
+
import{defineComponent as e,computed as l,createElementBlock as a,openBlock as n,normalizeStyle as s,normalizeClass as o,unref as i,createCommentVNode as t,createBlock as c,createVNode as d,withCtx as r,createTextVNode as u,toDisplayString as _,createElementVNode as m}from"vue";import{_ as p}from"./CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{_ as y}from"./CLIcon.vue_vue_type_style_index_0_lang-BN_rKLKK.js";import{_ as f}from"./CLText.vue_vue_type_style_index_0_lang-BZQzsJMF.js";import{c as v,d as k,e as $,a as b,f as C}from"./index-DwjW-Z-U.js";import{p as z}from"./utils-D1egvxnD.js";const x=["data-testid"],D=/* @__PURE__ */e({name:"CLPill",__name:"CLPill",props:{color:{default:k.Neutral},count:{},dismissable:{type:Boolean},elevated:{type:Boolean,default:!1},icon:{},iconFilled:{type:Boolean,default:!1},label:{},onClick:{},onDismiss:{},rounded:{type:Boolean,default:!0},testId:{default:"clll-pill"},variant:{default:v.Soft}},setup(e){const v=e,k="clll-pill",D=l(()=>[k,`${k}--${v.color}--${v.variant}`,v.count?`${k}--has-count`:"",v.dismissable?`${k}--dismissable`:"",v.elevated?`${k}--elevated`:"",v.icon?`${k}--has-icon`:`${k}--has-noicon`,v.rounded?`${k}--rounded`:""]);return(l,v)=>(n(),a("div",{"data-testid":e.testId,class:o(i(D)),style:s(i(z)({color:e.color,variant:e.variant}))},[e.onClick||e.onDismiss?t("",!0):(n(),a("span",{key:0,class:o(`${k}__container`)},[e.icon?(n(),c(i(y),{key:0,filled:e.iconFilled,name:e.icon,size:i($).Tiny},null,8,["filled","name","size"])):t("",!0),d(i(f),{as:"span",type:i(b).Small,truncate:""},{default:r(()=>[u(_(e.label),1)]),_:1},8,["type"]),e.count?(n(),a("span",{key:1,class:o(`${k}__count`)},_(e.count),3)):t("",!0)],2)),e.onClick&&!e.dismissable?(n(),c(i(p),{key:1,color:e.color,"on-click":e.onClick,variant:e.variant,pill:"",rounded:e.rounded},{default:r(()=>[m("span",{class:o(`${k}__button`)},[e.icon?(n(),c(i(y),{key:0,filled:e.iconFilled,name:e.icon,size:i($).Tiny},null,8,["filled","name","size"])):t("",!0),d(i(f),{as:"span",type:i(b).Small,truncate:""},{default:r(()=>[u(_(e.label),1)]),_:1},8,["type"]),e.count?(n(),a("span",{key:1,class:o(`${k}__count`)},_(e.count),3)):t("",!0),e.dismissable?(n(),c(i(y),{key:2,name:i(C).Delete,size:i($).Tiny},null,8,["name","size"])):t("",!0)],2)]),_:1},8,["color","on-click","variant","rounded"])):t("",!0),e.onDismiss&&e.dismissable?(n(),c(i(p),{key:2,color:e.color,"on-click":e.onDismiss,variant:e.variant,pill:"",rounded:e.rounded},{default:r(()=>[m("span",{class:o(`${k}__button`)},[d(i(f),{as:"span",type:i(b).Small,truncate:""},{default:r(()=>[u(_(e.label),1)]),_:1},8,["type"]),e.dismissable?(n(),c(i(y),{key:0,name:i(C).Delete,size:i($).Tiny},null,8,["name","size"])):t("",!0)],2)]),_:1},8,["color","on-click","variant","rounded"])):t("",!0)],14,x))}});export{D as _};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../components/Typography/CLText/CLText.css';
|
|
2
|
-
import{defineComponent as t,computed as e,createBlock as l,openBlock as o,resolveDynamicComponent as a,normalizeStyle as d,normalizeClass as s,unref as r,withCtx as u,renderSlot as m}from"vue";import{a as p,d as f,i}from"./index-DwjW-Z-U.js";import{t as n}from"./utils-
|
|
2
|
+
import{defineComponent as t,computed as e,createBlock as l,openBlock as o,resolveDynamicComponent as a,normalizeStyle as d,normalizeClass as s,unref as r,withCtx as u,renderSlot as m}from"vue";import{a as p,d as f,i}from"./index-DwjW-Z-U.js";import{t as n}from"./utils-DxfNBBvx.js";import{useTheme as c}from"../composables/useTheme.js";const $=/* @__PURE__ */t({name:"CLText",__name:"CLText",props:{align:{default:i.Left},as:{default:"p"},bold:{type:Boolean,default:!1},bolder:{type:Boolean,default:!1},color:{default:f.Secondary},light:{type:Boolean,default:!1},medium:{type:Boolean,default:!1},testId:{default:"clll-text"},truncate:{type:Boolean,default:!1},type:{default:p.Body}},setup(t){const p=t,f=c(),i="clll-text",$=e(()=>[i,`${i}--${p.align}`,`${i}--${p.color}`,`${i}--${p.truncate?"wrap":"nowrap"}`,`${i}--${p.type}`,{[`${i}--mediumbold`]:p.medium,[`${i}--light`]:p.light,[`${i}--bold`]:p.bold,[`${i}--bolder`]:p.bolder}]);return(e,p)=>(o(),l(a(t.as),{class:s(r($)),"data-testid":t.testId,style:d(r(n)({color:t.color,theme:r(f)}))},{default:u(()=>[m(e.$slots,"default")]),_:3},8,["class","data-testid","style"]))}});export{$ as _};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../components/Popups/CLToast/CLToast.css';
|
|
2
|
-
import{defineComponent as e,ref as t,computed as o,watch as l,onMounted as s,onUnmounted as a,onBeforeUnmount as i,createElementBlock as r,openBlock as u,normalizeStyle as n,normalizeClass as d,unref as c,createElementVNode as m,createCommentVNode as v,createVNode as _,createBlock as b,withCtx as p,createTextVNode as f,toDisplayString as h}from"vue";import{_ as y}from"./CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{_ as g}from"./CLIcon.vue_vue_type_style_index_0_lang-BN_rKLKK.js";import{_ as $}from"./CLText.vue_vue_type_style_index_0_lang-
|
|
2
|
+
import{defineComponent as e,ref as t,computed as o,watch as l,onMounted as s,onUnmounted as a,onBeforeUnmount as i,createElementBlock as r,openBlock as u,normalizeStyle as n,normalizeClass as d,unref as c,createElementVNode as m,createCommentVNode as v,createVNode as _,createBlock as b,withCtx as p,createTextVNode as f,toDisplayString as h}from"vue";import{_ as y}from"./CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{_ as g}from"./CLIcon.vue_vue_type_style_index_0_lang-BN_rKLKK.js";import{_ as $}from"./CLText.vue_vue_type_style_index_0_lang-BZQzsJMF.js";import{g as T,c as x,b as L,d as k,o as z,e as D,a as M,C as j,f as w}from"./index-DwjW-Z-U.js";import{i as B,g as C,a as R}from"./helper-BlxFN3eF.js";import{useEsc as S}from"../composables/useEsc.js";import{useTheme as F}from"../composables/useTheme.js";const A=({color:e,theme:t})=>{const{colors:o,darkMode:l}=t??F(),s=T({color:e,colors:o.value,mode:(l.value,L.Light),variant:x.Soft}),a=T({color:k.Neutral,colors:o.value,mode:l.value?L.Light:L.Dark,variant:x.Text});return{"--clll-toast-bg-color":l.value?"white":"#322F35","--clll-toast-text-color":a?.textBody,"--clll-toast-action-button-text-color":s?.text,"--clll-toast-action-button-bg-color":s?.bg,"--clll-toast-action-button-hover-color":s?.hover,"--clll-toast-dismiss-button-text-color":a?.text,"--clll-toast-dismiss-button-bg-color":a?.bg,"--clll-toast-dismiss-button-hover-color":a?.hover,"--clll-toast-icon-bg":s?.bg,"--clll-toast-icon-color":s?.text,"--clll-toast-theme-radius":"var(--clll-default-radius)"}},E=["data-testid"],I=300,N="clll-toast",H=/* @__PURE__ */e({name:"CLToast",__name:"CLToast",props:{actionLabel:{},borderRadius:{},color:{default:k.Secondary},dismissTimer:{default:5},icon:{},iconFilled:{type:Boolean,default:!1},iconSize:{default:D.Small},message:{},onAction:{},onDismiss:{},position:{default:z.TopRight},rounded:{type:Boolean,default:!0},testId:{default:"clll-toast"},title:{},width:{default:"24rem"}},setup(e){const T=e,L=F(),z=t(),H=t(!1),q=t(),G=t(0),J=t(!1),K=t(null),O=t(0),P=t(0),Q=t(!1),U=o(()=>[N,T.borderRadius?`${N}--${T.borderRadius}`:"",T.dismissTimer?`${N}--has-timer`:"",T.icon?`${N}--has-icon`:"",T.message&&!T.title?`${N}--has-messageonly`:"",H.value?`${N}--mounted`:"",T.onAction&&T.actionLabel?`${N}--has-action`:"",T.rounded?`${N}--rounded`:`${N}--box`,T.title&&!T.message?`${N}--has-titleonly`:"",T.title&&T.message?`${N}--has-titleandmessage`:"",`${N}--${T.position}`]),V=()=>{null!==K.value&&(clearTimeout(K.value),K.value=null),q.value?.stop()},W=()=>{T.dismissTimer&&!J.value&&(V(),O.value=Date.now(),P.value=1e3*T.dismissTimer,Q.value=!1,K.value=setTimeout(()=>{Q.value||J.value||ee()},P.value))},X=()=>{if(!T.dismissTimer||Q.value||J.value)return;Q.value=!0;const e=Date.now()-O.value;P.value=Math.max(0,P.value-e),V()},Y=()=>{T.dismissTimer&&Q.value&&!J.value&&(Q.value=!1,O.value=Date.now(),K.value=setTimeout(()=>{Q.value||J.value||ee()},P.value))},Z=()=>{document.hidden?X():Y()},ee=()=>{J.value||(J.value=!0,H.value=!1,V(),q.value&&q.value.start(I,e=>{Math.min(e,I)===I&&(q.value?.stop(),T.onDismiss?.())}),te())};l(()=>T.dismissTimer,()=>{V(),J.value=!1,T.dismissTimer&&T.dismissTimer>0&&W()}),s(()=>{B&&(G.value=C()+1,q.value||(q.value=R(),q.value.start(100,e=>{100===Math.min(e,100)&&(q.value?.stop(),H.value=!0,T.dismissTimer&&q.value?.start(I,e=>{Math.min(e,I)===I&&(q.value?.stop(),W())}))})),document.addEventListener("visibilitychange",Z))}),a(()=>{B&&(V(),q.value=void 0,document.removeEventListener("visibilitychange",Z)),H.value=!1,J.value||(J.value=!0,T.onDismiss?.())});const{clearEventListeners:te}=S({escHandler:ee});return i(()=>{te()}),(t,o)=>(u(),r("output",{ref_key:"elem",ref:z,class:d(c(U)),"data-testid":e.testId,style:n({zIndex:c(G),"--clll-toast-width":e.width,...c(A)({color:e.color,theme:c(L)})}),onMouseenter:X,onMouseleave:Y,onFocusin:X,onFocusout:Y},[m("div",{class:d(`${N}__body`)},[m("div",{class:d(`${N}__content`)},[e.icon?(u(),r("div",{key:0,class:d(`${N}__icon`)},[_(c(g),{filled:e.iconFilled,name:e.icon,size:e.iconSize},null,8,["filled","name","size"])],2)):v("",!0),m("div",{class:d(`${N}__text`)},[e.title?(u(),b(c($),{key:0,color:c(k).Neutral,"test-id":`${N}__title`,type:c(M).Body,bold:""},{default:p(()=>[f(h(e.title),1)]),_:1},8,["color","test-id","type"])):v("",!0),e.message?(u(),b(c($),{key:1,color:c(k).Neutral,"test-id":`${N}__message`,type:e.title?c(M).Medium:c(M).Body},{default:p(()=>[f(h(e.message),1)]),_:1},8,["color","test-id","type"])):v("",!0)],2),e.onAction&&e.actionLabel?(u(),r("div",{key:1,class:d(`${N}__action-button`)},[_(c(y),{color:e.color,"border-radius":e.borderRadius,"on-click":e.onAction,"test-id":`${N}__action-button`,variant:c(x).Soft},{default:p(()=>[f(h(e.actionLabel),1)]),_:1},8,["color","border-radius","on-click","test-id","variant"])],2)):v("",!0)],2),m("div",{class:d(`${N}__dismiss-button`)},[_(c(y),{"aria-label":"Dismiss toast",color:c(k).Neutral,"border-radius":e.borderRadius,"icon-before":c(w).Delete,"icon-size":c(D).Tiny,"on-click":ee,size:c(j).Tiny,"test-id":`${N}__dismiss-button`,variant:c(x).Text},null,8,["color","border-radius","icon-before","icon-size","size","test-id","variant"])],2)],2)],46,E))}});export{H as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as l,c as e,g as r,d as t}from"./index-DwjW-Z-U.js";import{useTheme as a}from"../composables/useTheme.js";const c=({color:t,variant:c,theme:o})=>{const{colors:s,darkMode:i}=o??a(),d=i.value?l.Dark:l.Light,u=c===e.Ghost,b=r({color:t,colors:s.value,mode:d,variant:e.Solid}),p=r({color:t,colors:s.value,mode:d,variant:e.Outline}),h=i.value?"black":"white",v=p?.border,k=p?.disabled,f=i.value?"black":b?.textDisabled,
|
|
1
|
+
import{b as l,c as e,g as r,d as t}from"./index-DwjW-Z-U.js";import{useTheme as a}from"../composables/useTheme.js";const c=({color:t,variant:c,theme:o})=>{const{colors:s,darkMode:i}=o??a(),d=i.value?l.Dark:l.Light,u=c===e.Ghost,b=r({color:t,colors:s.value,mode:d,variant:e.Solid}),p=r({color:t,colors:s.value,mode:d,variant:e.Outline}),h=i.value?"black":"white",v=p?.border,k=p?.disabled,f=i.value?"black":b?.textDisabled,m=p?.focus,x=p?.focus,g=p?.text,w=p?.textDisabled;return{"--clll-checkbox-bg":u?"transparent":h??"white","--clll-checkbox-border":u?"transparent":v??"transparent","--clll-checkbox-disabled-border":k??"transparent","--clll-checkbox-disabled-bg":f??"transparent","--clll-checkbox-checked-bg":h??"white","--clll-checkbox-focus-border":m??"transparent","--clll-checkbox-focus-shadow":x??"transparent","--clll-checkbox-icon-color":g??"inherit","--clll-checkbox-disabled-icon-color":w??"transparent","--clll-checkbox-indicator-color":g??"inherit","--clll-checkbox-disabled-indicator-color":w??"transparent","--clll-checkbox-theme-radius":"var(--clll-default-radius)","--clll-checkbox-outline-width":u?"0px":"2px","--clll-checkbox-required-asterisk-color":n(o??a())??"red"}},o=({color:t,variant:c,theme:o})=>{const{colors:s,darkMode:i}=o??a(),d=i.value?l.Dark:l.Light,u=c===e.Ghost,b=r({color:t,colors:s.value,mode:d,variant:e.Solid}),p=r({color:t,colors:s.value,mode:d,variant:e.Outline}),h=i.value?"black":"white",v=i.value?"black":b?.textDisabled,k=p?.border,f=p?.disabled,m=i.value?"black":b?.textDisabled,x=p?.focus,g=p?.focus,w=p?.text,D=p?.focus;return{"--clll-input-bg":u?"transparent":h??"white","--clll-input-border":u?"transparent":k??"transparent","--clll-input-disabled-border":f??"transparent","--clll-input-disabled-bg":m??"transparent","--clll-input-readonly-border":f??"transparent","--clll-input-readonly-bg":m??"transparent","--clll-input-focus-border":x??"transparent","--clll-input-focus-shadow":g??"transparent","--clll-input-text":w??"inherit","--clll-input-text-placeholder":D??"transparent","--clll-input-grouped-bg":v??"transparent","--clll-input-prefix-suffix-color":D??"transparent","--clll-input-theme-radius":"var(--clll-default-radius)","--clll-input-ghost-padding":u?"0":void 0,"--clll-input-required-asterisk-color":n(o??a())??"red"}},s=({color:t,theme:c})=>{const{colors:o,darkMode:s}=c??a(),i=s.value?l.Dark:l.Light,n=r({color:t,colors:o.value,mode:i,variant:e.Outline});return{"--clll-input-message-color":n?.textBody??"inherit"}},i=({color:t,variant:c,theme:o})=>{const{colors:s,darkMode:i}=o??a(),d=i.value?l.Dark:l.Light,u=c===e.Ghost,b=r({color:t,colors:s.value,mode:d,variant:e.Solid}),p=r({color:t,colors:s.value,mode:d,variant:e.Outline}),h=i.value?"black":"white",v=p?.border,k=p?.disabled,f=i.value?"black":b?.textDisabled,m=p?.focus,x=p?.focus,g=p?.text,w=p?.focus;return{"--clll-select-bg":u?"transparent":h??"white","--clll-select-border":u?"transparent":v??"transparent","--clll-select-disabled-border":k??"transparent","--clll-select-disabled-bg":f??"transparent","--clll-select-focus-border":m??"transparent","--clll-select-focus-shadow":x??"transparent","--clll-select-text":g??"inherit","--clll-select-text-placeholder":w??"transparent","--clll-select-icon-color":g??"inherit","--clll-select-disabled-icon-color":w??"transparent","--clll-select-theme-radius":"var(--clll-default-radius)","--clll-select-ghost-padding":u?"0":void 0,"--clll-select-required-asterisk-color":n(o??a())??"red"}},n=l=>{const{colors:e,darkMode:r}=l??a();return r.value?e.value.danger?.[400]:e.value.danger?.[700]},d=l=>{const{darkMode:e}=l??a();return{"--clll-calendar-content-bg":e.value?"black":"white"}},u=({color:c=t.Primary,theme:o})=>{const{colors:s,darkMode:i}=o??a(),n=i.value?l.Dark:l.Light,d=r({color:c,colors:s.value,mode:n,variant:e.Solid}),u=r({color:c,colors:s.value,mode:n,variant:e.Soft}),b=r({color:c,colors:s.value,mode:n,variant:e.Outline});return{"--clll-time-picker-bg":i.value?"#111827":"#ffffff","--clll-time-picker-input-bg":i.value?"#1f2937":"#f3f4f6","--clll-time-picker-text":i.value?"#f9fafb":"#1f2937","--clll-time-picker-sublabel":i.value?"#9ca3af":"#6b7280","--clll-time-picker-border":b?.border??(i.value?"#374151":"#d1d5db"),"--clll-time-picker-active-border":b?.focus??d?.bg??"#6366f1","--clll-time-picker-active-bg":u?.bg??(i.value?"#3730a3":"#e0e7ff"),"--clll-time-picker-active-text":u?.text??d?.bg??"#4338ca","--clll-time-picker-theme-radius":"var(--clll-default-radius)"}};export{c as a,s as b,d as c,o as i,i as s,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o,g as e,d as r,c as t}from"./index-DwjW-Z-U.js";import{useTheme as s}from"../composables/useTheme.js";const a=({color:a=r.Neutral,theme:l})=>{const{colors:c,darkMode:m}=l??s(),i=m.value?o.Dark:o.Light,d=e({color:a,colors:c.value,mode:i,variant:t.Text});return{"--clll-text-color":d?.textBody??"inherit"}};export{a as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../assets/core.css';
|
|
2
2
|
import './CLTable.css';
|
|
3
|
-
import{defineComponent as e,computed as l,createElementBlock as t,openBlock as a,normalizeStyle as o,normalizeClass as s,unref as d,createElementVNode as r,createCommentVNode as n,renderSlot as c,Fragment as i,renderList as u,createVNode as b,withCtx as p}from"vue";import{b as _,g as $,c as y,d as f,q as m,a as C}from"../../chunks/index-DwjW-Z-U.js";import{useTheme as h}from"../../composables/useTheme.js";import{_ as k}from"../../chunks/CLText.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{defineComponent as e,computed as l,createElementBlock as t,openBlock as a,normalizeStyle as o,normalizeClass as s,unref as d,createElementVNode as r,createCommentVNode as n,renderSlot as c,Fragment as i,renderList as u,createVNode as b,withCtx as p}from"vue";import{b as _,g as $,c as y,d as f,q as m,a as C}from"../../chunks/index-DwjW-Z-U.js";import{useTheme as h}from"../../composables/useTheme.js";import{_ as k}from"../../chunks/CLText.vue_vue_type_style_index_0_lang-BZQzsJMF.js";const v=e=>{const{colors:l,darkMode:t}=e??h(),a=t.value?_.Dark:_.Light,o=$({color:f.Neutral,colors:l.value,mode:a,variant:y.Outline});return{"--clll-table-border-color":o?.border??"transparent","--clll-table-hover-bg":o?.hover??"transparent","--clll-table-theme-radius":"var(--clll-default-radius)"}},L=["data-testid"],T=["id"],B={key:0},w=/* @__PURE__ */e({name:"CLTable",__name:"CLTable",props:{bordered:{type:Boolean},borderRadius:{},colWidths:{},id:{default:"main"},rounded:{type:Boolean,default:!1},rowHeight:{default:"auto"},striped:{type:Boolean},testId:{default:"clll-table"},type:{default:m.Default},withVerticalLines:{type:Boolean}},setup(e){const b=e,p=h(),_="clll-table",$=l(()=>[`${_}-container`,b.bordered?`${_}--bordered`:void 0,b.borderRadius&&b.bordered?`${_}--${b.borderRadius}`:"",b.rounded?`${_}--rounded`:`${_}--box`]),y=l(()=>[_,`${_}--${b.type}`,b.striped?`${_}--striped`:void 0,b.withVerticalLines?`${_}--vertical-lines`:void 0,b.bordered?`${_}--bordered`:void 0]);return(l,b)=>(a(),t("div",{class:s(d($)),"data-testid":e.testId,style:o(d(v)(d(p)))},[r("table",{id:`${_}-${e.id}`,class:s(d(y)),style:o({"--clll-table-row-height":e.rowHeight})},[e.colWidths?.length?(a(),t("colgroup",B,[(a(!0),t(i,null,u(e.colWidths,(l,s)=>(a(),t("col",{key:`table-${e.id}-col-${s}`,style:o({width:l})},null,4))),128))])):n("",!0),c(l.$slots,"default")],14,T)],14,L))}}),g=/* @__PURE__ */e({name:"CLTableBody",__name:"CLTableBody",setup:e=>(e,l)=>(a(),t("tbody",{class:s(["clll-table__body"])},[c(e.$slots,"default")],2))}),H=["colspan"],A=["colspan"],N=/* @__PURE__ */e({name:"CLTableCell",__name:"CLTableCell",props:{colSpan:{default:1},isAction:{type:Boolean,default:!1},isActive:{type:Boolean,default:!1},isHeader:{type:Boolean,default:!1},isNumber:{type:Boolean,default:!1},onClick:{}},setup(e){const o=e,r="clll-table__cell",n=l(()=>[r,o.isHeader?`${r}--header`:`${r}--default`,o.isNumber?`${r}--number`:"",o.isAction?`${r}--hasactions`:"",o.isActive?`${r}--active`:"",o.onClick?`${r}--clickable`:""]),i=()=>o?.onClick?.();return(l,o)=>e.isHeader?(a(),t("th",{key:0,class:s(d(n)),colspan:e.colSpan,onClick:i},[e.isAction?(a(),t("div",{key:1,class:s(`${r}__actions`)},[c(l.$slots,"default")],2)):c(l.$slots,"default",{key:0})],10,H)):(a(),t("td",{key:1,class:s(d(n)),colspan:e.colSpan,onClick:i},[e.isAction?(a(),t("div",{key:1,class:s(`${r}__actions`)},[c(l.$slots,"default")],2)):c(l.$slots,"default",{key:0})],10,A))}}),R=/* @__PURE__ */e({name:"CLTableFooter",__name:"CLTableFooter",setup:e=>(e,l)=>(a(),t("tfoot",{class:s(["clll-table__footer"])},[c(e.$slots,"default")],2))}),x=/* @__PURE__ */e({name:"CLTableHeader",__name:"CLTableHeader",setup:e=>(e,l)=>(a(),t("thead",{class:s(["clll-table__header"])},[c(e.$slots,"default")],2))}),F=/* @__PURE__ */e({name:"CLTableNestedCell",__name:"CLTableNestedCell",props:{truncate:{type:Boolean}},setup:e=>(l,o)=>(a(),t("div",{class:s("clll-table__nested-cell")},[b(d(k),{type:d(C).Small,truncate:e.truncate},{default:p(()=>[c(l.$slots,"default")]),_:3},8,["type","truncate"])]))}),S=/* @__PURE__ */e({name:"CLTableRow",__name:"CLTableRow",props:{onClick:{type:Function}},setup(e){const o=e,r="clll-table__row",n=l(()=>[r,o.onClick?`${r}--clickable`:""]),i=()=>o?.onClick?.();return(e,l)=>(a(),t("tr",{class:s(d(n)),onClick:i},[c(e.$slots,"default")],2))}}),j=w;j.Body=g,j.Cell=N,j.Footer=R,j.Header=x,j.NestedCell=F,j.Row=S;export{j as CLTable,j as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLCard.css';
|
|
3
|
-
import{_ as a}from"../../../chunks/CLCard.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{_ as a}from"../../../chunks/CLCard.vue_vue_type_style_index_0_lang-D3JriMVx.js";export{a as CLCard,a as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLCarousel.css';
|
|
3
|
-
import{defineComponent as e,computed as a,createElementBlock as l,openBlock as o,Fragment as i,createCommentVNode as t,unref as n,normalizeClass as s,renderList as r,createBlock as c,createElementVNode as v,createVNode as d,withCtx as u,createTextVNode as p,toDisplayString as f,useCssVars as g,ref as h,onMounted as b,nextTick as m,onUnmounted as _,watch as w,renderSlot as y}from"vue";import{_ as x}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{_ as T}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-DefqjMCJ.js";import{c as $,C as k,e as L,f as z,a as P,i as C,d as S}from"../../../chunks/index-DwjW-Z-U.js";import{g as B,e as E}from"../../../chunks/index-C9S3C1LU.js";import{i as M,d as I,e as N}from"../../../chunks/helper-BlxFN3eF.js";import{useHasSlotContent as A}from"../../../composables/useHasSlotContent.js";const j=/* @__PURE__ */e({name:"CLCarouselNavigation",__name:"CLCarouselNavigation",props:{color:{},currentPage:{},enabled:{type:Boolean},gotoPage:{},moreAriaLabel:{default:"Navigate to page to see more results"},moreLabel:{},nextPageEnabled:{type:Boolean},paginationType:{},prefix:{},prevPageEnabled:{type:Boolean},showMore:{},showNextItems:{},showPrevItems:{},totalPages:{},variant:{}},setup(e){const g=e,h=a(()=>[`${g.prefix}__dots-container`]),b=a(()=>[`${g.prefix}__arrows-container`]),m=a(()=>[`${g.prefix}__numbered-container`]),_=a(()=>[`${g.prefix}__inline-container`]),w=a(()=>[`${g.prefix}__prev-page`]),y=a(()=>[`${g.prefix}__next-page`]),S=a(()=>[`${g.prefix}__page-indicator`]),E=a(()=>[`${g.prefix}__show-more`]),M=e=>g.currentPage===e,I=a(()=>!g.enabled||!g.prevPageEnabled),N=a(()=>!g.enabled||!g.nextPageEnabled);return(a,g)=>(o(),l(i,null,[e.paginationType===n(B).Dots?(o(),l("div",{key:0,class:s(n(h))},[(o(!0),l(i,null,r(e.totalPages,a=>(o(),c(n(x),{key:`dot-${a}`,"aria-label":`Show page ${a}`,color:e.color,disabled:M(a),height:"0.75rem","on-click":()=>e.gotoPage(a),width:"0.75rem",variant:M(a)?n($).Outline:e.variant,wrap:""},null,8,["aria-label","color","disabled","on-click","variant"]))),128))],2)):t("",!0),e.paginationType===n(B).Numbered?(o(),l("div",{key:1,class:s(n(m))},[v("div",{class:s(n(w))},[d(n(x),{"aria-label":"Show previous page of slides",color:e.color,disabled:n(I),"icon-before":n(z).ChevronLeft,"icon-size":n(L).Tiny,size:n(k).Tiny,"on-click":e.showPrevItems,variant:n(I)?n($).Text:e.variant},null,8,["color","disabled","icon-before","icon-size","size","on-click","variant"])],2),v("div",{class:s(n(S))},[d(n(T),{type:n(P).Small},{default:u(()=>[p(f(e.currentPage)+" / "+f(e.totalPages),1)]),_:1},8,["type"])],2),v("div",{class:s(n(y))},[d(n(x),{"aria-label":"Show next page of slides",color:e.color,disabled:n(N),"icon-before":n(z).ChevronRight,"icon-size":n(L).Tiny,size:n(k).Tiny,"on-click":e.showNextItems,variant:n(N)?n($).Text:e.variant},null,8,["color","disabled","icon-before","icon-size","size","on-click","variant"])],2),e.showMore?(o(),l("div",{key:0,class:s(n(E))},[d(n(x),{"aria-label":e.moreAriaLabel,color:e.color,size:n(k).Small,"on-click":e.showMore,variant:e.variant},{default:u(()=>[p(f(e.moreLabel),1)]),_:1},8,["aria-label","color","size","on-click","variant"])],2)):t("",!0)],2)):t("",!0),e.paginationType===n(B).Arrows?(o(),l("div",{key:2,class:s(n(b))},[v("div",{class:s(n(w))},[d(n(x),{"aria-label":"Show previous page of slides",color:e.color,disabled:n(I),"icon-before":n(z).ChevronLeft,"icon-size":n(L).Tiny,size:n(k).Tiny,"on-click":e.showPrevItems,variant:n(I)?n($).Text:e.variant},null,8,["color","disabled","icon-before","icon-size","size","on-click","variant"])],2),v("div",{class:s(n(y))},[d(n(x),{"aria-label":"Show next page of slides",color:e.color,disabled:n(N),"icon-before":n(z).ChevronRight,"icon-size":n(L).Tiny,size:n(k).Tiny,"on-click":e.showNextItems,variant:n(N)?n($).Text:e.variant},null,8,["color","disabled","icon-before","icon-size","size","on-click","variant"])],2)],2)):t("",!0),e.paginationType===n(B).Inline?(o(),l("div",{key:3,class:s(n(_))},[v("div",{class:s(n(w))},[d(n(x),{"aria-label":"Show previous page of slides","align-content":n(C).Center,color:e.color,disabled:n(I),"icon-before":n(z).ChevronLeft,"icon-size":n(L).Small,size:n(k).Tiny,"on-click":e.showPrevItems,variant:n(I)?n($).Text:e.variant,width:"30px",height:"30px",wrap:""},null,8,["align-content","color","disabled","icon-before","icon-size","size","on-click","variant"])],2),v("div",{class:s(n(y))},[d(n(x),{"aria-label":"Show next page of slides","align-content":n(C).Center,color:e.color,disabled:n(N),"icon-before":n(z).ChevronRight,"icon-size":n(L).Small,size:n(k).Tiny,"on-click":e.showNextItems,variant:n(N)?n($).Text:e.variant,width:"30px",height:"30px",wrap:""},null,8,["align-content","color","disabled","icon-before","icon-size","size","on-click","variant"])],2)],2)):t("",!0)],64))}}),W=["data-testid"],H=["hidden"],O=/* @__PURE__ */e({name:"CLCarousel",__name:"CLCarousel",props:{color:{default:S.Neutral},controlAlign:{default:C.Right},controlPosition:{default:E.Before},enabled:{type:Boolean,default:!0},infinite:{type:Boolean,default:!1},moreLabel:{default:"More"},onShowMore:{},paginationType:{default:B.Numbered},perPage:{default:3},perPageByBreakpoints:{},testId:{default:"clll-carousel"},title:{},variant:{default:$.Soft},width:{default:"100%"}},setup(e){g(e=>({fd2b86ea:e.width,v75596a20:n(Q)}));const r="clll-carousel",c=e,x=h(),$=h(!1),k=h(1),L=h(c.perPage),z=h(0),P=A("title"),S=h(!1),O=h(!1),R=h(!1),q=h(0),D=h(!1),F=h(),G=h(!1),J=h(),K=h(),Q=h("100%"),U=h(0),V=h(0),X=()=>{if(c.perPageByBreakpoints?.length){L.value=c.perPage;for(const[e,a]of c.perPageByBreakpoints){window.matchMedia(`(min-width: ${e}px)`).matches&&(L.value=a)}}},Y=()=>{const e=J?.value;if(e&&V.value){const e=Math.ceil(V.value/L.value);U.value=e,c.infinite?(O.value=!0,R.value=!0):e>1&&(O.value=!0)}},Z=e=>{x.value&&m(()=>{const a=I(x.value)&&!P.value;a||!e.title&&e.controlPosition!==E.Before?$.value=a:$.value=!1})},ee=e=>{const a=J?.value,l=a.offsetWidth;if(a&&l)if(c.infinite&&c.enabled&&q.value>0){const o=l/L.value*(z.value/2)+l*(e-1);a.scrollTo({left:o,behavior:"smooth"})}else{const o=l*(e-1);a.scrollTo({left:o,behavior:"smooth"})}},ae=()=>{D.value=!0;const e=L.value;X(),ie(),Y();const a=J?.value,l=a.offsetWidth;if(a)if(c.infinite&&c.enabled&&q.value>0){const o=l/L.value,i=l/e,t=z.value/2,n=i*t,s=a.scrollLeft-n;if(e!==L.value){const e=a.querySelectorAll(`div[class="${r}__slides"] > *`),l=Array.from(e),o=l.slice(t,l.length-t);a.innerHTML="",o.forEach(e=>a.appendChild(e));const i=Math.min(L.value,o.length);if(i>0&&o.length>0){o.slice(-i).forEach(e=>{const l=e.cloneNode(!0);a.insertBefore(l,o[0])});o.slice(0,i).forEach(e=>{const l=e.cloneNode(!0);a.appendChild(l)}),z.value=2*i}}const c=o*(z.value/2)+s;m(()=>{a.scrollLeft=c})}else{k.value=1;const e=l*(k.value-1);a.scrollLeft=e}M&&D.value&&(window.clearTimeout(F.value),F.value=window.setTimeout(()=>{D.value&&(D.value=!1),window.clearTimeout(F.value)},300))},le=()=>{D.value||(G.value=!0,M&&G.value&&(window.clearTimeout(K.value),K.value=window.setTimeout(()=>{G.value&&oe(),window.clearTimeout(K.value)},200)))},oe=()=>{D.value||(G.value=!1,S.value||m(()=>{let e,a;const l=J?.value;if(l){const o=l?.querySelectorAll(`div[class="${r}__slides"] > *`)??[];if(c.infinite&&c.enabled&&q.value>0){const e=l.offsetWidth,a=e/L.value,o=l.scrollLeft,i=a*(z.value/2),t=a*q.value;let n=o-i;n<0&&(n=t+n);const s=Math.floor(n/e)+1;if(s<1?k.value=U.value:s>U.value?k.value=1:k.value=s,!S.value)if(o<i){S.value=!0;const e=o+t;l.scrollTo({left:e,behavior:"auto"}),setTimeout(()=>{S.value=!1},50)}else if(o>=i+t){S.value=!0;const e=o-t;l.scrollTo({left:e,behavior:"auto"}),setTimeout(()=>{S.value=!1},50)}}else{const i=V.value-1;for(let t=0;t<U.value;t++){const n=L.value*(t+1)-1,s=n<i?o[n]:o[i],r=n<i?n:i;N({parent:l,child:s,leftOffset:40,rightOffset:40,threshold:.5})&&(r===i?(a=i,e=t+1):(a=r,e=t+1))}void 0!==a&&a>-1&&e&&(k.value=e,e>1&&(R.value=!0),1===e&&(R.value=!1),e<U.value&&(O.value=!0),e===U.value&&(O.value=!1))}}}))},ie=()=>{const e=J?.value;if(e){const a=e.offsetWidth;V.value>=L.value?Q.value=a/L.value+"px":Q.value=a/V.value+"px"}},te=()=>{const e=J?.value,a=e.offsetWidth;if(e&&a)if(c.infinite&&c.enabled&&q.value>0){const l=e.scrollLeft+a;e.scrollTo({left:l,behavior:"smooth"})}else{const l=a*k.value;e.scrollTo({left:l,behavior:"smooth"})}},ne=()=>{const e=J?.value,a=e.offsetWidth;if(e&&a)if(c.infinite&&c.enabled&&q.value>0){const l=e.scrollLeft-a;e.scrollTo({left:l,behavior:"smooth"})}else{const l=a*(k.value-1-1);e.scrollTo({left:l,behavior:"smooth"})}};b(()=>{if(M){window.addEventListener("resize",ae);const e=J?.value;if(e){const a=e?.querySelectorAll(`div[class="${r}__slides"] > *`)??[];if(q.value=a.length,V.value=a.length,c.infinite&&c.enabled&&a.length>0){const l=Array.from(a),o=Math.min(L.value,l.length);l.slice(-o).forEach(a=>{const o=a.cloneNode(!0);e.insertBefore(o,l[0])});l.slice(0,o).forEach(a=>{const l=a.cloneNode(!0);e.appendChild(l)}),z.value=2*o,m(()=>{const a=e.offsetWidth/L.value*o;e.scrollLeft=a})}e.addEventListener("scroll",le),e.addEventListener("scrollend",oe)}Z(c),X(),ie(),Y()}}),_(()=>{if(M){window.removeEventListener("resize",ae),F.value&&window.clearTimeout(F.value),K.value&&window.clearTimeout(K.value);const e=J?.value;e&&(e.removeEventListener("scroll",le),e.removeEventListener("scrollend",oe))}});const se=a(()=>[r,`${r}--${c.controlAlign}`,`${r}--${c.controlPosition}`,`${r}--${c.paginationType}`,c.enabled?`${r}--enabled`:`${r}--disabled`,$.value?"":`${r}--hastitle`,c.onShowMore?`${r}--has-more`:""]),re=a(()=>[`${r}__slide-controls`,P.value?`${r}__slide-controls--hascustomtitle`:""]),ce=a(()=>[`${r}__slides`,D.value?`${r}__slides--resizing`:"",G.value?`${r}__slides--scrolling`:"",S.value?`${r}__slides--jumping`:""]),ve=a(()=>[`${r}__navigation`,`${r}__navigation--${c.controlAlign}`,`${r}__navigation--${c.controlPosition}`]);return w(c,e=>{Z(e)}),(a,c)=>(o(),l("div",{class:s(n(se)),"data-testid":e.testId},[v("div",{ref_key:"beforeControls",ref:x,class:s(n(re)),hidden:n($)},[v("div",{class:s(`${r}__custom-title`)},[y(a.$slots,"title")],2),e.title?(o(),l("div",{key:0,class:s(`${r}__title`)},[d(n(T),{align:n(P)?n(C).Center:n(C).Left,label:"",truncate:""},{default:u(()=>[p(f(e.title),1)]),_:1},8,["align"])],2)):t("",!0),e.controlPosition!==n(E).Before||[n(B).Inline,n(B).Hidden].includes(e.paginationType)?t("",!0):(o(),l(i,{key:1},[n(U)&&n(V)>n(L)?(o(),l("div",{key:0,class:s(n(ve))},[d(j,{color:e.color,"current-page":n(k),enabled:!n(G),"goto-page":ee,"more-label":e.moreLabel,"next-page-enabled":n(O),"pagination-type":e.paginationType,"prev-page-enabled":n(R),prefix:r,"show-more":e.onShowMore,"show-next-items":te,"show-prev-items":ne,"total-pages":n(U),variant:e.variant},null,8,["color","current-page","enabled","more-label","next-page-enabled","pagination-type","prev-page-enabled","show-more","total-pages","variant"])],2)):t("",!0)],64))],10,H),v("div",{ref_key:"scrollContainer",ref:J,class:s(n(ce)),tabindex:"0"},[y(a.$slots,"default")],2),e.controlPosition!==n(E).After||[n(B).Inline,n(B).Hidden].includes(e.paginationType)?t("",!0):(o(),l(i,{key:0},[n(U)&&n(V)>n(L)?(o(),l("div",{key:0,class:s(`${r}__slide-controls`)},[v("div",{class:s(n(ve))},[d(j,{color:e.color,"current-page":n(k),enabled:!n(G),"goto-page":ee,"more-label":e.moreLabel,"next-page-enabled":n(O),"pagination-type":e.paginationType,prefix:r,"prev-page-enabled":n(R),"show-more":e.onShowMore,"show-next-items":te,"show-prev-items":ne,"total-pages":n(U),variant:e.variant},null,8,["color","current-page","enabled","more-label","next-page-enabled","pagination-type","prev-page-enabled","show-more","total-pages","variant"])],2)],2)):t("",!0)],64)),e.paginationType===n(B).Inline?(o(),l("div",{key:1,class:s(`${r}__slide-controls ${r}__slide-controls--inline`)},[v("div",{class:s(`${r}__navigation`)},[d(j,{color:e.color,"current-page":n(k),enabled:!n(G),"goto-page":ee,"more-label":e.moreLabel,"next-page-enabled":n(O),"pagination-type":e.paginationType,prefix:r,"prev-page-enabled":n(R),"show-more":e.onShowMore,"show-next-items":te,"show-prev-items":ne,"total-pages":n(U),variant:e.variant},null,8,["color","current-page","enabled","more-label","next-page-enabled","pagination-type","prev-page-enabled","show-more","total-pages","variant"])],2)],2)):t("",!0)],10,W))}}),R=(e,a)=>{const l=e.__vccOpts||e;for(const[o,i]of a)l[o]=i;return l},q={},D={class:/*@__PURE__*/s(["clll-carousel__slide"])};const F=/*#__PURE__*/R(q,[["render",function(e,a){return o(),l("div",D,[y(e.$slots,"default")])}]]),G=O;G.Slide=F;export{G as CLCarousel,G as default};
|
|
3
|
+
import{defineComponent as e,computed as a,createElementBlock as l,openBlock as o,Fragment as i,createCommentVNode as t,unref as n,normalizeClass as s,renderList as r,createBlock as c,createElementVNode as v,createVNode as d,withCtx as u,createTextVNode as p,toDisplayString as f,useCssVars as g,ref as h,onMounted as b,nextTick as m,onUnmounted as _,watch as w,renderSlot as y}from"vue";import{_ as x}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{_ as T}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-BZQzsJMF.js";import{c as $,C as k,e as L,f as z,a as P,i as C,d as S}from"../../../chunks/index-DwjW-Z-U.js";import{g as B,e as E}from"../../../chunks/index-C9S3C1LU.js";import{i as M,d as I,e as N}from"../../../chunks/helper-BlxFN3eF.js";import{useHasSlotContent as A}from"../../../composables/useHasSlotContent.js";const j=/* @__PURE__ */e({name:"CLCarouselNavigation",__name:"CLCarouselNavigation",props:{color:{},currentPage:{},enabled:{type:Boolean},gotoPage:{},moreAriaLabel:{default:"Navigate to page to see more results"},moreLabel:{},nextPageEnabled:{type:Boolean},paginationType:{},prefix:{},prevPageEnabled:{type:Boolean},showMore:{},showNextItems:{},showPrevItems:{},totalPages:{},variant:{}},setup(e){const g=e,h=a(()=>[`${g.prefix}__dots-container`]),b=a(()=>[`${g.prefix}__arrows-container`]),m=a(()=>[`${g.prefix}__numbered-container`]),_=a(()=>[`${g.prefix}__inline-container`]),w=a(()=>[`${g.prefix}__prev-page`]),y=a(()=>[`${g.prefix}__next-page`]),S=a(()=>[`${g.prefix}__page-indicator`]),E=a(()=>[`${g.prefix}__show-more`]),M=e=>g.currentPage===e,I=a(()=>!g.enabled||!g.prevPageEnabled),N=a(()=>!g.enabled||!g.nextPageEnabled);return(a,g)=>(o(),l(i,null,[e.paginationType===n(B).Dots?(o(),l("div",{key:0,class:s(n(h))},[(o(!0),l(i,null,r(e.totalPages,a=>(o(),c(n(x),{key:`dot-${a}`,"aria-label":`Show page ${a}`,color:e.color,disabled:M(a),height:"0.75rem","on-click":()=>e.gotoPage(a),width:"0.75rem",variant:M(a)?n($).Outline:e.variant,wrap:""},null,8,["aria-label","color","disabled","on-click","variant"]))),128))],2)):t("",!0),e.paginationType===n(B).Numbered?(o(),l("div",{key:1,class:s(n(m))},[v("div",{class:s(n(w))},[d(n(x),{"aria-label":"Show previous page of slides",color:e.color,disabled:n(I),"icon-before":n(z).ChevronLeft,"icon-size":n(L).Tiny,size:n(k).Tiny,"on-click":e.showPrevItems,variant:n(I)?n($).Text:e.variant},null,8,["color","disabled","icon-before","icon-size","size","on-click","variant"])],2),v("div",{class:s(n(S))},[d(n(T),{type:n(P).Small},{default:u(()=>[p(f(e.currentPage)+" / "+f(e.totalPages),1)]),_:1},8,["type"])],2),v("div",{class:s(n(y))},[d(n(x),{"aria-label":"Show next page of slides",color:e.color,disabled:n(N),"icon-before":n(z).ChevronRight,"icon-size":n(L).Tiny,size:n(k).Tiny,"on-click":e.showNextItems,variant:n(N)?n($).Text:e.variant},null,8,["color","disabled","icon-before","icon-size","size","on-click","variant"])],2),e.showMore?(o(),l("div",{key:0,class:s(n(E))},[d(n(x),{"aria-label":e.moreAriaLabel,color:e.color,size:n(k).Small,"on-click":e.showMore,variant:e.variant},{default:u(()=>[p(f(e.moreLabel),1)]),_:1},8,["aria-label","color","size","on-click","variant"])],2)):t("",!0)],2)):t("",!0),e.paginationType===n(B).Arrows?(o(),l("div",{key:2,class:s(n(b))},[v("div",{class:s(n(w))},[d(n(x),{"aria-label":"Show previous page of slides",color:e.color,disabled:n(I),"icon-before":n(z).ChevronLeft,"icon-size":n(L).Tiny,size:n(k).Tiny,"on-click":e.showPrevItems,variant:n(I)?n($).Text:e.variant},null,8,["color","disabled","icon-before","icon-size","size","on-click","variant"])],2),v("div",{class:s(n(y))},[d(n(x),{"aria-label":"Show next page of slides",color:e.color,disabled:n(N),"icon-before":n(z).ChevronRight,"icon-size":n(L).Tiny,size:n(k).Tiny,"on-click":e.showNextItems,variant:n(N)?n($).Text:e.variant},null,8,["color","disabled","icon-before","icon-size","size","on-click","variant"])],2)],2)):t("",!0),e.paginationType===n(B).Inline?(o(),l("div",{key:3,class:s(n(_))},[v("div",{class:s(n(w))},[d(n(x),{"aria-label":"Show previous page of slides","align-content":n(C).Center,color:e.color,disabled:n(I),"icon-before":n(z).ChevronLeft,"icon-size":n(L).Small,size:n(k).Tiny,"on-click":e.showPrevItems,variant:n(I)?n($).Text:e.variant,width:"30px",height:"30px",wrap:""},null,8,["align-content","color","disabled","icon-before","icon-size","size","on-click","variant"])],2),v("div",{class:s(n(y))},[d(n(x),{"aria-label":"Show next page of slides","align-content":n(C).Center,color:e.color,disabled:n(N),"icon-before":n(z).ChevronRight,"icon-size":n(L).Small,size:n(k).Tiny,"on-click":e.showNextItems,variant:n(N)?n($).Text:e.variant,width:"30px",height:"30px",wrap:""},null,8,["align-content","color","disabled","icon-before","icon-size","size","on-click","variant"])],2)],2)):t("",!0)],64))}}),W=["data-testid"],H=["hidden"],O=/* @__PURE__ */e({name:"CLCarousel",__name:"CLCarousel",props:{color:{default:S.Neutral},controlAlign:{default:C.Right},controlPosition:{default:E.Before},enabled:{type:Boolean,default:!0},infinite:{type:Boolean,default:!1},moreLabel:{default:"More"},onShowMore:{},paginationType:{default:B.Numbered},perPage:{default:3},perPageByBreakpoints:{},testId:{default:"clll-carousel"},title:{},variant:{default:$.Soft},width:{default:"100%"}},setup(e){g(e=>({fd2b86ea:e.width,v75596a20:n(Q)}));const r="clll-carousel",c=e,x=h(),$=h(!1),k=h(1),L=h(c.perPage),z=h(0),P=A("title"),S=h(!1),O=h(!1),R=h(!1),q=h(0),D=h(!1),F=h(),G=h(!1),J=h(),K=h(),Q=h("100%"),U=h(0),V=h(0),X=()=>{if(c.perPageByBreakpoints?.length){L.value=c.perPage;for(const[e,a]of c.perPageByBreakpoints){window.matchMedia(`(min-width: ${e}px)`).matches&&(L.value=a)}}},Y=()=>{const e=J?.value;if(e&&V.value){const e=Math.ceil(V.value/L.value);U.value=e,c.infinite?(O.value=!0,R.value=!0):e>1&&(O.value=!0)}},Z=e=>{x.value&&m(()=>{const a=I(x.value)&&!P.value;a||!e.title&&e.controlPosition!==E.Before?$.value=a:$.value=!1})},ee=e=>{const a=J?.value,l=a.offsetWidth;if(a&&l)if(c.infinite&&c.enabled&&q.value>0){const o=l/L.value*(z.value/2)+l*(e-1);a.scrollTo({left:o,behavior:"smooth"})}else{const o=l*(e-1);a.scrollTo({left:o,behavior:"smooth"})}},ae=()=>{D.value=!0;const e=L.value;X(),ie(),Y();const a=J?.value,l=a.offsetWidth;if(a)if(c.infinite&&c.enabled&&q.value>0){const o=l/L.value,i=l/e,t=z.value/2,n=i*t,s=a.scrollLeft-n;if(e!==L.value){const e=a.querySelectorAll(`div[class="${r}__slides"] > *`),l=Array.from(e),o=l.slice(t,l.length-t);a.innerHTML="",o.forEach(e=>a.appendChild(e));const i=Math.min(L.value,o.length);if(i>0&&o.length>0){o.slice(-i).forEach(e=>{const l=e.cloneNode(!0);a.insertBefore(l,o[0])});o.slice(0,i).forEach(e=>{const l=e.cloneNode(!0);a.appendChild(l)}),z.value=2*i}}const c=o*(z.value/2)+s;m(()=>{a.scrollLeft=c})}else{k.value=1;const e=l*(k.value-1);a.scrollLeft=e}M&&D.value&&(window.clearTimeout(F.value),F.value=window.setTimeout(()=>{D.value&&(D.value=!1),window.clearTimeout(F.value)},300))},le=()=>{D.value||(G.value=!0,M&&G.value&&(window.clearTimeout(K.value),K.value=window.setTimeout(()=>{G.value&&oe(),window.clearTimeout(K.value)},200)))},oe=()=>{D.value||(G.value=!1,S.value||m(()=>{let e,a;const l=J?.value;if(l){const o=l?.querySelectorAll(`div[class="${r}__slides"] > *`)??[];if(c.infinite&&c.enabled&&q.value>0){const e=l.offsetWidth,a=e/L.value,o=l.scrollLeft,i=a*(z.value/2),t=a*q.value;let n=o-i;n<0&&(n=t+n);const s=Math.floor(n/e)+1;if(s<1?k.value=U.value:s>U.value?k.value=1:k.value=s,!S.value)if(o<i){S.value=!0;const e=o+t;l.scrollTo({left:e,behavior:"auto"}),setTimeout(()=>{S.value=!1},50)}else if(o>=i+t){S.value=!0;const e=o-t;l.scrollTo({left:e,behavior:"auto"}),setTimeout(()=>{S.value=!1},50)}}else{const i=V.value-1;for(let t=0;t<U.value;t++){const n=L.value*(t+1)-1,s=n<i?o[n]:o[i],r=n<i?n:i;N({parent:l,child:s,leftOffset:40,rightOffset:40,threshold:.5})&&(r===i?(a=i,e=t+1):(a=r,e=t+1))}void 0!==a&&a>-1&&e&&(k.value=e,e>1&&(R.value=!0),1===e&&(R.value=!1),e<U.value&&(O.value=!0),e===U.value&&(O.value=!1))}}}))},ie=()=>{const e=J?.value;if(e){const a=e.offsetWidth;V.value>=L.value?Q.value=a/L.value+"px":Q.value=a/V.value+"px"}},te=()=>{const e=J?.value,a=e.offsetWidth;if(e&&a)if(c.infinite&&c.enabled&&q.value>0){const l=e.scrollLeft+a;e.scrollTo({left:l,behavior:"smooth"})}else{const l=a*k.value;e.scrollTo({left:l,behavior:"smooth"})}},ne=()=>{const e=J?.value,a=e.offsetWidth;if(e&&a)if(c.infinite&&c.enabled&&q.value>0){const l=e.scrollLeft-a;e.scrollTo({left:l,behavior:"smooth"})}else{const l=a*(k.value-1-1);e.scrollTo({left:l,behavior:"smooth"})}};b(()=>{if(M){window.addEventListener("resize",ae);const e=J?.value;if(e){const a=e?.querySelectorAll(`div[class="${r}__slides"] > *`)??[];if(q.value=a.length,V.value=a.length,c.infinite&&c.enabled&&a.length>0){const l=Array.from(a),o=Math.min(L.value,l.length);l.slice(-o).forEach(a=>{const o=a.cloneNode(!0);e.insertBefore(o,l[0])});l.slice(0,o).forEach(a=>{const l=a.cloneNode(!0);e.appendChild(l)}),z.value=2*o,m(()=>{const a=e.offsetWidth/L.value*o;e.scrollLeft=a})}e.addEventListener("scroll",le),e.addEventListener("scrollend",oe)}Z(c),X(),ie(),Y()}}),_(()=>{if(M){window.removeEventListener("resize",ae),F.value&&window.clearTimeout(F.value),K.value&&window.clearTimeout(K.value);const e=J?.value;e&&(e.removeEventListener("scroll",le),e.removeEventListener("scrollend",oe))}});const se=a(()=>[r,`${r}--${c.controlAlign}`,`${r}--${c.controlPosition}`,`${r}--${c.paginationType}`,c.enabled?`${r}--enabled`:`${r}--disabled`,$.value?"":`${r}--hastitle`,c.onShowMore?`${r}--has-more`:""]),re=a(()=>[`${r}__slide-controls`,P.value?`${r}__slide-controls--hascustomtitle`:""]),ce=a(()=>[`${r}__slides`,D.value?`${r}__slides--resizing`:"",G.value?`${r}__slides--scrolling`:"",S.value?`${r}__slides--jumping`:""]),ve=a(()=>[`${r}__navigation`,`${r}__navigation--${c.controlAlign}`,`${r}__navigation--${c.controlPosition}`]);return w(c,e=>{Z(e)}),(a,c)=>(o(),l("div",{class:s(n(se)),"data-testid":e.testId},[v("div",{ref_key:"beforeControls",ref:x,class:s(n(re)),hidden:n($)},[v("div",{class:s(`${r}__custom-title`)},[y(a.$slots,"title")],2),e.title?(o(),l("div",{key:0,class:s(`${r}__title`)},[d(n(T),{align:n(P)?n(C).Center:n(C).Left,label:"",truncate:""},{default:u(()=>[p(f(e.title),1)]),_:1},8,["align"])],2)):t("",!0),e.controlPosition!==n(E).Before||[n(B).Inline,n(B).Hidden].includes(e.paginationType)?t("",!0):(o(),l(i,{key:1},[n(U)&&n(V)>n(L)?(o(),l("div",{key:0,class:s(n(ve))},[d(j,{color:e.color,"current-page":n(k),enabled:!n(G),"goto-page":ee,"more-label":e.moreLabel,"next-page-enabled":n(O),"pagination-type":e.paginationType,"prev-page-enabled":n(R),prefix:r,"show-more":e.onShowMore,"show-next-items":te,"show-prev-items":ne,"total-pages":n(U),variant:e.variant},null,8,["color","current-page","enabled","more-label","next-page-enabled","pagination-type","prev-page-enabled","show-more","total-pages","variant"])],2)):t("",!0)],64))],10,H),v("div",{ref_key:"scrollContainer",ref:J,class:s(n(ce)),tabindex:"0"},[y(a.$slots,"default")],2),e.controlPosition!==n(E).After||[n(B).Inline,n(B).Hidden].includes(e.paginationType)?t("",!0):(o(),l(i,{key:0},[n(U)&&n(V)>n(L)?(o(),l("div",{key:0,class:s(`${r}__slide-controls`)},[v("div",{class:s(n(ve))},[d(j,{color:e.color,"current-page":n(k),enabled:!n(G),"goto-page":ee,"more-label":e.moreLabel,"next-page-enabled":n(O),"pagination-type":e.paginationType,prefix:r,"prev-page-enabled":n(R),"show-more":e.onShowMore,"show-next-items":te,"show-prev-items":ne,"total-pages":n(U),variant:e.variant},null,8,["color","current-page","enabled","more-label","next-page-enabled","pagination-type","prev-page-enabled","show-more","total-pages","variant"])],2)],2)):t("",!0)],64)),e.paginationType===n(B).Inline?(o(),l("div",{key:1,class:s(`${r}__slide-controls ${r}__slide-controls--inline`)},[v("div",{class:s(`${r}__navigation`)},[d(j,{color:e.color,"current-page":n(k),enabled:!n(G),"goto-page":ee,"more-label":e.moreLabel,"next-page-enabled":n(O),"pagination-type":e.paginationType,prefix:r,"prev-page-enabled":n(R),"show-more":e.onShowMore,"show-next-items":te,"show-prev-items":ne,"total-pages":n(U),variant:e.variant},null,8,["color","current-page","enabled","more-label","next-page-enabled","pagination-type","prev-page-enabled","show-more","total-pages","variant"])],2)],2)):t("",!0)],10,W))}}),R=(e,a)=>{const l=e.__vccOpts||e;for(const[o,i]of a)l[o]=i;return l},q={},D={class:/*@__PURE__*/s(["clll-carousel__slide"])};const F=/*#__PURE__*/R(q,[["render",function(e,a){return o(),l("div",D,[y(e.$slots,"default")])}]]),G=O;G.Slide=F;export{G as CLCarousel,G as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLDisclosure.css';
|
|
3
|
-
import{defineComponent as e,ref as a,watch as t,computed as d,onBeforeUnmount as o,createElementBlock as n,openBlock as s,normalizeStyle as l,normalizeClass as i,unref as r,createVNode as u,createElementVNode as c,withKeys as p,withCtx as _,createBlock as g,createCommentVNode as f,renderSlot as m,createTextVNode as $,toDisplayString as y}from"vue";import{_ as v}from"../../../chunks/CLA11yButton.vue_vue_type_style_index_0_lang-BnJRXVwW.js";import{_ as h}from"../../../chunks/CLHeading.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{defineComponent as e,ref as a,watch as t,computed as d,onBeforeUnmount as o,createElementBlock as n,openBlock as s,normalizeStyle as l,normalizeClass as i,unref as r,createVNode as u,createElementVNode as c,withKeys as p,withCtx as _,createBlock as g,createCommentVNode as f,renderSlot as m,createTextVNode as $,toDisplayString as y}from"vue";import{_ as v}from"../../../chunks/CLA11yButton.vue_vue_type_style_index_0_lang-BnJRXVwW.js";import{_ as h}from"../../../chunks/CLHeading.vue_vue_type_style_index_0_lang-Bp0Hmc-g.js";import{_ as b}from"../../../chunks/CLIcon.vue_vue_type_style_index_0_lang-BN_rKLKK.js";import{_ as x}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-BZQzsJMF.js";import{c as B,C,a as S,e as k,f as z,l as I,d as L}from"../../../chunks/index-DwjW-Z-U.js";import{d as j}from"../../../chunks/utils-CYyJsKfZ.js";import{useEsc as H}from"../../../composables/useEsc.js";import{useHasSlotContent as T}from"../../../composables/useHasSlotContent.js";import{useTheme as A}from"../../../composables/useTheme.js";const D=["data-testid"],E=["id","aria-labelledby","aria-hidden"],R=/* @__PURE__ */e({name:"CLDisclosure",__name:"CLDisclosure",props:{bordered:{type:Boolean,default:!0},borderRadius:{},color:{default:L.Neutral},compact:{type:Boolean,default:!1},contentSpacing:{type:Boolean,default:!0},disclosureId:{},expanded:{type:Boolean,default:!1},expandedIcon:{default:z.ChevronUp},heading:{},headingLevel:{},headingType:{default:I.Section},iconAfter:{default:z.ChevronDown},iconBefore:{},iconSize:{default:k.Medium},rounded:{type:Boolean,default:!0},subHeading:{},subHeadingType:{default:S.Body},testId:{default:"clll-disclosure"},triggerButtonSize:{default:C.Medium},variant:{default:B.Soft}},emits:["disclosure-toggle","update:expanded"],setup(e,{expose:B,emit:C}){const S=C,k="clll-disclosure",z=A(),I=e;let L=a();const R=a(I.expanded);t(()=>I.expanded,e=>{R.value=e});const M=T("trailing"),q=d(()=>[k,`${k}--${I.color}--${I.variant}`,`${k}--${I.triggerButtonSize}`,I.bordered?`${k}--bordered`:"",I.borderRadius?`${k}--${I.borderRadius}`:"",I.contentSpacing?`${k}--padded`:`${k}--nopadding`,I.compact?`${k}--compact`:"",R.value?`${k}--expanded`:`${k}--collapsed`,I.heading?`${k}--hasheading`:"",I.subHeading||M.value?`${k}--hassubheading`:"",I.rounded?`${k}--rounded`:`${k}--box`,`${k}--${I.triggerButtonSize}`]),w=d(()=>[`${k}__content`,`${k}__content--${I.triggerButtonSize}`]),K=e=>{R.value="boolean"==typeof e?e:!R.value,S("update:expanded",R.value),S("disclosure-toggle",R.value)},N=()=>{K()},{clearEventListeners:U}=H({escHandler:N,triggerElem:L});return o(()=>{U()}),B({close:()=>{K(!1)},expanded:R,open:()=>{K(!0)},toggle:K}),(a,t)=>(s(),n("div",{class:i(r(q)),style:l(r(j)({color:e.color,variant:e.variant,theme:r(z)})),"data-testid":e.testId},[u(r(v),{id:`${k}__button--${e.disclosureId}`,"aria-controls":`${k}--${e.disclosureId}`,"aria-expanded":r(R),color:e.color,enabled:!0,fluid:!0,rounded:e.rounded,role:"button",onClick:N,onKeyup:p(N,["enter"])},{default:_(()=>[c("div",{class:i(`${k}__trigger`)},[c("span",{class:i(`${k}__heading`)},[e.iconBefore?(s(),g(r(b),{key:0,name:e.iconBefore,size:e.iconSize},null,8,["name","size"])):f("",!0),c("span",{class:i(`${k}__heading-text`)},[e.heading?(s(),g(r(h),{key:0,class:i(`${k}__text-heading`),type:e.headingType,level:e.headingLevel,truncate:""},{default:_(()=>[$(y(e.heading),1)]),_:1},8,["class","type","level"])):f("",!0),e.subHeading?(s(),g(r(x),{key:1,class:i(`${k}__text-subheading`),type:e.subHeadingType,truncate:""},{default:_(()=>[$(y(e.subHeading),1)]),_:1},8,["class","type"])):f("",!0)],2),m(a.$slots,"trailing"),e.iconAfter?(s(),g(r(b),{key:1,name:r(R)?e.expandedIcon:e.iconAfter,size:e.iconSize},null,8,["name","size"])):f("",!0)],2)],2)]),_:3},8,["id","aria-controls","aria-expanded","color","rounded"]),c("div",{id:`${k}--${e.disclosureId}`,"aria-labelledby":`${k}__button--${e.disclosureId}`,"aria-hidden":!r(R),class:i(r(w))},[m(a.$slots,"default")],10,E)],14,D))}});export{R as CLDisclosure,R as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLCalendar.css';
|
|
3
|
-
import{_ as a}from"../../../chunks/CLCalendar.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{_ as a}from"../../../chunks/CLCalendar.vue_vue_type_style_index_0_lang-BsB4QKTu.js";export{a as CLCalendar,a as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLCheckbox.css';
|
|
3
3
|
import '../../../assets/shared/form-utilities.css';
|
|
4
|
-
import{defineComponent as e,mergeModels as a,useTemplateRef as l,useModel as s,computed as o,createBlock as d,openBlock as u,withCtx as i,createElementVNode as t,createCommentVNode as n,normalizeStyle as r,normalizeClass as c,unref as m,withDirectives as f,vModelCheckbox as p,createVNode as b,createTextVNode as _,toDisplayString as y}from"vue";import{_ as X,a as v}from"../../../chunks/CLInputMessages.vue_vue_type_style_index_0_lang-
|
|
4
|
+
import{defineComponent as e,mergeModels as a,useTemplateRef as l,useModel as s,computed as o,createBlock as d,openBlock as u,withCtx as i,createElementVNode as t,createCommentVNode as n,normalizeStyle as r,normalizeClass as c,unref as m,withDirectives as f,vModelCheckbox as p,createVNode as b,createTextVNode as _,toDisplayString as y}from"vue";import{_ as X,a as v}from"../../../chunks/CLInputMessages.vue_vue_type_style_index_0_lang-CtGriC2l.js";import{_ as L}from"../../../chunks/CLIcon.vue_vue_type_style_index_0_lang-BN_rKLKK.js";import{_ as h}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-BZQzsJMF.js";import{C as $,e as g,a as k,f as x,c as C,d as B}from"../../../chunks/index-DwjW-Z-U.js";import{a as T}from"../../../chunks/utils-BDThP-Sb.js";import{useTheme as q}from"../../../composables/useTheme.js";const M=["data-testid"],F=["for","disabled"],j=["id","aria-label","disabled","form","name","required","value"],z=/* @__PURE__ */e({name:"CLCheckbox",__name:"CLCheckbox",props:/* @__PURE__ */a({ariaLabel:{default:void 0},borderRadius:{default:void 0},busy:{type:Boolean,default:!1},color:{default:B.Neutral},disabled:{type:Boolean,default:!1},form:{default:void 0},id:{},label:{default:void 0},messages:{default:()=>[]},messageType:{default:void 0},name:{},onBlur:{type:Function,default:void 0},onChange:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},required:{type:Boolean,default:!1},rounded:{type:Boolean,default:!0},size:{default:$.Small},testId:{default:"clll-checkbox"},value:{type:[String,Number,Boolean],default:void 0},variant:{default:C.Outline}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(e,{expose:a}){const C={[$.Tiny]:g.Tiny,[$.Small]:g.Tiny,[$.Medium]:g.Small,[$.Large]:g.Medium,[$.XL]:g.Medium,[$.XXL]:g.Large,[$.XXXL]:g.Large,[$.XXXXL]:g.XL},B={[$.Tiny]:k.Small,[$.Small]:k.Medium,[$.Medium]:k.Medium,[$.Large]:k.Large,[$.XL]:k.XL,[$.XXL]:k.XXL,[$.XXXL]:k.XXXL,[$.XXXXL]:k.XXXXL},z=e,S=q(),I=l("checkbox-ref"),R=s(e,"modelValue"),V="clll-checkbox",N=o(()=>[V,z.borderRadius?`${V}--${z.borderRadius}`:"",z.busy?`${V}--busy`:`${V}--ready`,z.disabled?`${V}--disabled`:`${V}--active`,z.label?`${V}--haslabel`:"",`${V}--${z.color}`,`${V}--${z.size}`,z.messageType?`${V}--${z.messageType}`:"",z.rounded?`${V}--rounded`:`${V}--box`,z.required?`${V}--required`:`${V}--optional`]),O=o(()=>[`${V}__checkbox-container`,`${V}--${z.variant}`]),U=()=>{I.value&&I.value.focus()};return a({checkboxRef:I}),(a,l)=>(u(),d(X,null,{default:i(()=>[t("span",{class:c(m(N)),style:r(m(T)({color:e.color,variant:e.variant,theme:m(S)})),"data-testid":e.testId},[t("span",{class:c(m(O)),onClick:U},[t("label",{for:e.id,class:c(`${V}__label`),disabled:e.disabled},[t("span",{class:c([`${V}__checkbox-frame`,"form-control-flex"])},[f(t("input",{id:e.id,ref:"checkbox-ref","onUpdate:modelValue":l[0]||(l[0]=e=>R.value=e),"aria-label":e.ariaLabel,class:c(`${V}__checkbox`),disabled:e.disabled||e.busy,form:e.form,name:e.name,required:e.required,type:"checkbox",value:e.value,onBlur:l[1]||(l[1]=(...a)=>e.onBlur&&e.onBlur(...a)),onChange:l[2]||(l[2]=(...a)=>e.onChange&&e.onChange(...a)),onFocus:l[3]||(l[3]=(...a)=>e.onFocus&&e.onFocus(...a))},null,42,j),[[p,R.value]]),t("span",{class:c(`${V}__icon`)},[b(m(L),{name:m(x).Check,size:C[e.size]},null,8,["name","size"])],2)],2),e.label?(u(),d(m(h),{key:0,as:"span",type:B[e.size],class:c(e.required?`${V}__label--required`:"")},{default:i(()=>[_(y(e.label),1)]),_:1},8,["type","class"])):n("",!0)],10,F)],2)],14,M),e.id?(u(),d(v,{key:0,id:e.id,messages:e.messages,"message-type":e.messageType},null,8,["id","messages","message-type"])):n("",!0)]),_:1}))}});export{z as CLCheckbox,z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLInput.css';
|
|
3
3
|
import '../../../assets/shared/form-utilities.css';
|
|
4
|
-
import{defineComponent as e,computed as l,createElementBlock as a,openBlock as o,normalizeClass as i,unref as t,createBlock as r,Fragment as s,createTextVNode as d,toDisplayString as n,createVNode as u,ref as p,watch as c,createCommentVNode as f,mergeModels as m,useTemplateRef as b,useModel as y,withCtx as x,createElementVNode as v,normalizeStyle as _,withDirectives as g,vModelDynamic as h,isRef as L}from"vue";import{_ as C,a as X}from"../../../chunks/CLInputMessages.vue_vue_type_style_index_0_lang-mu7Jj66U.js";import{_ as k}from"../../../chunks/CLFormLabel.vue_vue_type_script_setup_true_lang-BogK17TG.js";import{_ as z}from"../../../chunks/CLFormCharCounter.vue_vue_type_style_index_0_lang-hB5Ua5Ta.js";import{_ as $}from"../../../chunks/CLIcon.vue_vue_type_style_index_0_lang-BN_rKLKK.js";import{_ as I}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{C as F,d as S,h as B,e as T,c as R,f as V}from"../../../chunks/index-DwjW-Z-U.js";import{_ as j}from"../../../chunks/CLPill.vue_vue_type_style_index_0_lang-DhHSCMrs.js";import{h as P,f as q,C as w}from"../../../chunks/index-C9S3C1LU.js";import{i as M}from"../../../chunks/utils-BfPF8gBW.js";import{useTheme as N}from"../../../composables/useTheme.js";const U=["data-testid"],A=/* @__PURE__ */e({name:"CLInputPrefix",__name:"CLInputPrefix",props:{ariaLabel:{default:void 0},borderRadius:{default:B.XS},color:{default:S.Neutral},disabled:{type:Boolean,default:!1},grouped:{type:Boolean,default:!1},onClick:{type:Function,default:void 0},prefix:{},size:{default:F.Small},testId:{default:"clll-input-prefix"}},setup(e){const u=e,p="clll-input",c=e=>Object.values(V).includes(e),f={[F.Tiny]:T.Tiny,[F.Small]:T.Small,[F.Medium]:T.Medium,[F.Large]:T.Large,[F.XL]:T.XL,[F.XXL]:T.XXL,[F.XXXL]:T.XXXL,[F.XXXXL]:T.XXXXL},m=l(()=>!!u.onClick&&c(u.prefix)),b=l(()=>{return[`${p}__input-prefix`,"form-addon-flex","form-addon-flex--left",c(u.prefix)?`${p}__input-prefix--icon form-addon-flex--icon`:`${p}__input-prefix--string form-addon-flex--string`,{"--interactive":m},{"--input-group":u.grouped||u.prefix},{"--disabled":u.disabled},u.grouped?`form-addon-radius--left-${e=u.borderRadius,e?.replace("rounded-","")||"xs"}`:""];var e}),y=e=>{u.onClick&&e&&!u.disabled&&(e.stopPropagation(),u.onClick(e))};return(l,u)=>(o(),a("div",{class:i(t(b))},[t(m)?(o(),r(t(I),{key:0,"aria-label":e.ariaLabel,"border-radius":e.borderRadius,color:e.color,disabled:e.disabled,"icon-before":e.prefix,"icon-size":f[e.size],"on-click":y,size:e.size,"test-id":e.testId,variant:t(R).Text,wrap:""},null,8,["aria-label","border-radius","color","disabled","icon-before","icon-size","size","test-id","variant"])):(o(),a("span",{key:1,class:"icon-container","data-testid":e.testId},[c(e.prefix)?(o(),r(t($),{key:0,name:e.prefix,size:f[e.size],color:e.color},null,8,["name","size","color"])):(o(),a(s,{key:1},[d(n(e.prefix),1)],64))],8,U))],2))}}),O=["data-testid"],E=/* @__PURE__ */e({name:"CLInputSuffix",__name:"CLInputSuffix",props:{ariaLabel:{default:void 0},borderRadius:{default:B.XS},color:{default:S.Neutral},disabled:{type:Boolean,default:!1},grouped:{type:Boolean,default:!1},onClick:{type:Function,default:void 0},suffix:{},size:{default:F.Small},testId:{default:"clll-input-suffix"}},setup(e){const u=e,p="clll-input",c=e=>Object.values(V).includes(e),f={[F.Tiny]:T.Tiny,[F.Small]:T.Small,[F.Medium]:T.Medium,[F.Large]:T.Large,[F.XL]:T.XL,[F.XXL]:T.XXL,[F.XXXL]:T.XXXL,[F.XXXXL]:T.XXXXL},m=l(()=>!!u.onClick&&c(u.suffix)),b=l(()=>{return[`${p}__input-suffix`,"form-addon-flex","form-addon-flex--right",c(u.suffix)?`${p}__input-suffix--icon form-addon-flex--icon`:`${p}__input-suffix--string form-addon-flex--string`,{"--interactive":m},{"--input-group":u.grouped||u.suffix},{"--disabled":u.disabled},u.grouped?`form-addon-radius--right-${e=u.borderRadius,e?.replace("rounded-","")||"xs"}`:""];var e}),y=e=>{u.onClick&&e&&!u.disabled&&(e.stopPropagation(),u.onClick(e))};return(l,u)=>(o(),a("div",{class:i(t(b))},[t(m)?(o(),r(t(I),{key:0,"aria-label":e.ariaLabel,"border-radius":e.borderRadius,color:e.color,disabled:e.disabled,"icon-before":e.suffix,"icon-size":f[e.size],"on-click":y,size:e.size,"test-id":e.testId,variant:t(R).Text,wrap:""},null,8,["aria-label","border-radius","color","disabled","icon-before","icon-size","size","test-id","variant"])):(o(),a("span",{key:1,class:"icon-container","data-testid":e.testId},[c(e.suffix)?(o(),r(t($),{key:0,name:e.suffix,size:f[e.size],color:e.color},null,8,["name","size","color"])):(o(),a(s,{key:1},[d(n(e.suffix),1)],64))],8,O))],2))}}),G=["data-testid"],H=/* @__PURE__ */e({name:"CLInputPill",__name:"CLInputPill",props:{color:{default:S.Neutral},label:{},testId:{default:"clll-input-pill"}},setup:e=>(l,r)=>(o(),a("span",{class:i("clll-input__pill"),"data-testid":e.testId},[u(t(j),{color:e.color,label:e.label,variant:t(R).Soft},null,8,["color","label","variant"])],10,G))}),D=["data-testid"],J=/* @__PURE__ */e({name:"CLInputColorTools",__name:"CLInputColorTools",props:{copied:{type:Boolean,default:!1},initialValue:{default:void 0},modelValue:{default:void 0},size:{default:F.Small},testId:{default:"clll-input-color-tools"}},emits:["copy","reset","update:copied"],setup(e,{emit:l}){const s=e,d=l,n="clll-input",u=p(s.copied),m={[F.Tiny]:T.Tiny,[F.Small]:T.Small,[F.Medium]:T.Medium,[F.Large]:T.Large,[F.XL]:T.XL,[F.XXL]:T.XXL,[F.XXXL]:T.XXXL,[F.XXXXL]:T.XXXXL},b=async()=>{try{s.modelValue&&(await navigator.clipboard.writeText(s.modelValue.toString()),u.value=!0,d("update:copied",!0),d("copy"))}catch(e){console.error(e)}},y=()=>{d("reset",s.initialValue)};return c(()=>s.copied,e=>{u.value=e}),c(()=>s.modelValue,()=>{u.value=!1,d("update:copied",!1)}),(l,s)=>(o(),a("span",{class:i(`${n}__selected-color-tools`),"data-testid":e.testId},[e.modelValue?(o(),r(t(I),{key:0,"aria-label":"Copy color to clipboard",class:i(`${n}__copy-to-clipboard`),color:t(S).Neutral,"icon-before":t(u)?t(V).Check:t(V).Copy,"icon-size":m[e.size],"on-click":b,size:e.size,title:t(u)?"Color copied to clipboard":"Copy color to clipboard",variant:t(R).Ghost,wrap:""},null,8,["class","color","icon-before","icon-size","size","title","variant"])):f("",!0),e.modelValue?(o(),r(t(I),{key:1,"aria-label":"Reset selected color",class:i(`${n}__reset-selected-color`),color:t(S).Neutral,"on-click":y,"icon-before":t(V).Restore,"icon-size":m[e.size],size:e.size,title:"Reset selected color",variant:t(R).Ghost,wrap:""},null,8,["class","color","icon-before","icon-size","size","variant"])):f("",!0)],10,D))}}),K=["data-testid"],Q=["id","name","aria-label","autocomplete","disabled","form","maxlength","minlength","pattern","placeholder","readonly","required","spellcheck","type"],W=/* @__PURE__ */e({name:"CLInput",__name:"CLInput",props:/* @__PURE__ */m({ariaLabel:{default:void 0},autoComplete:{type:Boolean,default:void 0},borderRadius:{default:void 0},busy:{type:Boolean,default:!1},charCounter:{type:Boolean,default:!1},color:{default:S.Neutral},disabled:{type:Boolean,default:!1},fluid:{type:Boolean,default:!1},form:{default:void 0},grouped:{type:Boolean,default:!1},id:{},label:{default:void 0},maxLength:{default:void 0},messages:{default:()=>[]},messageType:{default:void 0},minLength:{default:void 0},name:{},onBlur:{type:Function,default:void 0},onChange:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},onInput:{type:Function,default:void 0},onPrefixClick:{type:Function,default:void 0},onSuffixClick:{type:Function,default:void 0},orientation:{default:q.Vertical},pattern:{default:void 0},pill:{default:void 0},placeholder:{default:void 0},prefix:{default:void 0},prefixAriaLabel:{default:void 0},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},rounded:{type:Boolean,default:!0},size:{default:F.Small},spellCheck:{type:Boolean,default:void 0},suffix:{default:void 0},suffixAriaLabel:{default:void 0},testId:{default:"clll-input"},type:{default:P.Text},variant:{default:R.Outline}},{modelValue:{},modelModifiers:{}}),emits:/* @__PURE__ */m(["reset"],["update:modelValue"]),setup(e,{expose:s,emit:d}){const u=e,m=d,$=N(),I="clll-input",F=p(!1),S=b("input-elem"),B=y(e,"modelValue");u.type!==P.Color||B.value||(B.value="#FFFFFF");const T=B.value?.toString(),R=e=>Object.values(V).includes(e),j=l(()=>[I,u.borderRadius?`${I}--${u.borderRadius}`:"",u.busy?`${I}--busy`:`${I}--ready`,`${I}--${u.color}`,`${I}--${u.size}`,`${I}--${u.type}`,`${I}--${u.variant}`,u.disabled||u.busy?`${I}--disabled`:`${I}--active`,u.fluid||u.orientation===q.Horizontal?`${I}--fluid`:`${I}--fixed`,u.grouped?`${I}--grouped`:"",u.label?`${I}--haslabel`:"",u.messageType?`${I}--${u.messageType}`:"",u.orientation?`${I}--${u.orientation}`:"",u.pill?`${I}--haspill`:"",u.charCounter&&u.maxLength&&[P.Email,P.None,P.Text,P.Url].includes(u.type)?`${I}--hascharcounter`:"",u.prefix&&![P.Color,P.File].includes(u.type)?`${I}--hasprefix`:"",u.prefix&&![P.Color,P.File].includes(u.type)?R(u.prefix)?`${I}--hasiconprefix`:`${I}--hascustomprefix`:"",u.readonly?`${I}--readonly`:`${I}--writeable`,u.rounded?`${I}--rounded`:`${I}--box`,u.required?`${I}--required`:`${I}--optional`,u.suffix&&![P.Color,P.File].includes(u.type)?`${I}--hassuffix`:"",u.suffix&&![P.Color,P.File].includes(u.type)?R(u.suffix)?`${I}--hasiconsuffix`:`${I}--hascustomsuffix`:""]),U=l(()=>[`${I}__input`,{"--nocolor":u.type===P.Color&&!B.value},{"--input-group":u.grouped||u.prefix||u.suffix}]),O=e=>{B.value=e,m("reset",B.value)},G=e=>{!e.target.closest('button, a, [role="button"]')&&S.value&&S.value.focus()};return c(B,()=>{F.value=!1}),s({inputRef:S}),(l,s)=>(o(),r(C,{fluid:e.fluid,"has-pill":!!e.pill,"has-char-counter":!(!e.charCounter||!e.maxLength),orientation:e.orientation},{default:x(()=>[v("span",{class:i(t(j)),style:_(t(M)({color:e.color,variant:e.variant,theme:t($)})),"data-testid":e.testId},[e.label?(o(),r(k,{key:0,"css-prefix":I,"html-for":e.id,label:e.label,required:e.required,size:e.size},null,8,["html-for","label","required","size"])):f("",!0),v("span",{class:i([`${I}__input-container`,"--focus-within"]),onClick:G},[e.prefix&&![t(P).Color,t(P).File].includes(e.type)?(o(),r(A,{key:0,prefix:e.prefix,size:e.size,grouped:e.grouped,"border-radius":e.borderRadius,color:e.color,"on-click":e.onPrefixClick,"aria-label":e.prefixAriaLabel,disabled:e.disabled||e.busy},null,8,["prefix","size","grouped","border-radius","color","on-click","aria-label","disabled"])):f("",!0),v("span",{class:i(`${I}__input-border-control`)},[g(v("input",{id:e.id,ref:"input-elem","onUpdate:modelValue":s[0]||(s[0]=e=>B.value=e),name:e.name,"aria-label":e.ariaLabel,autocomplete:e.autoComplete?"on":"off",class:i(t(U)),disabled:e.disabled||e.busy,form:e.form,maxlength:e.maxLength,minlength:e.minLength,pattern:e.pattern,placeholder:e.placeholder,readonly:e.readonly,required:e.required,spellcheck:e.spellCheck,type:e.type,onBlur:s[1]||(s[1]=(...l)=>e.onBlur&&e.onBlur(...l)),onChange:s[2]||(s[2]=(...l)=>e.onChange&&e.onChange(...l)),onFocus:s[3]||(s[3]=(...l)=>e.onFocus&&e.onFocus(...l)),onInput:s[4]||(s[4]=(...l)=>e.onInput&&e.onInput(...l))},null,42,Q),[[h,B.value]])],2),e.type===t(P).Color?(o(),a("span",{key:1,class:i(`${I}__selected-color`)},n(B.value||"none"),3)):f("",!0),e.type===t(P).Color?(o(),r(J,{key:2,modelValue:B.value,"onUpdate:modelValue":s[5]||(s[5]=e=>B.value=e),copied:t(F),"onUpdate:copied":s[6]||(s[6]=e=>L(F)?F.value=e:null),"initial-value":t(T),size:e.size,onReset:O},null,8,["modelValue","copied","initial-value","size"])):f("",!0),e.suffix&&![t(P).Color,t(P).File].includes(e.type)?(o(),r(E,{key:3,suffix:e.suffix,size:e.size,grouped:e.grouped,"border-radius":e.borderRadius,color:e.color,"on-click":e.onSuffixClick,"aria-label":e.suffixAriaLabel,disabled:e.disabled||e.busy},null,8,["suffix","size","grouped","border-radius","color","on-click","aria-label","disabled"])):f("",!0),e.charCounter&&e.maxLength&&[t(P).Email,t(P).None,t(P).Text,t(P).Url].includes(e.type)?(o(),r(z,{key:4,color:e.color,"css-prefix":I,"current-length":B.value?B.value.toString().length:0,"max-length":e.maxLength,layout:t(w).Inline,size:e.size},null,8,["color","current-length","max-length","layout","size"])):f("",!0)],2)],14,K),e.pill&&e.label&&e.orientation===t(q).Horizontal?(o(),a("span",{key:0,class:i(`${I}__spacer`)},null,2)):f("",!0),e.pill?(o(),r(H,{key:1,label:e.pill,color:e.color},null,8,["label","color"])):f("",!0),e.id?(o(),r(X,{key:2,id:e.id,messages:e.messages,"message-type":e.messageType},null,8,["id","messages","message-type"])):f("",!0)]),_:1},8,["fluid","has-pill","has-char-counter","orientation"]))}});W.Prefix=A,W.Suffix=E,W.Pill=H,W.ColorTools=J;export{W as CLInput,W as default};
|
|
4
|
+
import{defineComponent as e,computed as l,createElementBlock as a,openBlock as o,normalizeClass as i,unref as t,createBlock as r,Fragment as s,createTextVNode as d,toDisplayString as n,createVNode as u,ref as p,watch as c,createCommentVNode as f,mergeModels as m,useTemplateRef as b,useModel as y,withCtx as x,createElementVNode as v,normalizeStyle as _,withDirectives as g,vModelDynamic as h,isRef as L}from"vue";import{_ as C,a as X}from"../../../chunks/CLInputMessages.vue_vue_type_style_index_0_lang-CtGriC2l.js";import{_ as k}from"../../../chunks/CLFormLabel.vue_vue_type_script_setup_true_lang-D7UZMu_6.js";import{_ as z}from"../../../chunks/CLFormCharCounter.vue_vue_type_style_index_0_lang-hB5Ua5Ta.js";import{_ as $}from"../../../chunks/CLIcon.vue_vue_type_style_index_0_lang-BN_rKLKK.js";import{_ as I}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{C as F,d as S,h as B,e as T,c as R,f as V}from"../../../chunks/index-DwjW-Z-U.js";import{_ as j}from"../../../chunks/CLPill.vue_vue_type_style_index_0_lang-mVxJKPLS.js";import{h as P,f as q,C as w}from"../../../chunks/index-C9S3C1LU.js";import{i as M}from"../../../chunks/utils-BDThP-Sb.js";import{useTheme as N}from"../../../composables/useTheme.js";const U=["data-testid"],A=/* @__PURE__ */e({name:"CLInputPrefix",__name:"CLInputPrefix",props:{ariaLabel:{default:void 0},borderRadius:{default:B.XS},color:{default:S.Neutral},disabled:{type:Boolean,default:!1},grouped:{type:Boolean,default:!1},onClick:{type:Function,default:void 0},prefix:{},size:{default:F.Small},testId:{default:"clll-input-prefix"}},setup(e){const u=e,p="clll-input",c=e=>Object.values(V).includes(e),f={[F.Tiny]:T.Tiny,[F.Small]:T.Small,[F.Medium]:T.Medium,[F.Large]:T.Large,[F.XL]:T.XL,[F.XXL]:T.XXL,[F.XXXL]:T.XXXL,[F.XXXXL]:T.XXXXL},m=l(()=>!!u.onClick&&c(u.prefix)),b=l(()=>{return[`${p}__input-prefix`,"form-addon-flex","form-addon-flex--left",c(u.prefix)?`${p}__input-prefix--icon form-addon-flex--icon`:`${p}__input-prefix--string form-addon-flex--string`,{"--interactive":m},{"--input-group":u.grouped||u.prefix},{"--disabled":u.disabled},u.grouped?`form-addon-radius--left-${e=u.borderRadius,e?.replace("rounded-","")||"xs"}`:""];var e}),y=e=>{u.onClick&&e&&!u.disabled&&(e.stopPropagation(),u.onClick(e))};return(l,u)=>(o(),a("div",{class:i(t(b))},[t(m)?(o(),r(t(I),{key:0,"aria-label":e.ariaLabel,"border-radius":e.borderRadius,color:e.color,disabled:e.disabled,"icon-before":e.prefix,"icon-size":f[e.size],"on-click":y,size:e.size,"test-id":e.testId,variant:t(R).Text,wrap:""},null,8,["aria-label","border-radius","color","disabled","icon-before","icon-size","size","test-id","variant"])):(o(),a("span",{key:1,class:"icon-container","data-testid":e.testId},[c(e.prefix)?(o(),r(t($),{key:0,name:e.prefix,size:f[e.size],color:e.color},null,8,["name","size","color"])):(o(),a(s,{key:1},[d(n(e.prefix),1)],64))],8,U))],2))}}),O=["data-testid"],E=/* @__PURE__ */e({name:"CLInputSuffix",__name:"CLInputSuffix",props:{ariaLabel:{default:void 0},borderRadius:{default:B.XS},color:{default:S.Neutral},disabled:{type:Boolean,default:!1},grouped:{type:Boolean,default:!1},onClick:{type:Function,default:void 0},suffix:{},size:{default:F.Small},testId:{default:"clll-input-suffix"}},setup(e){const u=e,p="clll-input",c=e=>Object.values(V).includes(e),f={[F.Tiny]:T.Tiny,[F.Small]:T.Small,[F.Medium]:T.Medium,[F.Large]:T.Large,[F.XL]:T.XL,[F.XXL]:T.XXL,[F.XXXL]:T.XXXL,[F.XXXXL]:T.XXXXL},m=l(()=>!!u.onClick&&c(u.suffix)),b=l(()=>{return[`${p}__input-suffix`,"form-addon-flex","form-addon-flex--right",c(u.suffix)?`${p}__input-suffix--icon form-addon-flex--icon`:`${p}__input-suffix--string form-addon-flex--string`,{"--interactive":m},{"--input-group":u.grouped||u.suffix},{"--disabled":u.disabled},u.grouped?`form-addon-radius--right-${e=u.borderRadius,e?.replace("rounded-","")||"xs"}`:""];var e}),y=e=>{u.onClick&&e&&!u.disabled&&(e.stopPropagation(),u.onClick(e))};return(l,u)=>(o(),a("div",{class:i(t(b))},[t(m)?(o(),r(t(I),{key:0,"aria-label":e.ariaLabel,"border-radius":e.borderRadius,color:e.color,disabled:e.disabled,"icon-before":e.suffix,"icon-size":f[e.size],"on-click":y,size:e.size,"test-id":e.testId,variant:t(R).Text,wrap:""},null,8,["aria-label","border-radius","color","disabled","icon-before","icon-size","size","test-id","variant"])):(o(),a("span",{key:1,class:"icon-container","data-testid":e.testId},[c(e.suffix)?(o(),r(t($),{key:0,name:e.suffix,size:f[e.size],color:e.color},null,8,["name","size","color"])):(o(),a(s,{key:1},[d(n(e.suffix),1)],64))],8,O))],2))}}),G=["data-testid"],H=/* @__PURE__ */e({name:"CLInputPill",__name:"CLInputPill",props:{color:{default:S.Neutral},label:{},testId:{default:"clll-input-pill"}},setup:e=>(l,r)=>(o(),a("span",{class:i("clll-input__pill"),"data-testid":e.testId},[u(t(j),{color:e.color,label:e.label,variant:t(R).Soft},null,8,["color","label","variant"])],10,G))}),D=["data-testid"],J=/* @__PURE__ */e({name:"CLInputColorTools",__name:"CLInputColorTools",props:{copied:{type:Boolean,default:!1},initialValue:{default:void 0},modelValue:{default:void 0},size:{default:F.Small},testId:{default:"clll-input-color-tools"}},emits:["copy","reset","update:copied"],setup(e,{emit:l}){const s=e,d=l,n="clll-input",u=p(s.copied),m={[F.Tiny]:T.Tiny,[F.Small]:T.Small,[F.Medium]:T.Medium,[F.Large]:T.Large,[F.XL]:T.XL,[F.XXL]:T.XXL,[F.XXXL]:T.XXXL,[F.XXXXL]:T.XXXXL},b=async()=>{try{s.modelValue&&(await navigator.clipboard.writeText(s.modelValue.toString()),u.value=!0,d("update:copied",!0),d("copy"))}catch(e){console.error(e)}},y=()=>{d("reset",s.initialValue)};return c(()=>s.copied,e=>{u.value=e}),c(()=>s.modelValue,()=>{u.value=!1,d("update:copied",!1)}),(l,s)=>(o(),a("span",{class:i(`${n}__selected-color-tools`),"data-testid":e.testId},[e.modelValue?(o(),r(t(I),{key:0,"aria-label":"Copy color to clipboard",class:i(`${n}__copy-to-clipboard`),color:t(S).Neutral,"icon-before":t(u)?t(V).Check:t(V).Copy,"icon-size":m[e.size],"on-click":b,size:e.size,title:t(u)?"Color copied to clipboard":"Copy color to clipboard",variant:t(R).Ghost,wrap:""},null,8,["class","color","icon-before","icon-size","size","title","variant"])):f("",!0),e.modelValue?(o(),r(t(I),{key:1,"aria-label":"Reset selected color",class:i(`${n}__reset-selected-color`),color:t(S).Neutral,"on-click":y,"icon-before":t(V).Restore,"icon-size":m[e.size],size:e.size,title:"Reset selected color",variant:t(R).Ghost,wrap:""},null,8,["class","color","icon-before","icon-size","size","variant"])):f("",!0)],10,D))}}),K=["data-testid"],Q=["id","name","aria-label","autocomplete","disabled","form","maxlength","minlength","pattern","placeholder","readonly","required","spellcheck","type"],W=/* @__PURE__ */e({name:"CLInput",__name:"CLInput",props:/* @__PURE__ */m({ariaLabel:{default:void 0},autoComplete:{type:Boolean,default:void 0},borderRadius:{default:void 0},busy:{type:Boolean,default:!1},charCounter:{type:Boolean,default:!1},color:{default:S.Neutral},disabled:{type:Boolean,default:!1},fluid:{type:Boolean,default:!1},form:{default:void 0},grouped:{type:Boolean,default:!1},id:{},label:{default:void 0},maxLength:{default:void 0},messages:{default:()=>[]},messageType:{default:void 0},minLength:{default:void 0},name:{},onBlur:{type:Function,default:void 0},onChange:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},onInput:{type:Function,default:void 0},onPrefixClick:{type:Function,default:void 0},onSuffixClick:{type:Function,default:void 0},orientation:{default:q.Vertical},pattern:{default:void 0},pill:{default:void 0},placeholder:{default:void 0},prefix:{default:void 0},prefixAriaLabel:{default:void 0},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},rounded:{type:Boolean,default:!0},size:{default:F.Small},spellCheck:{type:Boolean,default:void 0},suffix:{default:void 0},suffixAriaLabel:{default:void 0},testId:{default:"clll-input"},type:{default:P.Text},variant:{default:R.Outline}},{modelValue:{},modelModifiers:{}}),emits:/* @__PURE__ */m(["reset"],["update:modelValue"]),setup(e,{expose:s,emit:d}){const u=e,m=d,$=N(),I="clll-input",F=p(!1),S=b("input-elem"),B=y(e,"modelValue");u.type!==P.Color||B.value||(B.value="#FFFFFF");const T=B.value?.toString(),R=e=>Object.values(V).includes(e),j=l(()=>[I,u.borderRadius?`${I}--${u.borderRadius}`:"",u.busy?`${I}--busy`:`${I}--ready`,`${I}--${u.color}`,`${I}--${u.size}`,`${I}--${u.type}`,`${I}--${u.variant}`,u.disabled||u.busy?`${I}--disabled`:`${I}--active`,u.fluid||u.orientation===q.Horizontal?`${I}--fluid`:`${I}--fixed`,u.grouped?`${I}--grouped`:"",u.label?`${I}--haslabel`:"",u.messageType?`${I}--${u.messageType}`:"",u.orientation?`${I}--${u.orientation}`:"",u.pill?`${I}--haspill`:"",u.charCounter&&u.maxLength&&[P.Email,P.None,P.Text,P.Url].includes(u.type)?`${I}--hascharcounter`:"",u.prefix&&![P.Color,P.File].includes(u.type)?`${I}--hasprefix`:"",u.prefix&&![P.Color,P.File].includes(u.type)?R(u.prefix)?`${I}--hasiconprefix`:`${I}--hascustomprefix`:"",u.readonly?`${I}--readonly`:`${I}--writeable`,u.rounded?`${I}--rounded`:`${I}--box`,u.required?`${I}--required`:`${I}--optional`,u.suffix&&![P.Color,P.File].includes(u.type)?`${I}--hassuffix`:"",u.suffix&&![P.Color,P.File].includes(u.type)?R(u.suffix)?`${I}--hasiconsuffix`:`${I}--hascustomsuffix`:""]),U=l(()=>[`${I}__input`,{"--nocolor":u.type===P.Color&&!B.value},{"--input-group":u.grouped||u.prefix||u.suffix}]),O=e=>{B.value=e,m("reset",B.value)},G=e=>{!e.target.closest('button, a, [role="button"]')&&S.value&&S.value.focus()};return c(B,()=>{F.value=!1}),s({inputRef:S}),(l,s)=>(o(),r(C,{fluid:e.fluid,"has-pill":!!e.pill,"has-char-counter":!(!e.charCounter||!e.maxLength),orientation:e.orientation},{default:x(()=>[v("span",{class:i(t(j)),style:_(t(M)({color:e.color,variant:e.variant,theme:t($)})),"data-testid":e.testId},[e.label?(o(),r(k,{key:0,"css-prefix":I,"html-for":e.id,label:e.label,required:e.required,size:e.size},null,8,["html-for","label","required","size"])):f("",!0),v("span",{class:i([`${I}__input-container`,"--focus-within"]),onClick:G},[e.prefix&&![t(P).Color,t(P).File].includes(e.type)?(o(),r(A,{key:0,prefix:e.prefix,size:e.size,grouped:e.grouped,"border-radius":e.borderRadius,color:e.color,"on-click":e.onPrefixClick,"aria-label":e.prefixAriaLabel,disabled:e.disabled||e.busy},null,8,["prefix","size","grouped","border-radius","color","on-click","aria-label","disabled"])):f("",!0),v("span",{class:i(`${I}__input-border-control`)},[g(v("input",{id:e.id,ref:"input-elem","onUpdate:modelValue":s[0]||(s[0]=e=>B.value=e),name:e.name,"aria-label":e.ariaLabel,autocomplete:e.autoComplete?"on":"off",class:i(t(U)),disabled:e.disabled||e.busy,form:e.form,maxlength:e.maxLength,minlength:e.minLength,pattern:e.pattern,placeholder:e.placeholder,readonly:e.readonly,required:e.required,spellcheck:e.spellCheck,type:e.type,onBlur:s[1]||(s[1]=(...l)=>e.onBlur&&e.onBlur(...l)),onChange:s[2]||(s[2]=(...l)=>e.onChange&&e.onChange(...l)),onFocus:s[3]||(s[3]=(...l)=>e.onFocus&&e.onFocus(...l)),onInput:s[4]||(s[4]=(...l)=>e.onInput&&e.onInput(...l))},null,42,Q),[[h,B.value]])],2),e.type===t(P).Color?(o(),a("span",{key:1,class:i(`${I}__selected-color`)},n(B.value||"none"),3)):f("",!0),e.type===t(P).Color?(o(),r(J,{key:2,modelValue:B.value,"onUpdate:modelValue":s[5]||(s[5]=e=>B.value=e),copied:t(F),"onUpdate:copied":s[6]||(s[6]=e=>L(F)?F.value=e:null),"initial-value":t(T),size:e.size,onReset:O},null,8,["modelValue","copied","initial-value","size"])):f("",!0),e.suffix&&![t(P).Color,t(P).File].includes(e.type)?(o(),r(E,{key:3,suffix:e.suffix,size:e.size,grouped:e.grouped,"border-radius":e.borderRadius,color:e.color,"on-click":e.onSuffixClick,"aria-label":e.suffixAriaLabel,disabled:e.disabled||e.busy},null,8,["suffix","size","grouped","border-radius","color","on-click","aria-label","disabled"])):f("",!0),e.charCounter&&e.maxLength&&[t(P).Email,t(P).None,t(P).Text,t(P).Url].includes(e.type)?(o(),r(z,{key:4,color:e.color,"css-prefix":I,"current-length":B.value?B.value.toString().length:0,"max-length":e.maxLength,layout:t(w).Inline,size:e.size},null,8,["color","current-length","max-length","layout","size"])):f("",!0)],2)],14,K),e.pill&&e.label&&e.orientation===t(q).Horizontal?(o(),a("span",{key:0,class:i(`${I}__spacer`)},null,2)):f("",!0),e.pill?(o(),r(H,{key:1,label:e.pill,color:e.color},null,8,["label","color"])):f("",!0),e.id?(o(),r(X,{key:2,id:e.id,messages:e.messages,"message-type":e.messageType},null,8,["id","messages","message-type"])):f("",!0)]),_:1},8,["fluid","has-pill","has-char-counter","orientation"]))}});W.Prefix=A,W.Suffix=E,W.Pill=H,W.ColorTools=J;export{W as CLInput,W as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLInputDatePicker.css';
|
|
3
|
-
import{defineComponent as e,mergeModels as a,ref as l,useModel as t,watch as u,computed as n,onMounted as d,onBeforeUnmount as s,createElementBlock as o,openBlock as i,normalizeClass as r,createVNode as f,createCommentVNode as m,unref as p,isRef as c,normalizeStyle as v,withCtx as b,createElementVNode as y}from"vue";import{u as g,a as _,o as h,f as k,s as C}from"../../../chunks/floating-ui.vue-C0JWy0Dz.js";import{_ as D}from"../../../chunks/CLCard.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{defineComponent as e,mergeModels as a,ref as l,useModel as t,watch as u,computed as n,onMounted as d,onBeforeUnmount as s,createElementBlock as o,openBlock as i,normalizeClass as r,createVNode as f,createCommentVNode as m,unref as p,isRef as c,normalizeStyle as v,withCtx as b,createElementVNode as y}from"vue";import{u as g,a as _,o as h,f as k,s as C}from"../../../chunks/floating-ui.vue-C0JWy0Dz.js";import{_ as D}from"../../../chunks/CLCard.vue_vue_type_style_index_0_lang-D3JriMVx.js";import{CLInput as Y}from"../CLInput/CLInput.js";import{_ as R}from"../../../chunks/CLCalendar.vue_vue_type_style_index_0_lang-BsB4QKTu.js";import{f as I,c as L,n as V,C as x,d as M}from"../../../chunks/index-DwjW-Z-U.js";import{f as B}from"../../../chunks/index-C9S3C1LU.js";import{i as j}from"../../../chunks/helper-BlxFN3eF.js";import{useEsc as E}from"../../../composables/useEsc.js";import{useDateInputMask as F}from"../../../composables/useDateInputMask.js";const S=/* @__PURE__ */e({name:"CLInputDatePicker",__name:"CLInputDatePicker",props:/* @__PURE__ */a({ariaLabel:{default:void 0},borderRadius:{default:void 0},color:{default:M.Neutral},size:{default:x.Small},variant:{default:L.Outline},busy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fluid:{type:Boolean,default:!1},form:{default:void 0},id:{},isRange:{type:Boolean,default:!0},label:{default:void 0},messages:{default:()=>[]},messageType:{default:void 0},name:{},onBlur:{type:Function,default:void 0},onChange:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},orientation:{default:B.Vertical},placement:{default:V.BottomStart},placeholder:{default:void 0},required:{type:Boolean,default:!1},rounded:{type:Boolean,default:!0},testId:{default:"clll-input-date-picker"}},{modelValue:{default:()=>({end:null,start:null})},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=e,V="clll-input-date-picker",x=l(!1),M=l(),B=l(),S=l(),$=t(e,"modelValue"),z=l(""),{handleDateInput:w,isoToSlash:q,slashToISO:T,validateDate:O}=F();u($,()=>{const e=q($.value?.start??null),l=q($.value?.end??null);e?a.isRange&&l?z.value=`${e} - ${l}`:z.value=e:z.value=""},{immediate:!0,deep:!0});const P=n(()=>M.value?.$el),{floatingStyles:U}=g(P,S,{middleware:[h(8),k(),C()],placement:l(a.placement),whileElementsMounted:_,open:x}),G=()=>{a.disabled||a.busy||(x.value=!x.value,x.value?(a.onFocus?.(new FocusEvent("focus")),B.value?.initializeDraft()):a.onBlur?.(new FocusEvent("blur")))},H=n(()=>{const e=B.value?.draftStart,l=B.value?.draftEnd;return a.isRange?!!e&&!!l:!!e}),N=()=>{x.value&&(x.value=!1,a.onBlur?.(new FocusEvent("blur")))};E({escHandler:N});const A=e=>{const a=e.target,l=M.value?.$el,t=S.value;x.value&&l&&t&&!l.contains(a)&&!t.contains(a)&&N()},J=()=>{H.value&&(B.value?.apply(),N(),a.onChange?.())},K=e=>{const l=O(e,a.isRange),t=M.value?.inputRef;return t&&(e&&!l?t.setCustomValidity("Invalid date format. Use YYYY/MM/DD"):t.setCustomValidity("")),l},Q=e=>{e&&w(e,z,a.isRange,()=>{K(z.value)})},W=e=>{if(!e)return;const l=e.target.value,t=K(l);if(!l.trim())return $.value={start:null,end:null},void a.onChange?.();if(t){if(a.isRange){const[e,a]=l.split("-").map(e=>e.trim());$.value={start:T(e),end:T(a)}}else $.value={start:T(l.trim()),end:null};a.onChange?.()}};return d(()=>{j&&document.addEventListener("click",A)}),s(()=>{j&&document.removeEventListener("click",A)}),(a,l)=>(i(),o("div",{class:r([V,e.fluid?`${V}--fluid`:""])},[f(p(Y),{id:e.id,ref_key:"inputRef",ref:M,modelValue:p(z),"onUpdate:modelValue":l[0]||(l[0]=e=>c(z)?z.value=e:null),"aria-label":e.ariaLabel,"border-radius":e.borderRadius,busy:e.busy,color:e.color,disabled:e.disabled,fluid:e.fluid,form:e.form,label:e.label,messages:e.messages,"message-type":e.messageType,name:e.name,orientation:e.orientation,placeholder:e.placeholder||(e.isRange?"YYYY/MM/DD - YYYY/MM/DD":"YYYY/MM/DD"),required:e.required,rounded:e.rounded,size:e.size,suffix:p(I).Calendar,"suffix-aria-label":e.ariaLabel||"Open calendar","test-id":e.testId,variant:e.variant,onInput:Q,onChange:W,onSuffixClick:G},null,8,["id","modelValue","aria-label","border-radius","busy","color","disabled","fluid","form","label","messages","message-type","name","orientation","placeholder","required","rounded","size","suffix","suffix-aria-label","test-id","variant"]),p(x)?(i(),o("div",{key:0,ref_key:"popoverRef",ref:S,class:r(`${V}__popover`),style:v({...p(U),zIndex:100})},[f(p(D),{"border-radius":e.borderRadius,variant:p(L).Ghost,padded:!1,rounded:e.rounded,elevated:""},{default:b(()=>[y("div",{class:r(`${V}__calendar-container`)},[f(p(R),{ref_key:"calendarRef",ref:B,modelValue:$.value,"onUpdate:modelValue":l[1]||(l[1]=e=>$.value=e),disabled:e.disabled,busy:e.busy,"is-range":e.isRange,fluid:"",onDateSelect:J},null,8,["modelValue","disabled","busy","is-range"])],2)]),_:1},8,["border-radius","variant","rounded"])],6)):m("",!0)],2))}});export{S as CLInputDatePicker,S as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLInputTimePicker.css';
|
|
3
|
-
import{defineComponent as e,mergeModels as a,ref as l,useModel as t,watch as o,computed as u,onMounted as i,onBeforeUnmount as s,createElementBlock as r,openBlock as d,normalizeClass as n,createVNode as m,createCommentVNode as f,unref as c,normalizeStyle as p,withCtx as v,createElementVNode as b,createTextVNode as y}from"vue";import{u as _,a as h,o as k,f as C,s as g}from"../../../chunks/floating-ui.vue-C0JWy0Dz.js";import{_ as I}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{_ as L}from"../../../chunks/CLCard.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import{defineComponent as e,mergeModels as a,ref as l,useModel as t,watch as o,computed as u,onMounted as i,onBeforeUnmount as s,createElementBlock as r,openBlock as d,normalizeClass as n,createVNode as m,createCommentVNode as f,unref as c,normalizeStyle as p,withCtx as v,createElementVNode as b,createTextVNode as y}from"vue";import{u as _,a as h,o as k,f as C,s as g}from"../../../chunks/floating-ui.vue-C0JWy0Dz.js";import{_ as I}from"../../../chunks/CLButton.vue_vue_type_style_index_0_lang-hSiZPrZr.js";import{_ as L}from"../../../chunks/CLCard.vue_vue_type_style_index_0_lang-D3JriMVx.js";import{CLInput as z}from"../CLInput/CLInput.js";import{CLTimePicker as V}from"../CLTimePicker/CLTimePicker.js";import{f as x,c as B,C as H,d as j,n as R}from"../../../chunks/index-DwjW-Z-U.js";import{f as F}from"../../../chunks/index-C9S3C1LU.js";import{useEsc as T}from"../../../composables/useEsc.js";import{useTimeInputMask as P}from"../../../composables/useTimeInputMask.js";import{i as $}from"../../../chunks/helper-BlxFN3eF.js";const E=["data-testid"],M=/* @__PURE__ */e({name:"CLInputTimePicker",__name:"CLInputTimePicker",props:/* @__PURE__ */a({ariaLabel:{default:void 0},borderRadius:{default:void 0},color:{default:j.Neutral},size:{default:H.Small},variant:{default:B.Outline},busy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fluid:{type:Boolean,default:!1},form:{default:void 0},id:{},label:{default:void 0},messages:{default:()=>[]},messageType:{default:void 0},name:{},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:F.Vertical},placement:{default:R.BottomStart},placeholder:{default:void 0},required:{type:Boolean,default:!1},rounded:{type:Boolean,default:!0},testId:{default:"clll-input-time-picker"},use24Hour:{type:Boolean,default:!1}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=e,R="clll-input-time-picker",F=l(!1),M=l(),S=l(),w=l(),q=t(e,"modelValue"),U=l(""),{handleTimeInput:A,validateTime:G}=P();o(q,()=>{U.value=q.value??""},{immediate:!0});const N=u(()=>M.value?.$el),{floatingStyles:O}=_(N,w,{middleware:[k(8),C(),g()],placement:l(a.placement),whileElementsMounted:h,open:F}),D=()=>{a.disabled||a.busy||(F.value=!F.value,F.value?(a.onFocus?.(new FocusEvent("focus")),S.value?.initializeDraft()):a.onBlur?.(new FocusEvent("blur")))},J=()=>{F.value&&(F.value=!1,S.value?.cancel(),a.onBlur?.(new FocusEvent("blur")))};T({escHandler:J});const K=e=>{const a=e.target,l=M.value?.$el,t=w.value;F.value&&l&&t&&!l.contains(a)&&!t.contains(a)&&J()},Q=()=>{S.value?.apply(),F.value=!1,a.onChange?.()},W=()=>{S.value?.reset(),a.onReset?.(),a.onChange?.()},X=()=>{J()},Y=e=>{const l=G(e,a.use24Hour),t=M.value?.inputRef;return t&&(e&&!l?t.setCustomValidity(a.use24Hour?"Invalid format. Use HH:mm":"Invalid format. Use hh:mm AM/PM"):t.setCustomValidity("")),l},Z=e=>{e&&A(e,U,a.use24Hour,()=>{Y(U.value)})},ee=e=>{if(!e)return;const l=e.target.value,t=Y(l);if(!l.trim())return q.value=null,void a.onChange?.();t&&(q.value=l.trim(),a.onChange?.())};return i(()=>{$&&document.addEventListener("click",K)}),s(()=>{$&&document.removeEventListener("click",K)}),(a,l)=>(d(),r("div",{class:n([R,e.fluid?`${R}--fluid`:""]),"data-testid":e.testId},[m(c(z),{id:e.id,ref_key:"inputRef",ref:M,modelValue:U.value,"onUpdate:modelValue":l[0]||(l[0]=e=>U.value=e),"aria-label":e.ariaLabel,"border-radius":e.borderRadius,busy:e.busy,color:e.color,disabled:e.disabled,fluid:e.fluid,form:e.form,label:e.label,messages:e.messages,"message-type":e.messageType,name:e.name,orientation:e.orientation,placeholder:e.placeholder||(e.use24Hour?"HH:mm":"hh:mm AM/PM"),required:e.required,rounded:e.rounded,size:e.size,suffix:c(x).Clock,"suffix-aria-label":e.ariaLabel||"Open time picker","test-id":`${e.testId}__input`,variant:e.variant,onInput:Z,onChange:ee,onSuffixClick:D},null,8,["id","modelValue","aria-label","border-radius","busy","color","disabled","fluid","form","label","messages","message-type","name","orientation","placeholder","required","rounded","size","suffix","suffix-aria-label","test-id","variant"]),F.value?(d(),r("div",{key:0,ref_key:"popoverRef",ref:w,class:n(`${R}__popover`),style:p({...c(O),zIndex:100})},[m(c(L),{"border-radius":e.borderRadius,variant:c(B).Ghost,padded:!1,rounded:e.rounded,elevated:""},{default:v(()=>[b("div",{class:n(`${R}__container`)},[m(c(V),{ref_key:"timePickerRef",ref:S,modelValue:q.value,"onUpdate:modelValue":l[1]||(l[1]=e=>q.value=e),disabled:e.disabled,busy:e.busy,"use24-hour":e.use24Hour,fluid:""},null,8,["modelValue","disabled","busy","use24-hour"]),b("div",{class:n(`${R}__footer`)},[m(c(I),{color:c(j).Neutral,variant:c(B).Ghost,size:c(H).Small,onClick:X},{default:v(()=>[...l[2]||(l[2]=[y(" Cancel ",-1)])]),_:1},8,["color","variant","size"]),b("div",{class:n(`${R}__footer-right`)},[m(c(I),{color:c(j).Neutral,variant:c(B).Ghost,size:c(H).Small,onClick:W},{default:v(()=>[...l[3]||(l[3]=[y(" Reset ",-1)])]),_:1},8,["color","variant","size"]),m(c(I),{color:c(j).Primary,size:c(H).Small,onClick:Q},{default:v(()=>[...l[4]||(l[4]=[y(" Apply ",-1)])]),_:1},8,["color","size"])],2)],2)],2)]),_:1},8,["border-radius","variant","rounded"])],6)):f("",!0)],10,E))}});export{M as CLInputTimePicker,M as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLRadioButton.css';
|
|
3
3
|
import '../../../assets/shared/form-utilities.css';
|
|
4
|
-
import{defineComponent as e,mergeModels as a,useModel as l,useTemplateRef as s,computed as o,createBlock as d,openBlock as t,withCtx as r,createElementVNode as u,createCommentVNode as n,normalizeStyle as i,normalizeClass as m,unref as c,withDirectives as p,vModelRadio as b,createTextVNode as _,toDisplayString as y}from"vue";import{_ as f,a as $}from"../../../chunks/CLInputMessages.vue_vue_type_style_index_0_lang-
|
|
4
|
+
import{defineComponent as e,mergeModels as a,useModel as l,useTemplateRef as s,computed as o,createBlock as d,openBlock as t,withCtx as r,createElementVNode as u,createCommentVNode as n,normalizeStyle as i,normalizeClass as m,unref as c,withDirectives as p,vModelRadio as b,createTextVNode as _,toDisplayString as y}from"vue";import{_ as f,a as $}from"../../../chunks/CLInputMessages.vue_vue_type_style_index_0_lang-CtGriC2l.js";import{_ as g}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-BZQzsJMF.js";import{C as X,a as v,c as L,d as h}from"../../../chunks/index-DwjW-Z-U.js";import{a as B}from"../../../chunks/utils-BDThP-Sb.js";import{useTheme as k}from"../../../composables/useTheme.js";const C=["data-testid"],q=["for"],x=["id","aria-label","checked","disabled","name","value","required"],R=/* @__PURE__ */e({name:"CLRadioButton",__name:"CLRadioButton",props:/* @__PURE__ */a({ariaLabel:{},borderRadius:{},busy:{type:Boolean},checked:{type:Boolean},color:{default:h.Neutral},disabled:{type:Boolean},form:{},id:{},label:{},messages:{},messageType:{},name:{},required:{type:Boolean},rounded:{type:Boolean,default:!0},size:{default:X.Small},testId:{default:"clll-radiobutton"},value:{type:[String,Number,Boolean]},variant:{default:L.Outline},onBlur:{},onChange:{},onFocus:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e,{expose:a}){const L={[X.Tiny]:v.Small,[X.Small]:v.Medium,[X.Medium]:v.Medium,[X.Large]:v.Large,[X.XL]:v.XL,[X.XXL]:v.XXL,[X.XXXL]:v.XXXL,[X.XXXXL]:v.XXXXL},h=e,R=k(),T="clll-radiobutton",j=l(e,"modelValue"),M=s("radiobutton-ref"),F=()=>{M.value&&M.value.focus()},S=o(()=>[T,h.borderRadius?`${T}--${h.borderRadius}`:"",h.busy?`${T}--busy`:`${T}--ready`,`${T}--${h.color}`,`${T}--${h.size}`,h.disabled?`${T}--disabled`:`${T}--active`,h.label?`${T}--haslabel`:"",h.messageType?`${T}--${h.messageType}`:"",h.rounded?`${T}--rounded`:`${T}--box`,h.required?`${T}--required`:`${T}--optional`]),V=o(()=>[`${T}__radiobutton-container`,`${T}--${h.variant}`]);return a({radiobuttonRef:M}),(a,l)=>(t(),d(f,null,{default:r(()=>[u("span",{class:m(c(S)),style:i(c(B)({color:e.color,variant:e.variant,theme:c(R)})),"data-testid":e.testId},[u("span",{class:m(c(V)),onClick:F},[u("label",{for:e.id,class:m(`${T}__label`)},[u("span",{class:m([`${T}__radiobutton-frame`,"form-control-flex"])},[p(u("input",{id:e.id,ref:"radiobutton-ref","onUpdate:modelValue":l[0]||(l[0]=e=>j.value=e),"aria-label":e.ariaLabel,class:m(`${T}__radiobutton`),checked:e.checked,disabled:e.disabled||e.busy,name:e.name,value:e.value,required:e.required,type:"radio",onBlur:l[1]||(l[1]=(...a)=>e.onBlur&&e.onBlur(...a)),onChange:l[2]||(l[2]=(...a)=>e.onChange&&e.onChange(...a)),onFocus:l[3]||(l[3]=(...a)=>e.onFocus&&e.onFocus(...a))},null,42,x),[[b,j.value]]),u("span",{class:m(`${T}__indicator`)},null,2)],2),e.label?(t(),d(c(g),{key:0,as:"span",type:L[e.size],class:m(e.required?`${T}__label--required`:"")},{default:r(()=>[_(y(e.label),1)]),_:1},8,["type","class"])):n("",!0)],10,q)],2)],14,C),e.id?(t(),d($,{key:0,id:e.id,messages:e.messages,"message-type":e.messageType},null,8,["id","messages","message-type"])):n("",!0)]),_:1}))}});export{R as CLRadioButton,R as default};
|