@oneclick.dev/cms-core-modules 0.0.53 → 0.0.55
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/CalendarDate-CRT2Viyt.mjs +830 -0
- package/dist/CalendarDate-CWtpXgpD.js +1 -0
- package/dist/Components-D9yIIosM.mjs +623 -0
- package/dist/Components-DXbx0RLV.js +1 -0
- package/dist/ContentEditor-BBdzuTJJ.js +290 -0
- package/dist/ContentEditor-HwHspQO1.mjs +35302 -0
- package/dist/Create-BP8TX6rj.js +1 -0
- package/dist/Create-Bwf1RXdG.mjs +1248 -0
- package/dist/DateFormatter-BbcSwTs4.js +1 -0
- package/dist/DateFormatter-CbO0PVUK.mjs +99 -0
- package/dist/Detail-B-PnkcXD.mjs +3473 -0
- package/dist/Detail-BVlGSjOq.mjs +380 -0
- package/dist/Detail-C4E1T87K.mjs +26 -0
- package/dist/Detail-CNfTDUE5.js +1 -0
- package/dist/Detail-Cd5CBVN0.js +1 -0
- package/dist/Detail-CpfOQChd.mjs +585 -0
- package/dist/Detail-CwagT6gQ.mjs +650 -0
- package/dist/Detail-DUo6qKqO.js +1 -0
- package/dist/Detail-Dd_OkpcN.js +1 -0
- package/dist/Detail-mvSGbnFU.js +1 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-BWuKVkvV.js +1 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs +55 -0
- package/dist/Entries-DcpPvlYj.js +1 -0
- package/dist/Entries-QLMtTYLX.mjs +713 -0
- package/dist/Find-BPR0uU-Z.mjs +229 -0
- package/dist/Find-BidEQJxT.js +1 -0
- package/dist/GlobalStyling-BLQ_1W2y.mjs +1588 -0
- package/dist/GlobalStyling-CnSlXkZc.js +25 -0
- package/dist/Overview-BDlBCUI_.js +1 -0
- package/dist/Overview-BH3NwvNX.mjs +26 -0
- package/dist/Overview-BLsZMHNW.mjs +178 -0
- package/dist/Overview-BNMZ9MUK.js +1 -0
- package/dist/Overview-BbvfH1u-.js +1 -0
- package/dist/Overview-CDN88OSM.mjs +190 -0
- package/dist/Overview-CEPodGCn.mjs +311 -0
- package/dist/Overview-CvquDPhB.js +1 -0
- package/dist/Overview-D54pjmI6.mjs +633 -0
- package/dist/Overview-D67UjG6n.mjs +947 -0
- package/dist/Overview-KT2Mgfh5.js +1 -0
- package/dist/Overview-T-lsy3UZ.js +1 -0
- package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-0xZSq0rx.js +1 -0
- package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-Bj_PVLLV.mjs +392 -0
- package/dist/TableView-CpO53xcX.js +111 -0
- package/dist/TableView-D9J5rUls.mjs +72921 -0
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +1 -0
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-BiLAkhIA.mjs +40 -0
- package/dist/View-DlHBZbFu.js +1 -0
- package/dist/View-Dv5QMrSn.mjs +25 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/dist/agenda-B49oKGeh.mjs +706 -0
- package/dist/agenda-DipQ5IWP.js +1 -0
- package/dist/availability-C7q9tq6l.js +1 -0
- package/dist/availability-DeCkqiu8.mjs +613 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/countries-BTPvmrsb.mjs +4 -0
- package/dist/countries-CgZ081No.js +1 -0
- package/dist/exceptions-D3b18TiY.mjs +647 -0
- package/dist/exceptions-DJ9zWX3k.js +1 -0
- package/dist/floating-ui.dom-C82nbomj.js +1 -0
- package/dist/floating-ui.dom-ouSgPqty.mjs +1133 -0
- package/dist/google-CvtuJwgk.mjs +4 -0
- package/dist/google-D4N3gb01.js +1 -0
- package/dist/index--jjEzba7.mjs +24 -0
- package/dist/index-9HVlmvK3.js +1 -0
- package/dist/index-BEGU8Kme.mjs +12 -0
- package/dist/index-Bwi1mtkq.mjs +24 -0
- package/dist/index-BzuHN-r8.mjs +24 -0
- package/dist/index-CImCyE3L.mjs +24 -0
- package/dist/index-CKPshlZ8-BQiiP6r_.mjs +1264 -0
- package/dist/index-CKPshlZ8-CIz1tDwX.js +1 -0
- package/dist/index-CQiY-oTN.mjs +24 -0
- package/dist/index-CSxYBeVA.js +1 -0
- package/dist/index-CkiNvRzs.js +1 -0
- package/dist/index-Co4ON2Di.js +1 -0
- package/dist/index-CwqrAU-H.js +1 -0
- package/dist/index-Cz-baGax.js +1 -0
- package/dist/index-D2a6wEPh.js +1 -0
- package/dist/index-DFQGVHTs.js +1 -0
- package/dist/index-DI6mydpm.mjs +138 -0
- package/dist/index-DMoyoaks.mjs +22 -0
- package/dist/index-DT1wWnUk.mjs +24 -0
- package/dist/index-DUeFrD-B.js +1 -0
- package/dist/index-DsnoK4ia.mjs +579 -0
- package/dist/index-R2oUDsjx.js +1 -0
- package/dist/index-RLz1QPrf.mjs +203 -0
- package/dist/index-UtjLbLw-.js +1 -0
- package/dist/index-_mG-aU3Z.mjs +87 -0
- package/dist/index-_sQDF1pH.js +1 -0
- package/dist/index-ijdf0d9-.js +1 -0
- package/dist/index-klI238nT.mjs +24 -0
- package/dist/index.cjs.js +1 -330
- package/dist/index.mjs +287 -69051
- package/dist/interpolation-BNUjI7LH.js +1 -0
- package/dist/interpolation-BpGXqOz8.mjs +59 -0
- package/dist/payment-kTjsV0Jj.js +1 -0
- package/dist/payment-zpCM0LD-.mjs +981 -0
- package/dist/regular-C4_3YXqx.mjs +602 -0
- package/dist/regular-DFwPEbZO.js +1 -0
- package/dist/regular-slots-4ooEpICB.mjs +67 -0
- package/dist/regular-slots-BAVGbomI.js +1 -0
- package/dist/resources-MpQkSstv.mjs +563 -0
- package/dist/resources-iM28T3dD.js +1 -0
- package/dist/src/appointments/index.d.ts +4 -28
- package/dist/src/appointments/routes.d.ts +3 -9
- package/dist/src/content-manager/components/content-editor/ContentLayout.vue.d.ts +8 -0
- package/dist/src/content-manager/components/content-editor/NewSectionDialog.vue.d.ts +5 -1
- package/dist/src/content-manager/components/content-editor/tiptap-extensions/Card.d.ts +6 -0
- package/dist/src/content-manager/components/content-editor/tiptap-extensions/ScopedSelectAll.d.ts +7 -0
- package/dist/src/content-manager/components/content-editor/tiptap-menus/NewNodeView.vue.d.ts +16 -2
- package/dist/src/content-manager/components/content-editor/tiptap-menus/element-editor-views/CardMenu.vue.d.ts +13 -0
- package/dist/src/content-manager/components/content-editor/tiptap-menus/element-editor-views/index.d.ts +14 -0
- package/dist/src/content-manager/components/styling/ButtonStyleDialog.vue.d.ts +7 -7
- package/dist/src/content-manager/components/styling/CardStyleDialog.vue.d.ts +24 -0
- package/dist/src/content-manager/index.d.ts +5 -147
- package/dist/src/content-manager/pages/GlobalStyling.vue.d.ts +46 -8
- package/dist/src/content-manager/routes.d.ts +4 -128
- package/dist/src/custom/index.d.ts +2 -2
- package/dist/src/custom/routes.d.ts +1 -1
- package/dist/src/mail-templates/index.d.ts +2 -30
- package/dist/src/mail-templates/routes.d.ts +1 -11
- package/dist/src/product-collections/index.d.ts +2 -30
- package/dist/src/product-collections/routes.d.ts +1 -11
- package/dist/src/products/index.d.ts +2 -30
- package/dist/src/products/routes.d.ts +1 -11
- package/dist/src/promo-codes/index.d.ts +2 -30
- package/dist/src/promo-codes/routes.d.ts +1 -11
- package/dist/src/shipping-options/index.d.ts +2 -30
- package/dist/src/shipping-options/routes.d.ts +1 -11
- package/dist/src/table/index.d.ts +2 -70
- package/dist/src/table/routes.d.ts +1 -51
- package/dist/utils-BVKy9S2J.mjs +29 -0
- package/dist/utils-D6CaKJbp.js +2 -0
- package/dist/vee-validate-zod-BPQyEfpF.js +1 -0
- package/dist/vee-validate-zod-IXkfh-6Q.mjs +4402 -0
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),_=require("lucide-vue-next"),N=require("@oneclick.dev/cms-kit"),re=require("./interpolation-BNUjI7LH.js"),P=require("./index-ijdf0d9-.js"),ie={class:"grid @lg:grid-cols-2 @2xl:grid-cols-3 @4xl:grid-cols-4 @7xl:grid-cols-5 gap-4"},ue={class:"relative flex pl-3 @5xl:pl-6 pr-1.5 @5xl:pr-3 gap-3"},de={class:"self-center overflow-hidden w-full group-hover:w-[calc(100%-6.5rem)]"},ce=["title"],me=["title"],pe={class:"absolute -top-1 right-2 self-start opacity-0 group-hover:opacity-100"},ve=e.defineComponent({__name:"CollectionsGridView",props:{collections:{type:Array,required:!0}},emits:["edit","delete"],setup(w,{emit:f}){const{navigateTo:y}=N.useModuleRoute(),k=f;return(S,u)=>{const b=e.resolveComponent("Button"),c=e.resolveComponent("DropdownMenuTrigger"),r=e.resolveComponent("DropdownMenuItem"),g=e.resolveComponent("DropdownMenuContent"),v=e.resolveComponent("DropdownMenu"),m=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.collections,a=>(e.openBlock(),e.createBlock(m,{key:a.id,class:"group hover:bg-input/50 cursor-pointer transition-colors duration-200",onClick:p=>e.unref(y)("collections/"+a.id)},{default:e.withCtx(()=>[e.createElementVNode("div",ue,[e.createElementVNode("div",{class:e.normalizeClass(`p-2 bg-${a.tint} rounded-md self-center mr-3`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(_.icons)[a.icon]),{class:"size-6 text-white"}))],2),e.createElementVNode("div",de,[e.createElementVNode("p",{class:"truncate",title:a.name||"Unnamed Entry Collection"},e.toDisplayString(a.name||"Unnamed Entry Collection"),9,ce),a.contentEntryName||a.contentEntryNamePlural?(e.openBlock(),e.createElementBlock("p",{key:0,class:"text-xs text-muted-foreground truncate",title:`Manage ${a.contentEntryNamePlural||a.contentEntryName} here`}," Manage "+e.toDisplayString(a.contentEntryNamePlural||a.contentEntryName)+" here ",9,me)):e.createCommentVNode("",!0)]),e.createElementVNode("div",pe,[e.createVNode(v,null,{default:e.withCtx(()=>[e.createVNode(c,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(b,{variant:"ghost",size:"icon",onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createVNode(e.unref(_.EllipsisVertical),{class:"size-5"})]),_:1})]),_:1}),e.createVNode(g,null,{default:e.withCtx(()=>[e.createVNode(r,{onClick:p=>e.unref(y)("collections/"+a.id)},{default:e.withCtx(()=>[...u[1]||(u[1]=[e.createTextVNode("Open Collection...",-1)])]),_:1},8,["onClick"]),e.createVNode(r,{onClick:p=>k("edit",a)},{default:e.withCtx(()=>[...u[2]||(u[2]=[e.createTextVNode("Edit Collection...",-1)])]),_:1},8,["onClick"]),e.createVNode(r,{onClick:p=>k("delete",a.id),variant:"destructive"},{default:e.withCtx(()=>[...u[3]||(u[3]=[e.createTextVNode("Delete Collection...",-1)])]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)])])]),_:2},1032,["onClick"]))),128))])}}}),fe={class:"grid py-4"},ge={class:"flex gap-6 mb-6"},Ve={class:"w-1/3"},Ce={class:"w-1/3"},xe={class:"w-1/3"},Ne={class:"grid"},we={class:"flex gap-6 mb-6"},ye={class:"w-1/2"},ke={class:"w-1/2"},Ee={class:"flex items-center gap-2"},_e={class:"flex items-center gap-4"},be={class:"grid grid-cols-2 gap-4"},Te={class:"grid"},Be={class:"mb-6"},Se={class:"flex items-center justify-between gap-4 flex-wrap"},De={key:0,class:"text-xs italic text-muted-foreground mt-1"},Pe={class:"flex items-center justify-between gap-4 flex-wrap"},Me={key:0,class:"text-xs italic text-muted-foreground mt-1"},$e=e.defineComponent({__name:"CollectionDialog",props:{config:{type:Object,required:!0},components:{type:Array,required:!0}},emits:["add","edit","delete"],setup(w,{expose:f,emit:y}){const k=[{name:"id",type:"string"},{name:"slug",type:"string"},{name:"lang",type:"string"}],{confirm:S}=N.useConfirmation(),u=y,b=w,c=e.ref(!1),r=e.ref("create"),g=e.ref(""),v=e.ref(""),m=e.ref(""),a=e.ref(""),p=e.ref(""),x=e.ref(""),V=e.ref(!0),n=e.ref(!1),o=e.ref(null),i=e.ref("{{ slug }}"),d=e.ref("/{{ lang }}/{{ slug }}"),C=e.ref("all"),E=e.ref([]),U=e.computed(()=>R(i.value)),h=e.computed(()=>R(d.value));function R(s){if(!s)return"";let t=b.config.domain||"https://domain.com";return t.endsWith("/")&&(t=t.slice(0,-1)),s.startsWith("/")||(s="/"+s),re.interpolateTemplateFromVariableContext(t+s,[{name:"slug",value:"example-slug"},{name:"id",value:"12345"},{name:"lang",value:"en"}])}const j=s=>{s?(r.value="edit",g.value=s.id,v.value=s.name||"",m.value=s.tint||"",a.value=s.icon||"",p.value=s.contentEntryName||"",x.value=s.contentEntryNamePlural||"",V.value=s.allowUserEntryManagement??!0,n.value=!!s.customSettings,o.value=s.customSettings||null,i.value=s.defaultLanguageRoutePattern||"{{ slug }}",d.value=s.multilingualRoutePattern||"/{{ lang }}/{{ slug }}",C.value=s.componentAvailability||"all",E.value=s.selectedComponents||[]):(r.value="create",g.value="",v.value="",m.value="",a.value="",p.value="",x.value="",V.value=!0,n.value=!1,o.value=null,i.value="{{ slug }}",d.value="/{{ lang }}/{{ slug }}",C.value="all",E.value=[]),c.value=!0},G=()=>{u("add",{name:v.value,tint:m.value,icon:a.value,contentEntryName:p.value,contentEntryNamePlural:x.value,allowUserEntryManagement:V.value,showCustomSettings:n.value,customSettings:n.value?o.value:null,defaultLanguageRoutePattern:i.value,multilingualRoutePattern:d.value,componentAvailability:C.value,selectedComponents:C.value==="all"?[]:E.value}),c.value=!1},W=()=>{u("edit",{id:g.value,name:v.value,tint:m.value,icon:a.value,contentEntryName:p.value,contentEntryNamePlural:x.value,allowUserEntryManagement:V.value,showCustomSettings:n.value,customSettings:n.value?o.value:null,defaultLanguageRoutePattern:i.value,multilingualRoutePattern:d.value,componentAvailability:C.value,selectedComponents:C.value==="all"?[]:E.value}),c.value=!1},H=async()=>{await S("Are you sure you want to delete this collection? This action cannot be undone.","Delete Collection","Delete")&&(u("delete",g.value),c.value=!1)};return f({openDialog:j}),(s,t)=>{const K=e.resolveComponent("DialogTitle"),J=e.resolveComponent("DialogDescription"),Q=e.resolveComponent("DialogHeader"),T=e.resolveComponent("TabsTrigger"),X=e.resolveComponent("TabsList"),M=e.resolveComponent("Input"),Y=e.resolveComponent("TailwindColorPicker"),Z=e.resolveComponent("LucideIconPicker"),B=e.resolveComponent("TabsContent"),ee=e.resolveComponent("Checkbox"),A=e.resolveComponent("Label"),te=e.resolveComponent("Switch"),oe=e.resolveComponent("FormBuilderSelect"),L=e.resolveComponent("SelectValue"),I=e.resolveComponent("SelectTrigger"),D=e.resolveComponent("SelectItem"),F=e.resolveComponent("SelectGroup"),q=e.resolveComponent("SelectContent"),z=e.resolveComponent("Select"),O=e.resolveComponent("Sandbox"),le=e.resolveComponent("Tabs"),$=e.resolveComponent("Button"),ne=e.resolveComponent("DialogFooter"),ae=e.resolveComponent("DialogScrollContent"),se=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(se,{open:c.value,"onUpdate:open":t[12]||(t[12]=l=>c.value=l)},{default:e.withCtx(()=>[e.createVNode(ae,{class:"sm:max-w-2xl"},{default:e.withCtx(()=>[e.createVNode(Q,null,{default:e.withCtx(()=>[e.createVNode(K,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value==="create"?"Add New Collection":"Update Collection"),1)]),_:1}),e.createVNode(J,null,{default:e.withCtx(()=>[...t[13]||(t[13]=[e.createTextVNode(" Each collection has it's own set of entries, settings, ... ",-1)])]),_:1})]),_:1}),e.createElementVNode("div",fe,[e.createVNode(le,{"default-value":"account",class:"w-full"},{default:e.withCtx(()=>[e.createVNode(X,{class:"mb-6"},{default:e.withCtx(()=>[e.createVNode(T,{value:"collection"},{default:e.withCtx(()=>[...t[14]||(t[14]=[e.createTextVNode(" Collection ",-1)])]),_:1}),e.createVNode(T,{value:"entries"},{default:e.withCtx(()=>[...t[15]||(t[15]=[e.createTextVNode(" Entries ",-1)])]),_:1}),e.createVNode(T,{value:"components"},{default:e.withCtx(()=>[...t[16]||(t[16]=[e.createTextVNode(" Components ",-1)])]),_:1}),e.createVNode(T,{value:"styling"},{default:e.withCtx(()=>[...t[17]||(t[17]=[e.createTextVNode(" Styling ",-1)])]),_:1}),e.createVNode(T,{value:"preview"},{default:e.withCtx(()=>[...t[18]||(t[18]=[e.createTextVNode(" Preview URL ",-1)])]),_:1})]),_:1}),e.createVNode(B,{value:"collection"},{default:e.withCtx(()=>[e.createElementVNode("div",ge,[e.createElementVNode("div",Ve,[t[19]||(t[19]=e.createElementVNode("label",{for:"collection-dialog-display-name",class:"text-sm mb-1 block font-medium"},"Collection Name",-1)),e.createVNode(M,{modelValue:v.value,"onUpdate:modelValue":t[0]||(t[0]=l=>v.value=l),id:"collection-dialog-display-name"},null,8,["modelValue"])]),e.createElementVNode("div",Ce,[t[20]||(t[20]=e.createElementVNode("label",{class:"text-sm mb-1 block font-medium"},"Tint",-1)),e.createVNode(Y,{modelValue:m.value,"onUpdate:modelValue":t[1]||(t[1]=l=>m.value=l),"default-value":"white"},null,8,["modelValue"])]),e.createElementVNode("div",xe,[t[21]||(t[21]=e.createElementVNode("label",{class:"text-sm mb-1 block font-medium"},"Icon",-1)),e.createVNode(Z,{modelValue:a.value,"onUpdate:modelValue":t[2]||(t[2]=l=>a.value=l)},null,8,["modelValue"])])])]),_:1}),e.createVNode(B,{value:"entries"},{default:e.withCtx(()=>[e.createElementVNode("div",Ne,[t[26]||(t[26]=e.createElementVNode("p",{class:"text-sm mb-1 block font-medium"}," Entries ",-1)),e.createElementVNode("div",we,[e.createElementVNode("div",ye,[t[22]||(t[22]=e.createElementVNode("label",{for:"collection-dialog-entry-name",class:"text-sm mb-1 block font-medium"},"Entry name (singular)",-1)),e.createVNode(M,{modelValue:p.value,"onUpdate:modelValue":t[3]||(t[3]=l=>p.value=l),id:"collection-dialog-entry-name",placeholder:"Entry"},null,8,["modelValue"])]),e.createElementVNode("div",ke,[t[23]||(t[23]=e.createElementVNode("label",{for:"collection-dialog-entry-name-plural",class:"text-sm mb-1 block font-medium"},"Entry name (plural)",-1)),e.createVNode(M,{modelValue:x.value,"onUpdate:modelValue":t[4]||(t[4]=l=>x.value=l),id:"collection-dialog-entry-name-plural",placeholder:"Entries"},null,8,["modelValue"])])]),e.createElementVNode("div",Ee,[e.createVNode(ee,{modelValue:V.value,"onUpdate:modelValue":t[5]||(t[5]=l=>V.value=l),id:"collection-dialog-allow-user-entry-management"},null,8,["modelValue"]),e.createVNode(A,{for:"collection-dialog-allow-user-entry-management"},{default:e.withCtx(()=>[...t[24]||(t[24]=[e.createTextVNode("Allow users to create, edit and delete entries in this collection",-1)])]),_:1})]),t[27]||(t[27]=e.createElementVNode("hr",{class:"my-6"},null,-1)),t[28]||(t[28]=e.createElementVNode("p",{class:"text-sm mb-1 block font-medium"}," Entry Custom Settings ",-1)),t[29]||(t[29]=e.createElementVNode("p",{class:"text-xs mb-2 text-muted-foreground"}," Specific settings all entries in this collection can edit. ",-1)),e.createElementVNode("div",_e,[e.createVNode(te,{modelValue:n.value,"onUpdate:modelValue":t[6]||(t[6]=l=>n.value=l),id:"collection-dialog-component-settings-toggle",class:"mb-4"},null,8,["modelValue"]),e.createVNode(A,{class:"-mt-3.5",for:"collection-dialog-component-settings-toggle"},{default:e.withCtx(()=>[...t[25]||(t[25]=[e.createTextVNode(" Show settings form for this collection's entries. ",-1)])]),_:1})]),n.value?(e.openBlock(),e.createBlock(oe,{key:0,modelValue:o.value,"onUpdate:modelValue":t[7]||(t[7]=l=>o.value=l),class:"w-1/2"},null,8,["modelValue"])):e.createCommentVNode("",!0)])]),_:1}),e.createVNode(B,{value:"components"},{default:e.withCtx(()=>[t[33]||(t[33]=e.createElementVNode("p",{class:"text-sm mb-1 block font-medium"}," Available Components ",-1)),e.createElementVNode("div",be,[e.createVNode(z,{modelValue:C.value,"onUpdate:modelValue":t[8]||(t[8]=l=>C.value=l)},{default:e.withCtx(()=>[e.createVNode(I,{class:"w-full"},{default:e.withCtx(()=>[e.createVNode(L)]),_:1}),e.createVNode(q,null,{default:e.withCtx(()=>[e.createVNode(F,null,{default:e.withCtx(()=>[e.createVNode(D,{value:"all"},{default:e.withCtx(()=>[...t[30]||(t[30]=[e.createTextVNode(" All ",-1)])]),_:1}),e.createVNode(D,{value:"all-except"},{default:e.withCtx(()=>[...t[31]||(t[31]=[e.createTextVNode(" All, except... ",-1)])]),_:1}),e.createVNode(D,{value:"only"},{default:e.withCtx(()=>[...t[32]||(t[32]=[e.createTextVNode(" Only... ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),C.value!=="all"?(e.openBlock(),e.createBlock(z,{key:0,multiple:!0,modelValue:E.value,"onUpdate:modelValue":t[9]||(t[9]=l=>E.value=l)},{default:e.withCtx(()=>[e.createVNode(I,{class:"w-full"},{default:e.withCtx(()=>[e.createVNode(L,{placeholder:"Select components..."})]),_:1}),e.createVNode(q,null,{default:e.withCtx(()=>[e.createVNode(F,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.components,l=>(e.openBlock(),e.createBlock(D,{key:l.id,value:l.id},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(`p-1 bg-${l.tint} rounded-md flex items-center justify-center`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(_.icons)[l.icon]),{class:"size-4 text-white"}))],2),e.createTextVNode(" "+e.toDisplayString(l.name),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["modelValue"])):e.createCommentVNode("",!0)])]),_:1}),e.createVNode(B,{value:"styling"},{default:e.withCtx(()=>[...t[34]||(t[34]=[e.createTextVNode(" Styling ",-1)])]),_:1}),e.createVNode(B,{value:"preview"},{default:e.withCtx(()=>[e.createElementVNode("div",Te,[t[37]||(t[37]=e.createElementVNode("p",{class:"text-sm mb-1 block font-medium"}," Preview URL ",-1)),e.createElementVNode("div",Be,[e.createElementVNode("div",Se,[t[35]||(t[35]=e.createElementVNode("label",{class:"text-sm basis-[200px] block font-medium"},"Default Language Route",-1)),e.createVNode(O,{modelValue:i.value,"onUpdate:modelValue":t[10]||(t[10]=l=>i.value=l),variables:k,class:"flex-1"},null,8,["modelValue"])]),U.value?(e.openBlock(),e.createElementBlock("p",De,"Example: "+e.toDisplayString(U.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createElementVNode("div",Pe,[t[36]||(t[36]=e.createElementVNode("label",{class:"text-sm basis-[200px] block font-medium"},"Multilingual Route",-1)),e.createVNode(O,{modelValue:d.value,"onUpdate:modelValue":t[11]||(t[11]=l=>d.value=l),variables:k,class:"flex-1"},null,8,["modelValue"])]),h.value?(e.openBlock(),e.createElementBlock("p",Me,"Example: "+e.toDisplayString(h.value),1)):e.createCommentVNode("",!0)])])]),_:1})]),_:1})]),e.createVNode(ne,null,{default:e.withCtx(()=>[r.value==="edit"?(e.openBlock(),e.createBlock($,{key:0,variant:"destructive",class:"mr-auto",onClick:H},{default:e.withCtx(()=>[...t[38]||(t[38]=[e.createTextVNode(" Delete Collection ",-1)])]),_:1})):e.createCommentVNode("",!0),r.value==="create"?(e.openBlock(),e.createBlock($,{key:1,type:"submit",onClick:G},{default:e.withCtx(()=>[...t[39]||(t[39]=[e.createTextVNode(" Add Collection ",-1)])]),_:1})):(e.openBlock(),e.createBlock($,{key:2,type:"submit",onClick:W},{default:e.withCtx(()=>[...t[40]||(t[40]=[e.createTextVNode(" Edit Collection ",-1)])]),_:1}))]),_:1})]),_:1})]),_:1},8,["open"])}}}),Ue={class:"relative flex flex-col flex-1"},he={class:"flex items-center justify-between gap-4 w-full my-4"},Re={class:"flex items-center gap-4"},Ae={key:0,class:"text-lg whitespace-nowrap"},Le={key:1,class:"text-lg whitespace-nowrap"},Ie={key:0,class:"flex items-center gap-4"},Fe=e.defineComponent({__name:"Overview",props:{config:{type:Object,required:!0}},setup(w){const f=w,{getModuleData:y}=N.useModuleStorage(),{hasPermission:k,isAdmin:S}=N.useModulePermissions(),{navigateTo:u}=N.useModuleRoute(),{confirm:b}=N.useConfirmation();N.useModuleBreadcrumbs(()=>[]);const c=N.useFirebaseIntegration(f.config.project),r=e.ref(null),g=e.ref([]),v=e.ref(null);e.computed(()=>r.value?.find(n=>n.id===v.value)||null);const m=e.useTemplateRef("collectionModal"),a=async()=>{const n=await c.find(f.config.collectionsCollection);r.value=n||[]},p=async n=>{const o=await c.add(f.config.collectionsCollection,n);console.log("Added collection",o)},x=async n=>{try{await c.update(f.config.collectionsCollection,n.id,n);const o=r.value.findIndex(i=>i.id===n.id);o!==-1&&(r.value[o]=n),P.toast.success("Collection updated")}catch{P.toast.error("Failed to update collection")}},V=n=>{b("Are you sure you want to delete this collection? This action cannot be undone.").then(async o=>{if(o)try{await c.remove(f.config.collectionsCollection,n),r.value=r.value.filter(i=>i.id!==n),P.toast.success("Collection deleted")}catch{P.toast.error("Failed to delete collection")}})};return e.onMounted(()=>{a(),y("components").then(n=>{g.value=n})}),(n,o)=>{const i=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",Ue,[e.createElementVNode("div",he,[e.createElementVNode("div",Re,[r.value!==null?(e.openBlock(),e.createElementBlock("p",Ae,e.toDisplayString(r.value.length)+" "+e.toDisplayString(r.value.length===1?"Collection":"Collections"),1)):(e.openBlock(),e.createElementBlock("p",Le,"Loading Collections..."))]),e.unref(S)()?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(i,{variant:"outline",class:"text-primary hover:text-primary",onClick:o[0]||(o[0]=d=>e.unref(u)("global-styling"))},{default:e.withCtx(()=>[e.createVNode(e.unref(_.Paintbrush),{class:"size-4"}),o[5]||(o[5]=e.createTextVNode(" Global Styling ",-1))]),_:1}),e.createVNode(i,{variant:"outline",class:"text-primary hover:text-primary",onClick:o[1]||(o[1]=d=>e.unref(u)("components"))},{default:e.withCtx(()=>[e.createVNode(e.unref(_.ToyBrick),{class:"size-4"}),o[6]||(o[6]=e.createTextVNode(" Components ",-1))]),_:1}),e.createVNode(i,{variant:"outline",class:"text-primary hover:text-primary",onClick:o[2]||(o[2]=d=>m.value.openDialog())},{default:e.withCtx(()=>[e.createVNode(e.unref(_.Plus),{class:"size-4"}),o[7]||(o[7]=e.createTextVNode(" New Collection ",-1))]),_:1})])):e.createCommentVNode("",!0)]),e.createVNode(ve,{collections:r.value,onOpen:o[3]||(o[3]=d=>v.value=d),onEdit:o[4]||(o[4]=d=>m.value.openDialog(d)),onDelete:V},null,8,["collections"]),e.createVNode($e,{config:w.config,components:g.value,ref_key:"collectionModal",ref:m,onAdd:p,onEdit:x,onDelete:V},null,8,["config","components"])])}}});exports.default=Fe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("lucide-vue-next"),c=require("@oneclick.dev/cms-kit"),g={class:"flex items-center gap-2"},N={key:0,class:"bg-green-500 text-green-950 px-2 py-1 rounded-lg text-xs"},w={key:1,class:"bg-blue-500 text-blue-950 px-2 py-1 rounded-lg text-xs"},b=e.defineComponent({__name:"ListView",props:{collections:{type:Array,required:!0}},setup(d){const{navigateTo:i}=c.useModuleRoute();return(v,n)=>{const u=e.resolveComponent("TableHead"),p=e.resolveComponent("TableRow"),C=e.resolveComponent("TableHeader"),m=e.resolveComponent("AvatarImage"),l=e.resolveComponent("AvatarFallback"),s=e.resolveComponent("Avatar"),r=e.resolveComponent("TableCell"),_=e.resolveComponent("Button"),a=e.resolveComponent("TableBody"),t=e.resolveComponent("Table");return e.openBlock(),e.createBlock(t,null,{default:e.withCtx(()=>[e.createVNode(C,null,{default:e.withCtx(()=>[e.createVNode(p,null,{default:e.withCtx(()=>[e.createVNode(u,{class:"w-[100px]"},{default:e.withCtx(()=>[...n[0]||(n[0]=[e.createTextVNode(" Title ",-1)])]),_:1}),e.createVNode(u,null,{default:e.withCtx(()=>[...n[1]||(n[1]=[e.createTextVNode("Status",-1)])]),_:1}),e.createVNode(u,null,{default:e.withCtx(()=>[...n[2]||(n[2]=[e.createTextVNode(" Type",-1)])]),_:1}),e.createVNode(u,{class:"text-right"},{default:e.withCtx(()=>[...n[3]||(n[3]=[e.createTextVNode(" Actions ",-1)])]),_:1})]),_:1})]),_:1}),e.createVNode(a,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.collections,o=>(e.openBlock(),e.createBlock(p,{key:o.id,onClick:V=>e.unref(i)(o.id),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(r,{class:"font-medium"},{default:e.withCtx(()=>[e.createElementVNode("div",g,[o.thumbnail?(e.openBlock(),e.createBlock(s,{key:0,class:"size-12 rounded-xl"},{default:e.withCtx(()=>[e.createVNode(m,{src:o.thumbnail,class:"object-cover"},null,8,["src"]),e.createVNode(l,{class:"rounded-xl"})]),_:2},1024)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(o.title),1)])]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(()=>[o.status==="published"?(e.openBlock(),e.createElementBlock("span",N,"Published")):o.status==="draft"?(e.openBlock(),e.createElementBlock("span",w,"Draft")):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.type),1)]),_:2},1024),e.createVNode(r,{class:"text-right"},{default:e.withCtx(()=>[e.createVNode(_,{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(x.Pencil),{class:"size-4"})]),_:1})]),_:1})]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1})}}}),h={class:"relative"},y={ref:"container",class:"flex items-center justify-between gap-4 w-full mt-12 mb-8"},k={class:"flex items-center gap-4"},B={class:"text-lg whitespace-nowrap"},T={class:"relative w-full max-w-sm items-center"},E={class:"absolute start-0 inset-y-0 flex items-center justify-center px-2"},A={class:"flex items-center gap-4"},S=e.defineComponent({__name:"Overview",props:{config:{type:Object,required:!0}},setup(d){const i=d,{hasPermission:v}=c.useModulePermissions(),{navigateTo:n}=c.useModuleRoute(),{log:u,logWarning:p,logError:C}=c.useLogs();c.useModuleBreadcrumbs(()=>[]);const m=c.useFirebaseIntegration(i.config.project),l=e.ref([]),s=e.ref(""),r=e.computed(()=>l.value.filter(a=>a.title.toLowerCase().includes(s.value.toLowerCase()))),_=async()=>{const a=async()=>{if(!i.config.collectionsCollection)return[];const t=i.config.collectionsCollection.split(":");return t.length!==2?[]:(await m.get(t[0]))?.[t[1]]||[]};return l.value=await a(),l.value};return e.onMounted(()=>{_()}),(a,t)=>{const o=e.resolveComponent("Input"),V=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("div",y,[e.createElementVNode("div",k,[e.createElementVNode("p",B,e.toDisplayString(l.value?.length)+" collections",1),e.createElementVNode("div",T,[e.createVNode(o,{id:"search",type:"text",placeholder:"Search...",class:"pl-8",modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=f=>s.value=f),onKeydown:t[1]||(t[1]=e.withKeys(f=>s.value="",["escape"]))},null,8,["modelValue"]),e.createElementVNode("span",E,[e.createVNode(e.unref(x.Search),{class:"size-4 text-muted-foreground"})])])]),e.createElementVNode("div",A,[e.unref(v)("create-collection")?(e.openBlock(),e.createBlock(V,{key:0,variant:"outline",onClick:t[2]||(t[2]=f=>e.unref(n)("new"))},{default:e.withCtx(()=>[e.createVNode(e.unref(x.Plus),{class:"size-4"}),t[3]||(t[3]=e.createTextVNode(" New Collection ",-1))]),_:1})):e.createCommentVNode("",!0)])],512),e.createVNode(b,{collections:e.unref(r)},null,8,["collections"])])}}});exports.default=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),m=require("lucide-vue-next"),q={class:"flex gap-4 mb-2 justify-between"},A={class:"flex flex-col items-start p-4"},J={class:"flex gap-4 mb-2 justify-between"},W={class:"grid grid-cols-7 gap-4 py-4"},K={class:"grid grid-cols-2 gap-4"},R={class:"flex gap-4"},Q={class:"flex flex-col gap-2"},X=e.defineComponent({__name:"RegularSlotEditor",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(_,{emit:T}){const w=_,k=T,r=e.computed({get:()=>w.modelValue,set:d=>{k("update:modelValue",d)}}),v=[{value:1,name:"Monday",short:"Mon"},{value:2,name:"Tuesday",short:"Tue"},{value:3,name:"Wednesday",short:"Wed"},{value:4,name:"Thursday",short:"Thu"},{value:5,name:"Friday",short:"Fri"},{value:6,name:"Saturday",short:"Sat"},{value:0,name:"Sunday",short:"Sun"}],n=e.reactive({startTime:"",endTime:"",duration:0,days:{1:!1,2:!1,3:!1,4:!1,5:!1,6:!1,0:!1}}),S=d=>{r.value[d]=[]},c=e.ref(!1);function b(){n.startTime="10:00",n.endTime="18:00",n.duration=30,n.days={1:!1,2:!1,3:!1,4:!1,5:!1,6:!1,0:!1},c.value=!0}const h=()=>{n.duration>0&&(n.duration-=15)},D=()=>{n.duration+=15},E=()=>{const d=n.startTime.split(":").map(l=>parseInt(l)),t=n.endTime.split(":").map(l=>parseInt(l)),V=d[0]*60+d[1],f=t[0]*60+t[1];for(const l in n.days)if(n.days[l]){r.value[l]=[];for(let s=V;s+n.duration<=f;s+=n.duration){const C=Math.floor(s/60).toString().padStart(2,"0"),g=(s%60).toString().padStart(2,"0"),N=Math.floor((s+n.duration)/60).toString().padStart(2,"0"),u=((s+n.duration)%60).toString().padStart(2,"0");r.value[l].push({id:Date.now()+Math.random(),startTime:`${C}:${g}`,endTime:`${N}:${u}`})}}c.value=!1};return(d,t)=>{const V=e.resolveComponent("TabsTrigger"),f=e.resolveComponent("TabsList"),l=e.resolveComponent("Button"),s=e.resolveComponent("DropdownMenuTrigger"),C=e.resolveComponent("DropdownMenuItem"),g=e.resolveComponent("DropdownMenuContent"),N=e.resolveComponent("DropdownMenu"),u=e.resolveComponent("Input"),M=e.resolveComponent("Item"),x=e.resolveComponent("Card"),y=e.resolveComponent("DialogTrigger"),B=e.resolveComponent("DialogTitle"),I=e.resolveComponent("DialogHeader"),p=e.resolveComponent("Label"),$=e.resolveComponent("InputGroupInput"),G=e.resolveComponent("InputGroupAddon"),F=e.resolveComponent("InputGroup"),U=e.resolveComponent("Checkbox"),L=e.resolveComponent("DialogFooter"),z=e.resolveComponent("DialogContent"),H=e.resolveComponent("Dialog"),O=e.resolveComponent("TabsContent"),P=e.resolveComponent("Tabs");return e.openBlock(),e.createBlock(P,{"default-value":1},{default:e.withCtx(()=>[e.createVNode(f,{class:"grid w-full grid-cols-7"},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,a=>e.createVNode(V,{key:a.value,value:a.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.short),1)]),_:2},1032,["value"])),64))]),_:1}),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,a=>e.createVNode(O,{key:a.value,value:a.value},{default:e.withCtx(()=>[e.createElementVNode("div",q,[e.createVNode(l,{variant:"ghost",onClick:o=>S(a.value),disabled:r.value[a.value].length===0},{default:e.withCtx(()=>[e.createVNode(e.unref(m.Trash2),{class:"size-4"}),e.createTextVNode(" Clear "+e.toDisplayString(a.name)+" Slots ",1)]),_:2},1032,["onClick","disabled"]),e.createVNode(N,null,{default:e.withCtx(()=>[e.createVNode(s,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(l,{variant:"ghost",disabled:r.value[a.value].length===0},{default:e.withCtx(()=>[e.createVNode(e.unref(m.Clipboard),{class:"size-4"}),e.createTextVNode(" Copy "+e.toDisplayString(a.name)+" Slots to ",1)]),_:2},1032,["disabled"])]),_:2},1024),e.createVNode(g,{class:"w-56"},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,o=>e.createVNode(C,{key:o.value,onClick:i=>r.value[o.value]=JSON.parse(JSON.stringify(r.value[a.value])),disabled:o.value===a.value},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(o.name),1)]),_:2},1032,["onClick","disabled"])),64))]),_:2},1024)]),_:2},1024)]),e.createVNode(x,{class:"mb-4 py-0"},{default:e.withCtx(()=>[e.createElementVNode("div",A,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value[a.value],o=>(e.openBlock(),e.createBlock(M,{key:o.id,class:"mb-2"},{default:e.withCtx(()=>[e.createVNode(u,{class:"w-32",modelValue:o.startTime,"onUpdate:modelValue":i=>o.startTime=i,type:"time"},null,8,["modelValue","onUpdate:modelValue"]),t[9]||(t[9]=e.createElementVNode("span",{class:"mx-2"},"to",-1)),e.createVNode(u,{class:"w-32",modelValue:o.endTime,"onUpdate:modelValue":i=>o.endTime=i,type:"time"},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(l,{variant:"ghost",size:"icon",onClick:i=>r.value[a.value]=r.value[a.value].filter(j=>j.id!==o.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(m.Trash2),{class:"size-4"})]),_:1},8,["onClick"])]),_:2},1024))),128)),e.createVNode(l,{onClick:o=>r.value[a.value].push({id:Date.now(),startTime:"",endTime:""}),variant:"outline"},{default:e.withCtx(()=>[...t[10]||(t[10]=[e.createTextVNode(" + Add Time Slot ",-1)])]),_:1},8,["onClick"])])]),_:2},1024),e.createElementVNode("div",J,[e.createVNode(H,{open:c.value,"onUpdate:open":t[8]||(t[8]=o=>c.value=o)},{default:e.withCtx(()=>[e.createVNode(y,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(l,{variant:"outline",onClick:t[0]||(t[0]=o=>b())},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ClockPlus),{class:"size-4"}),t[11]||(t[11]=e.createTextVNode(" Generate Time Slots ",-1))]),_:1})]),_:1}),e.createVNode(z,{class:"sm:max-w-2xl"},{default:e.withCtx(()=>[e.createVNode(I,null,{default:e.withCtx(()=>[e.createVNode(B,null,{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode("Generate Time Slots",-1)])]),_:1})]),_:1}),e.createElementVNode("div",W,[e.createVNode(x,{class:"col-span-5 px-4"},{default:e.withCtx(()=>[e.createElementVNode("div",K,[e.createElementVNode("div",null,[e.createVNode(p,{class:"font-medium mb-2",for:"generate-time-dialog-start"},{default:e.withCtx(()=>[...t[13]||(t[13]=[e.createTextVNode("Start Time",-1)])]),_:1}),e.createVNode(u,{type:"time",id:"generate-time-dialog-start",modelValue:n.startTime,"onUpdate:modelValue":t[1]||(t[1]=o=>n.startTime=o)},null,8,["modelValue"])]),e.createElementVNode("div",null,[e.createVNode(p,{class:"font-medium mb-2",for:"generate-time-dialog-end"},{default:e.withCtx(()=>[...t[14]||(t[14]=[e.createTextVNode("End Time",-1)])]),_:1}),e.createVNode(u,{type:"time",id:"generate-time-dialog-end",modelValue:n.endTime,"onUpdate:modelValue":t[2]||(t[2]=o=>n.endTime=o)},null,8,["modelValue"])])]),e.createElementVNode("div",null,[e.createVNode(p,{class:"font-medium mb-2",for:"generate-time-dialog-duration"},{default:e.withCtx(()=>[...t[15]||(t[15]=[e.createTextVNode("Service Duration",-1)])]),_:1}),e.createElementVNode("div",R,[e.createVNode(l,{variant:"outline",onClick:t[3]||(t[3]=o=>h())},{default:e.withCtx(()=>[e.createVNode(e.unref(m.Minus),{class:"size-4"})]),_:1}),e.createVNode(F,null,{default:e.withCtx(()=>[e.createVNode($,{type:"number",placeholder:"0",class:"no-spinner",step:"15",min:"0",id:"generate-time-dialog-duration",modelValue:n.duration,"onUpdate:modelValue":t[4]||(t[4]=o=>n.duration=o)},null,8,["modelValue"]),e.createVNode(G,{align:"inline-end"},{default:e.withCtx(()=>[...t[16]||(t[16]=[e.createTextVNode(" mins ",-1)])]),_:1})]),_:1}),e.createVNode(l,{variant:"outline",onClick:t[5]||(t[5]=o=>D())},{default:e.withCtx(()=>[e.createVNode(e.unref(m.Plus),{class:"size-4"})]),_:1})])])]),_:1}),e.createVNode(x,{class:"col-span-2 px-4"},{default:e.withCtx(()=>[e.createVNode(p,{class:"font-medium text-xs"},{default:e.withCtx(()=>[...t[17]||(t[17]=[e.createTextVNode("Generate slots for",-1)])]),_:1}),e.createElementVNode("div",Q,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,o=>e.createElementVNode("div",{class:"flex items-center",key:o.value},[e.createVNode(U,{id:`generate-time-dialog-${o.value}`,modelValue:n.days[o.value],"onUpdate:modelValue":i=>n.days[o.value]=i},null,8,["id","modelValue","onUpdate:modelValue"]),e.createVNode(p,{for:`generate-time-dialog-${o.value}`,class:"ml-2 text-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.name),1)]),_:2},1032,["for"])])),64))])]),_:2},1024)]),e.createVNode(L,null,{default:e.withCtx(()=>[e.createVNode(l,{variant:"outline",onClick:t[6]||(t[6]=o=>c.value=!1)},{default:e.withCtx(()=>[...t[18]||(t[18]=[e.createTextVNode(" Cancel ",-1)])]),_:1}),e.createVNode(l,{onClick:t[7]||(t[7]=o=>E())},{default:e.withCtx(()=>[...t[19]||(t[19]=[e.createTextVNode(" Generate ",-1)])]),_:1})]),_:1})]),_:2},1024)]),_:2},1032,["open"])])]),_:2},1032,["value"])),64))]),_:1})}}});exports._sfc_main=X;
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { defineComponent as te, computed as ne, reactive as le, ref as oe, resolveComponent as a, createBlock as y, openBlock as v, withCtx as n, createVNode as e, createElementBlock as C, Fragment as b, renderList as V, createTextVNode as i, toDisplayString as S, createElementVNode as d, unref as g } from "vue";
|
|
2
|
+
import { Trash2 as G, Clipboard as ae, ClockPlus as se, Minus as ue, Plus as ie } from "lucide-vue-next";
|
|
3
|
+
const de = { class: "flex gap-4 mb-2 justify-between" }, re = { class: "flex flex-col items-start p-4" }, me = { class: "flex gap-4 mb-2 justify-between" }, pe = { class: "grid grid-cols-7 gap-4 py-4" }, fe = { class: "grid grid-cols-2 gap-4" }, ve = { class: "flex gap-4" }, ce = { class: "flex flex-col gap-2" }, Te = /* @__PURE__ */ te({
|
|
4
|
+
__name: "RegularSlotEditor",
|
|
5
|
+
props: {
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: !0
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
emits: ["update:modelValue"],
|
|
12
|
+
setup(U, { emit: z }) {
|
|
13
|
+
const E = U, F = z, r = ne({
|
|
14
|
+
get: () => E.modelValue,
|
|
15
|
+
set: (p) => {
|
|
16
|
+
F("update:modelValue", p);
|
|
17
|
+
}
|
|
18
|
+
}), D = [
|
|
19
|
+
{ value: 1, name: "Monday", short: "Mon" },
|
|
20
|
+
{ value: 2, name: "Tuesday", short: "Tue" },
|
|
21
|
+
{ value: 3, name: "Wednesday", short: "Wed" },
|
|
22
|
+
{ value: 4, name: "Thursday", short: "Thu" },
|
|
23
|
+
{ value: 5, name: "Friday", short: "Fri" },
|
|
24
|
+
{ value: 6, name: "Saturday", short: "Sat" },
|
|
25
|
+
{ value: 0, name: "Sunday", short: "Sun" }
|
|
26
|
+
], o = le({
|
|
27
|
+
startTime: "",
|
|
28
|
+
endTime: "",
|
|
29
|
+
duration: 0,
|
|
30
|
+
days: {
|
|
31
|
+
1: !1,
|
|
32
|
+
2: !1,
|
|
33
|
+
3: !1,
|
|
34
|
+
4: !1,
|
|
35
|
+
5: !1,
|
|
36
|
+
6: !1,
|
|
37
|
+
0: !1
|
|
38
|
+
}
|
|
39
|
+
}), B = (p) => {
|
|
40
|
+
r.value[p] = [];
|
|
41
|
+
}, _ = oe(!1);
|
|
42
|
+
function L() {
|
|
43
|
+
o.startTime = "10:00", o.endTime = "18:00", o.duration = 30, o.days = {
|
|
44
|
+
1: !1,
|
|
45
|
+
2: !1,
|
|
46
|
+
3: !1,
|
|
47
|
+
4: !1,
|
|
48
|
+
5: !1,
|
|
49
|
+
6: !1,
|
|
50
|
+
0: !1
|
|
51
|
+
}, _.value = !0;
|
|
52
|
+
}
|
|
53
|
+
const N = () => {
|
|
54
|
+
o.duration > 0 && (o.duration -= 15);
|
|
55
|
+
}, H = () => {
|
|
56
|
+
o.duration += 15;
|
|
57
|
+
}, O = () => {
|
|
58
|
+
const p = o.startTime.split(":").map((s) => parseInt(s)), t = o.endTime.split(":").map((s) => parseInt(s)), k = p[0] * 60 + p[1], x = t[0] * 60 + t[1];
|
|
59
|
+
for (const s in o.days)
|
|
60
|
+
if (o.days[s]) {
|
|
61
|
+
r.value[s] = [];
|
|
62
|
+
for (let m = k; m + o.duration <= x; m += o.duration) {
|
|
63
|
+
const w = Math.floor(m / 60).toString().padStart(2, "0"), M = (m % 60).toString().padStart(2, "0"), I = Math.floor((m + o.duration) / 60).toString().padStart(2, "0"), c = ((m + o.duration) % 60).toString().padStart(2, "0");
|
|
64
|
+
r.value[s].push({
|
|
65
|
+
id: Date.now() + Math.random(),
|
|
66
|
+
startTime: `${w}:${M}`,
|
|
67
|
+
endTime: `${I}:${c}`
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
_.value = !1;
|
|
72
|
+
};
|
|
73
|
+
return (p, t) => {
|
|
74
|
+
const k = a("TabsTrigger"), x = a("TabsList"), s = a("Button"), m = a("DropdownMenuTrigger"), w = a("DropdownMenuItem"), M = a("DropdownMenuContent"), I = a("DropdownMenu"), c = a("Input"), P = a("Item"), $ = a("Card"), j = a("DialogTrigger"), A = a("DialogTitle"), J = a("DialogHeader"), T = a("Label"), W = a("InputGroupInput"), q = a("InputGroupAddon"), K = a("InputGroup"), R = a("Checkbox"), Q = a("DialogFooter"), X = a("DialogContent"), Y = a("Dialog"), Z = a("TabsContent"), h = a("Tabs");
|
|
75
|
+
return v(), y(h, { "default-value": 1 }, {
|
|
76
|
+
default: n(() => [
|
|
77
|
+
e(x, { class: "grid w-full grid-cols-7" }, {
|
|
78
|
+
default: n(() => [
|
|
79
|
+
(v(), C(b, null, V(D, (u) => e(k, {
|
|
80
|
+
key: u.value,
|
|
81
|
+
value: u.value
|
|
82
|
+
}, {
|
|
83
|
+
default: n(() => [
|
|
84
|
+
i(S(u.short), 1)
|
|
85
|
+
]),
|
|
86
|
+
_: 2
|
|
87
|
+
}, 1032, ["value"])), 64))
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
}),
|
|
91
|
+
(v(), C(b, null, V(D, (u) => e(Z, {
|
|
92
|
+
key: u.value,
|
|
93
|
+
value: u.value
|
|
94
|
+
}, {
|
|
95
|
+
default: n(() => [
|
|
96
|
+
d("div", de, [
|
|
97
|
+
e(s, {
|
|
98
|
+
variant: "ghost",
|
|
99
|
+
onClick: (l) => B(u.value),
|
|
100
|
+
disabled: r.value[u.value].length === 0
|
|
101
|
+
}, {
|
|
102
|
+
default: n(() => [
|
|
103
|
+
e(g(G), { class: "size-4" }),
|
|
104
|
+
i(" Clear " + S(u.name) + " Slots ", 1)
|
|
105
|
+
]),
|
|
106
|
+
_: 2
|
|
107
|
+
}, 1032, ["onClick", "disabled"]),
|
|
108
|
+
e(I, null, {
|
|
109
|
+
default: n(() => [
|
|
110
|
+
e(m, { "as-child": "" }, {
|
|
111
|
+
default: n(() => [
|
|
112
|
+
e(s, {
|
|
113
|
+
variant: "ghost",
|
|
114
|
+
disabled: r.value[u.value].length === 0
|
|
115
|
+
}, {
|
|
116
|
+
default: n(() => [
|
|
117
|
+
e(g(ae), { class: "size-4" }),
|
|
118
|
+
i(" Copy " + S(u.name) + " Slots to ", 1)
|
|
119
|
+
]),
|
|
120
|
+
_: 2
|
|
121
|
+
}, 1032, ["disabled"])
|
|
122
|
+
]),
|
|
123
|
+
_: 2
|
|
124
|
+
}, 1024),
|
|
125
|
+
e(M, { class: "w-56" }, {
|
|
126
|
+
default: n(() => [
|
|
127
|
+
(v(), C(b, null, V(D, (l) => e(w, {
|
|
128
|
+
key: l.value,
|
|
129
|
+
onClick: (f) => r.value[l.value] = JSON.parse(JSON.stringify(r.value[u.value])),
|
|
130
|
+
disabled: l.value === u.value
|
|
131
|
+
}, {
|
|
132
|
+
default: n(() => [
|
|
133
|
+
d("span", null, S(l.name), 1)
|
|
134
|
+
]),
|
|
135
|
+
_: 2
|
|
136
|
+
}, 1032, ["onClick", "disabled"])), 64))
|
|
137
|
+
]),
|
|
138
|
+
_: 2
|
|
139
|
+
}, 1024)
|
|
140
|
+
]),
|
|
141
|
+
_: 2
|
|
142
|
+
}, 1024)
|
|
143
|
+
]),
|
|
144
|
+
e($, { class: "mb-4 py-0" }, {
|
|
145
|
+
default: n(() => [
|
|
146
|
+
d("div", re, [
|
|
147
|
+
(v(!0), C(b, null, V(r.value[u.value], (l) => (v(), y(P, {
|
|
148
|
+
key: l.id,
|
|
149
|
+
class: "mb-2"
|
|
150
|
+
}, {
|
|
151
|
+
default: n(() => [
|
|
152
|
+
e(c, {
|
|
153
|
+
class: "w-32",
|
|
154
|
+
modelValue: l.startTime,
|
|
155
|
+
"onUpdate:modelValue": (f) => l.startTime = f,
|
|
156
|
+
type: "time"
|
|
157
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
158
|
+
t[9] || (t[9] = d("span", { class: "mx-2" }, "to", -1)),
|
|
159
|
+
e(c, {
|
|
160
|
+
class: "w-32",
|
|
161
|
+
modelValue: l.endTime,
|
|
162
|
+
"onUpdate:modelValue": (f) => l.endTime = f,
|
|
163
|
+
type: "time"
|
|
164
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
165
|
+
e(s, {
|
|
166
|
+
variant: "ghost",
|
|
167
|
+
size: "icon",
|
|
168
|
+
onClick: (f) => r.value[u.value] = r.value[u.value].filter((ee) => ee.id !== l.id)
|
|
169
|
+
}, {
|
|
170
|
+
default: n(() => [
|
|
171
|
+
e(g(G), { class: "size-4" })
|
|
172
|
+
]),
|
|
173
|
+
_: 1
|
|
174
|
+
}, 8, ["onClick"])
|
|
175
|
+
]),
|
|
176
|
+
_: 2
|
|
177
|
+
}, 1024))), 128)),
|
|
178
|
+
e(s, {
|
|
179
|
+
onClick: (l) => r.value[u.value].push({ id: Date.now(), startTime: "", endTime: "" }),
|
|
180
|
+
variant: "outline"
|
|
181
|
+
}, {
|
|
182
|
+
default: n(() => [...t[10] || (t[10] = [
|
|
183
|
+
i(" + Add Time Slot ", -1)
|
|
184
|
+
])]),
|
|
185
|
+
_: 1
|
|
186
|
+
}, 8, ["onClick"])
|
|
187
|
+
])
|
|
188
|
+
]),
|
|
189
|
+
_: 2
|
|
190
|
+
}, 1024),
|
|
191
|
+
d("div", me, [
|
|
192
|
+
e(Y, {
|
|
193
|
+
open: _.value,
|
|
194
|
+
"onUpdate:open": t[8] || (t[8] = (l) => _.value = l)
|
|
195
|
+
}, {
|
|
196
|
+
default: n(() => [
|
|
197
|
+
e(j, { "as-child": "" }, {
|
|
198
|
+
default: n(() => [
|
|
199
|
+
e(s, {
|
|
200
|
+
variant: "outline",
|
|
201
|
+
onClick: t[0] || (t[0] = (l) => L())
|
|
202
|
+
}, {
|
|
203
|
+
default: n(() => [
|
|
204
|
+
e(g(se), { class: "size-4" }),
|
|
205
|
+
t[11] || (t[11] = i(" Generate Time Slots ", -1))
|
|
206
|
+
]),
|
|
207
|
+
_: 1
|
|
208
|
+
})
|
|
209
|
+
]),
|
|
210
|
+
_: 1
|
|
211
|
+
}),
|
|
212
|
+
e(X, { class: "sm:max-w-2xl" }, {
|
|
213
|
+
default: n(() => [
|
|
214
|
+
e(J, null, {
|
|
215
|
+
default: n(() => [
|
|
216
|
+
e(A, null, {
|
|
217
|
+
default: n(() => [...t[12] || (t[12] = [
|
|
218
|
+
i("Generate Time Slots", -1)
|
|
219
|
+
])]),
|
|
220
|
+
_: 1
|
|
221
|
+
})
|
|
222
|
+
]),
|
|
223
|
+
_: 1
|
|
224
|
+
}),
|
|
225
|
+
d("div", pe, [
|
|
226
|
+
e($, { class: "col-span-5 px-4" }, {
|
|
227
|
+
default: n(() => [
|
|
228
|
+
d("div", fe, [
|
|
229
|
+
d("div", null, [
|
|
230
|
+
e(T, {
|
|
231
|
+
class: "font-medium mb-2",
|
|
232
|
+
for: "generate-time-dialog-start"
|
|
233
|
+
}, {
|
|
234
|
+
default: n(() => [...t[13] || (t[13] = [
|
|
235
|
+
i("Start Time", -1)
|
|
236
|
+
])]),
|
|
237
|
+
_: 1
|
|
238
|
+
}),
|
|
239
|
+
e(c, {
|
|
240
|
+
type: "time",
|
|
241
|
+
id: "generate-time-dialog-start",
|
|
242
|
+
modelValue: o.startTime,
|
|
243
|
+
"onUpdate:modelValue": t[1] || (t[1] = (l) => o.startTime = l)
|
|
244
|
+
}, null, 8, ["modelValue"])
|
|
245
|
+
]),
|
|
246
|
+
d("div", null, [
|
|
247
|
+
e(T, {
|
|
248
|
+
class: "font-medium mb-2",
|
|
249
|
+
for: "generate-time-dialog-end"
|
|
250
|
+
}, {
|
|
251
|
+
default: n(() => [...t[14] || (t[14] = [
|
|
252
|
+
i("End Time", -1)
|
|
253
|
+
])]),
|
|
254
|
+
_: 1
|
|
255
|
+
}),
|
|
256
|
+
e(c, {
|
|
257
|
+
type: "time",
|
|
258
|
+
id: "generate-time-dialog-end",
|
|
259
|
+
modelValue: o.endTime,
|
|
260
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => o.endTime = l)
|
|
261
|
+
}, null, 8, ["modelValue"])
|
|
262
|
+
])
|
|
263
|
+
]),
|
|
264
|
+
d("div", null, [
|
|
265
|
+
e(T, {
|
|
266
|
+
class: "font-medium mb-2",
|
|
267
|
+
for: "generate-time-dialog-duration"
|
|
268
|
+
}, {
|
|
269
|
+
default: n(() => [...t[15] || (t[15] = [
|
|
270
|
+
i("Service Duration", -1)
|
|
271
|
+
])]),
|
|
272
|
+
_: 1
|
|
273
|
+
}),
|
|
274
|
+
d("div", ve, [
|
|
275
|
+
e(s, {
|
|
276
|
+
variant: "outline",
|
|
277
|
+
onClick: t[3] || (t[3] = (l) => N())
|
|
278
|
+
}, {
|
|
279
|
+
default: n(() => [
|
|
280
|
+
e(g(ue), { class: "size-4" })
|
|
281
|
+
]),
|
|
282
|
+
_: 1
|
|
283
|
+
}),
|
|
284
|
+
e(K, null, {
|
|
285
|
+
default: n(() => [
|
|
286
|
+
e(W, {
|
|
287
|
+
type: "number",
|
|
288
|
+
placeholder: "0",
|
|
289
|
+
class: "no-spinner",
|
|
290
|
+
step: "15",
|
|
291
|
+
min: "0",
|
|
292
|
+
id: "generate-time-dialog-duration",
|
|
293
|
+
modelValue: o.duration,
|
|
294
|
+
"onUpdate:modelValue": t[4] || (t[4] = (l) => o.duration = l)
|
|
295
|
+
}, null, 8, ["modelValue"]),
|
|
296
|
+
e(q, { align: "inline-end" }, {
|
|
297
|
+
default: n(() => [...t[16] || (t[16] = [
|
|
298
|
+
i(" mins ", -1)
|
|
299
|
+
])]),
|
|
300
|
+
_: 1
|
|
301
|
+
})
|
|
302
|
+
]),
|
|
303
|
+
_: 1
|
|
304
|
+
}),
|
|
305
|
+
e(s, {
|
|
306
|
+
variant: "outline",
|
|
307
|
+
onClick: t[5] || (t[5] = (l) => H())
|
|
308
|
+
}, {
|
|
309
|
+
default: n(() => [
|
|
310
|
+
e(g(ie), { class: "size-4" })
|
|
311
|
+
]),
|
|
312
|
+
_: 1
|
|
313
|
+
})
|
|
314
|
+
])
|
|
315
|
+
])
|
|
316
|
+
]),
|
|
317
|
+
_: 1
|
|
318
|
+
}),
|
|
319
|
+
e($, { class: "col-span-2 px-4" }, {
|
|
320
|
+
default: n(() => [
|
|
321
|
+
e(T, { class: "font-medium text-xs" }, {
|
|
322
|
+
default: n(() => [...t[17] || (t[17] = [
|
|
323
|
+
i("Generate slots for", -1)
|
|
324
|
+
])]),
|
|
325
|
+
_: 1
|
|
326
|
+
}),
|
|
327
|
+
d("div", ce, [
|
|
328
|
+
(v(), C(b, null, V(D, (l) => d("div", {
|
|
329
|
+
class: "flex items-center",
|
|
330
|
+
key: l.value
|
|
331
|
+
}, [
|
|
332
|
+
e(R, {
|
|
333
|
+
id: `generate-time-dialog-${l.value}`,
|
|
334
|
+
modelValue: o.days[l.value],
|
|
335
|
+
"onUpdate:modelValue": (f) => o.days[l.value] = f
|
|
336
|
+
}, null, 8, ["id", "modelValue", "onUpdate:modelValue"]),
|
|
337
|
+
e(T, {
|
|
338
|
+
for: `generate-time-dialog-${l.value}`,
|
|
339
|
+
class: "ml-2 text-sm"
|
|
340
|
+
}, {
|
|
341
|
+
default: n(() => [
|
|
342
|
+
i(S(l.name), 1)
|
|
343
|
+
]),
|
|
344
|
+
_: 2
|
|
345
|
+
}, 1032, ["for"])
|
|
346
|
+
])), 64))
|
|
347
|
+
])
|
|
348
|
+
]),
|
|
349
|
+
_: 2
|
|
350
|
+
}, 1024)
|
|
351
|
+
]),
|
|
352
|
+
e(Q, null, {
|
|
353
|
+
default: n(() => [
|
|
354
|
+
e(s, {
|
|
355
|
+
variant: "outline",
|
|
356
|
+
onClick: t[6] || (t[6] = (l) => _.value = !1)
|
|
357
|
+
}, {
|
|
358
|
+
default: n(() => [...t[18] || (t[18] = [
|
|
359
|
+
i(" Cancel ", -1)
|
|
360
|
+
])]),
|
|
361
|
+
_: 1
|
|
362
|
+
}),
|
|
363
|
+
e(s, {
|
|
364
|
+
onClick: t[7] || (t[7] = (l) => O())
|
|
365
|
+
}, {
|
|
366
|
+
default: n(() => [...t[19] || (t[19] = [
|
|
367
|
+
i(" Generate ", -1)
|
|
368
|
+
])]),
|
|
369
|
+
_: 1
|
|
370
|
+
})
|
|
371
|
+
]),
|
|
372
|
+
_: 1
|
|
373
|
+
})
|
|
374
|
+
]),
|
|
375
|
+
_: 2
|
|
376
|
+
}, 1024)
|
|
377
|
+
]),
|
|
378
|
+
_: 2
|
|
379
|
+
}, 1032, ["open"])
|
|
380
|
+
])
|
|
381
|
+
]),
|
|
382
|
+
_: 2
|
|
383
|
+
}, 1032, ["value"])), 64))
|
|
384
|
+
]),
|
|
385
|
+
_: 1
|
|
386
|
+
});
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
export {
|
|
391
|
+
Te as _
|
|
392
|
+
};
|