@ozdao/prometheus-framework 0.1.68 → 0.1.70
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/BackofficeGallery-59a591ab.js +1 -0
- package/dist/BackofficeGallery-be6f69a9.mjs +307 -0
- package/dist/BackofficeReports-06166952.js +1 -0
- package/dist/BackofficeReports-50fd799c.mjs +44 -0
- package/dist/BlockTags-00325fa0.mjs +853 -0
- package/dist/BlockTags-58f95c8a.js +1 -0
- package/dist/ButtonToggleMembership-84d0e018.mjs +90 -0
- package/dist/ButtonToggleMembership-b905812f.js +1 -0
- package/dist/CardBlogpost-1b81b54e.mjs +246 -0
- package/dist/CardBlogpost-7107e04a.js +1 -0
- package/dist/CardOrganization-49ab5190.mjs +234 -0
- package/dist/CardOrganization-e6ac27f1.js +1 -0
- package/dist/CardProduct-4c0cb9a1.js +1 -0
- package/dist/CardProduct-ea0e1f84.mjs +192 -0
- package/dist/Chips-817cf959.js +1 -0
- package/dist/Chips-8c836ba6.mjs +213 -0
- package/dist/Community-8c4e011b.js +1 -0
- package/dist/Community-bd6f0cbb.mjs +131 -0
- package/dist/Dashboard-73b50724.js +1 -0
- package/dist/Dashboard-bc81b5f6.mjs +151 -0
- package/dist/Dropdown-60e3dc6c.js +1 -0
- package/dist/Dropdown-d1c81d45.mjs +169 -0
- package/dist/EditOrder-2b746caf.mjs +221 -0
- package/dist/EditOrder-e632f0cc.js +1 -0
- package/dist/Events-999cc8ed.js +1 -0
- package/dist/Events-ad8bbf27.mjs +134 -0
- package/dist/Feed-35e13c22.mjs +156 -0
- package/dist/Feed-53d96b18.mjs +361 -0
- package/dist/Feed-694a2fad.js +1 -0
- package/dist/Feed-ac4bb6ea.js +1 -0
- package/dist/Feed-d1d01771.js +1 -0
- package/dist/Feed-f7c04014.mjs +124 -0
- package/dist/Image-61cfd52d.js +9 -0
- package/dist/Image-e8be4acc.mjs +480 -0
- package/dist/LeftoverAdd-a268a95c.js +1 -0
- package/dist/LeftoverAdd-e4d93760.mjs +229 -0
- package/dist/Leftovers-6976802d.mjs +135 -0
- package/dist/Leftovers-d8f1d152.js +1 -0
- package/dist/Members-aeb2bca1.mjs +109 -0
- package/dist/Members-b9664e83.js +1 -0
- package/dist/Menu-93d34d9f.js +1 -0
- package/dist/Menu-eaf6b44c.mjs +13 -0
- package/dist/MenuItem-4a5881bd.mjs +85 -0
- package/dist/MenuItem-f35cad93.js +1 -0
- package/dist/Orders-8bc8963c.js +1 -0
- package/dist/Orders-eb262d8c.mjs +75 -0
- package/dist/Organizations-9926aa51.mjs +72 -0
- package/dist/Organizations-c653d814.js +1 -0
- package/dist/Payments-98328000.js +1 -0
- package/dist/Payments-a9066cdf.mjs +11 -0
- package/dist/Popup-0d8e1392.mjs +96 -0
- package/dist/Popup-eb11fa82.js +1 -0
- package/dist/Product-15043af7.mjs +651 -0
- package/dist/Product-82c022a4.js +7 -0
- package/dist/ProductEdit-05da9866.mjs +258 -0
- package/dist/ProductEdit-2f075296.js +1 -0
- package/dist/ProductsBackoffice-8462f626.js +1 -0
- package/dist/ProductsBackoffice-8d0f0ee8.mjs +85 -0
- package/dist/ProfileBlogposts-43855cb9.js +1 -0
- package/dist/ProfileBlogposts-f32170a3.mjs +78 -0
- package/dist/ProfileEvents-54be2d43.mjs +69 -0
- package/dist/ProfileEvents-ab69e27e.js +1 -0
- package/dist/ProfileOrganizations-0787cf34.mjs +72 -0
- package/dist/ProfileOrganizations-eb62dde4.js +1 -0
- package/dist/Publics-8e726d20.mjs +45 -0
- package/dist/Publics-ae589bf1.js +1 -0
- package/dist/Select-95f4701a.js +1 -0
- package/dist/Select-dab17282.mjs +80 -0
- package/dist/Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-0ea8fbf8.js +1 -0
- package/dist/Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-4ed993c7.mjs +1 -0
- package/dist/Socials-43293869.js +1 -0
- package/dist/Socials-8193477c.mjs +189 -0
- package/dist/UploadImage-0e8e4278.mjs +83 -0
- package/dist/UploadImage-8c71bda6.js +1 -0
- package/dist/UploadImageMultiple-c34a6c6f.mjs +58 -0
- package/dist/UploadImageMultiple-d1316df5.js +1 -0
- package/dist/Wallet-727195d9.mjs +21700 -0
- package/dist/Wallet-f4dda407.js +10 -0
- package/dist/auth-04684a60.js +7 -0
- package/dist/auth-7e39361f.mjs +633 -0
- package/dist/auth.client.cjs +1 -1
- package/dist/auth.client.js +5 -5
- package/dist/auth.validation-d614130d.js +1 -0
- package/dist/auth.validation-f4bf1deb.mjs +24 -0
- package/dist/axios-33aeb810.mjs +1435 -0
- package/dist/axios-ceccf20e.js +5 -0
- package/dist/backoffice.client.cjs +1 -1
- package/dist/backoffice.client.js +20 -20
- package/dist/categories-7e17a7eb.js +1 -0
- package/dist/categories-b7f9e8c0.mjs +122 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +209 -202
- package/dist/events.client.cjs +2 -2
- package/dist/events.client.js +24 -27
- package/dist/landing.client.cjs +1 -1
- package/dist/landing.client.js +64 -40
- package/dist/leftovers-86e7d438.mjs +67 -0
- package/dist/leftovers-c9f70579.js +1 -0
- package/dist/legal.client.cjs +1 -1
- package/dist/legal.client.js +6 -7
- package/dist/memberships-559590ad.mjs +68 -0
- package/dist/memberships-58af22e0.js +1 -0
- package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -1
- package/dist/orders-1325c51b.js +1 -0
- package/dist/orders-c7cbe706.mjs +85 -0
- package/dist/organizations-71777b32.js +1 -0
- package/dist/organizations-93f7b610.mjs +122 -0
- package/dist/organizations.client-6ca27fb3.js +3 -0
- package/dist/organizations.client-bd63a7b2.mjs +2997 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +56 -61
- package/dist/products-61d83d74.js +1 -0
- package/dist/products-7f1e5a75.mjs +108 -0
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +72 -2
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -72
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +78 -2
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -78
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +4 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +61 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -4
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -61
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +24 -21
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/LeftoverAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/LeftoverAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/reports-a67b4fb4.js +1 -0
- package/dist/reports-c579b02a.mjs +91 -0
- package/dist/reports.client.cjs +1 -1
- package/dist/reports.client.js +2 -2
- package/dist/states.validation-3b4604bc.mjs +13 -0
- package/dist/states.validation-9b43a097.js +1 -0
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +279 -208
- package/package.json +1 -1
- package/src/components/Search/Search.vue +1 -1
- package/src/components/Status/Status.vue +1 -1
- package/src/modules/backoffice/components/admin/Backcalls.vue +1 -1
- package/src/modules/backoffice/components/admin/Categories.vue +1 -1
- package/src/modules/backoffice/components/admin/CategoryEdit.vue +1 -1
- package/src/modules/backoffice/components/admin/Dashboard.vue +1 -1
- package/src/modules/backoffice/components/admin/FastOrders.vue +1 -1
- package/src/modules/backoffice/components/admin/PageEdit.vue +1 -1
- package/src/modules/backoffice/components/admin/Pages.vue +1 -1
- package/src/modules/backoffice/components/admin/User.vue +1 -1
- package/src/modules/backoffice/components/admin/Users.vue +1 -1
- package/src/modules/events/components/pages/Events.vue +2 -2
- package/src/modules/orders/components/blocks/Positions.vue +1 -1
- package/src/modules/orders/components/pages/ViewOrder.vue +1 -1
- package/src/modules/products/components/sections/ProductInformationSection.vue +2 -5
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),z=require("./Field-e2a43424.js"),U=require("./Button-7643c9aa.js"),M=require("./Select-95f4701a.js"),B=require("./axios-ceccf20e.js"),G=require("./vue-draggable-next.esm-bundler-21a209c6.js"),j=require("./UploadImageMultiple-d1316df5.js"),D=require("./_plugin-vue_export-helper-f246444f.js");require("./Field.vue_vue_type_style_index_0_scoped_f4a29b0d_lang-0ea8fbf8.js");require("./Button.vue_vue_type_style_index_0_lang-0ea8fbf8.js");require("./Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-0ea8fbf8.js");const L=process.env.API_URL,V=B.axios.create({baseURL:L,withCredentials:!0}),u=e.reactive({gallery:[]}),v={async fetchGallery(a,t){const c=[];a&&c.push(`page=${a}`),t&&c.push(`limit=${t}`);const o=`/api/gallery${c.length?`?${c.join("&")}`:""}`;try{const s=await V.get(o);if(console.log(s),s&&s.data)return u.gallery=[...u.gallery,...s.data],s.data}catch(s){throw console.error("Error fetching gallery:",s),s}},async createPhoto(a){try{const t=await V.post("/api/gallery/create",a);console.log(t.data),u.gallery=[...t.data,...u.gallery]}catch(t){console.error(t)}},async updatePhoto(a){try{const t={...a,categories:typeof a.categories=="string"?a.categories.split(",").map(s=>s.trim()):a.categories},c=await B.axios.post("/api/gallery/update",t),o=u.gallery.findIndex(s=>s._id===a._id);o!==-1&&(u.gallery[o]=c.data)}catch(t){console.error(t)}},async deletePhoto(a){try{const t=await V.post(`/api/gallery/delete/${a}`),c=u.gallery.findIndex(o=>o._id===a);c!==-1&&u.gallery.splice(c,1)}catch(t){console.error(t)}}};const F={class:"pos-relative"},R=["src"],T=["onClick"],A={__name:"EditImages",props:{images:Array},emits:["update"],setup(a,{emit:t}){const c=a,o=e.ref([...c.images]);e.watchEffect(()=>{o.value=[...c.images]});const s=()=>{t("update:images",o.value)},h=i=>{o.value=[...o.value,...i],s()},f=i=>{o.value.splice(i,1),s()};return(i,y)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(j._sfc_main,{"onUpdate:images":h,uploadPath:"photos",class:"mn-semi pd-small w-100 button bg-black t-white"}),e.createVNode(e.unref(G.VueDraggableNext),{class:"gap-small flex dragArea list-group w-full",modelValue:o.value,"onUpdate:modelValue":y[0]||(y[0]=m=>o.value=m),onChange:s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(m,E)=>(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("img",{class:"i-extra radius-small o-hidden mn-thin",src:(i.FILE_SERVER_URL||"")+m},null,8,R),e.createElementVNode("a",{onClick:p=>f(E),class:"pos-absolute t-center radius-extra i-medium bg-red pos-t-0 pos-r-0"},"X",8,T)]))),256))]),_:1},8,["modelValue"])]))}};const _=a=>(e.pushScopeId("data-v-d6a1c805"),a=a(),e.popScopeId(),a),O={class:"pos-relative w-100"},H={class:"mn-semi flex-v-center flex-nowrap flex"},X=_(()=>e.createElementVNode("h1",{class:"mn-r-small"},"Manage Gallery",-1)),J=["data-id"],K=["src","onClick"],Q={key:1,class:"radius-small bg-white"},W=["src","onClick"],Y={class:"t-black p-small mn-thin"},Z=_(()=>e.createElementVNode("span",{class:"uppercase t-transp"},"Size",-1)),ee=_(()=>e.createElementVNode("br",null,null,-1)),te={class:"pd-2px radius-big d-inline-block bg-grey"},le={class:"t-black p-small mn-small uppe"},ae=_(()=>e.createElementVNode("span",{class:"uppercase t-transp"},"Categories",-1)),oe=_(()=>e.createElementVNode("br",null,null,-1)),se={class:"pd-2px radius-big d-inline-block bg-grey t-semi"},ne={class:"flex-nowrap flex"},ce=["onClick"],re={class:"modal pd-thin"},ie={class:"modal-content radius-big"},de={class:""},ue=["src"],me={key:0,class:"flex-v-center flex m modal pd-big"},pe={class:"modal-content radius-small pd-medium bg-white"},ge=["src"],ve=["src"],_e={__name:"BackofficeGallery",setup(a){const t=e.ref(!0),c=e.ref(null);let o=1;const s=10;let h=e.ref(null),f=e.ref(!1);const i=e.ref([]),y=r=>{i.value=r},m=e.computed(()=>x.value==="all"?u.gallery:u.gallery.filter(r=>r.categories.includes(x.value))),E=async()=>{f.value=!0,await v.fetchGallery(o,s),f.value=!1},p=e.ref(null),l=e.ref({categories:"",size:"",image:!1}),k=e.ref(null),w=r=>{console.log(t.value),t.value?C(r):(p.value="modal",l.value.image=r,N())},C=r=>{p.value="edit-modal",l.value=r||{categories:"",size:"",image:null},N()},g=()=>{l.value={categories:"",size:"",image:!1},k.value=null,I()},N=()=>{document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"},I=()=>{document.body.style.overflow="",document.documentElement.style.overflow=""},S=[{name:"Small",value:""},{name:"Regular",value:"grid-item--width1 grid-item--height1"},{name:"Medium",value:"grid-item--width2 grid-item--height2"},{name:"Big",value:"grid-item--width3 grid-item--height3"}],$=async r=>{await v.deletePhoto(r)},P=async()=>{await v.updatePhoto(l.value),g()},q=async r=>{if(i.length<1||!l.value.categories||!l.value.size){console.error("All fields are required.");return}await v.createPhoto({images:i.value,size:l.value.size,categories:typeof l.value.categories=="string"?l.value.categories.split(",").map(d=>d.trim()):l.value.categories}),g()};let x=e.ref("all");return e.onMounted(async()=>{await v.fetchGallery(o,s),typeof window<"u"&&new IntersectionObserver(d=>{d.some(n=>n.isIntersecting)&&(o+=1,E())}).observe(h.value)}),(r,d)=>(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",H,[X,t.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:d[0]||(d[0]=n=>w(null)),class:"t-white t-black bg-second i-big radius-extra"},"+")):e.createCommentVNode("",!0)]),e.createElementVNode("div",{ref_key:"grid",ref:c,class:"cols-4 gap-thin"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(n,fe)=>(e.openBlock(),e.createElementBlock("div",{key:n.id,"data-id":n.id},[e.createVNode(e.Transition,{name:"scaleIn",mode:"in-out"},{default:e.withCtx(()=>[!t.value&&c.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:"https://thecommunephuket.com/photos/"+n.cover,class:"w-100 h-100 o-hidden radius-medium object-fit-cover",onClick:b=>w(n.image)},null,8,K)):(e.openBlock(),e.createElementBlock("div",Q,[e.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+n.cover,class:"w-100 radius-small mn-small h-10r object-fit-cover",onClick:b=>w(n)},null,8,W),e.createElementVNode("p",Y,[Z,ee,e.createElementVNode("span",te,e.toDisplayString(n.size.name),1)]),e.createElementVNode("p",le,[ae,oe,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.categories,b=>(e.openBlock(),e.createElementBlock("span",se,e.toDisplayString(b),1))),256))]),e.createElementVNode("div",ne,[e.createElementVNode("button",{class:"button-small w-100 button",onClick:b=>$(n._id)},"Delete",8,ce)])]))]),_:2},1024)],8,J))),128)),e.createElementVNode("div",{ref_key:"sentinel",ref:h,class:"sentinel"},null,512),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",re,[e.createElementVNode("div",ie,[e.createElementVNode("div",de,[e.createElementVNode("span",{class:"close",onClick:g},"×"),e.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+l.value.image},null,8,ue)])])],512),[[e.vShow,l.value.image!==!1&&p.value==="modal"]])]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[l.value.image!==!1&&p.value==="edit-modal"?(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",pe,[e.createElementVNode("span",{class:"close",onClick:g},"×"),typeof k.value=="string"?(e.openBlock(),e.createElementBlock("img",{key:0,src:k.value,class:"radius-small w-100 mn-small h-20r object-fit-cover"},null,8,ge)):e.createCommentVNode("",!0),typeof k.value=="object"&&l.value.image!==null?(e.openBlock(),e.createElementBlock("img",{key:1,class:"radius-small w-100 mn-small h-20r object-fit-cover",src:"/photos/"+l.value.cover},null,8,ve)):e.createCommentVNode("",!0),e.createVNode(M.Select,{options:S,label:"Size",select:l.value.size,"onUpdate:select":d[1]||(d[1]=n=>l.value.size=n),placeholder:"Select Size",class:"bg-grey pd-thin radius-small mn-thin t-black"},null,8,["select"]),e.createVNode(z.Field,{field:l.value.categories,"onUpdate:field":d[2]||(d[2]=n=>l.value.categories=n),type:"text",label:"Categories",placeholder:"Enter categories for image (comma separated)",class:"bg-grey pd-thin radius-small mn-medium t-black"},null,8,["field"]),e.createVNode(A,{images:i.value,"onUpdate:images":y,uploadPath:"photos",class:"mn-semi"},null,8,["images"]),e.createVNode(U._sfc_main,{submit:l.value._id?P:q,callback:g,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value._id?"Update":"Create"),1)]),_:1},8,["submit"])])])):e.createCommentVNode("",!0)]),_:1})],512)]))}},he=D._export_sfc(_e,[["__scopeId","data-v-d6a1c805"]]);exports.default=he;
|
@@ -0,0 +1,307 @@
|
|
1
|
+
import { reactive as q, ref as p, watchEffect as X, openBlock as r, createElementBlock as c, createVNode as _, unref as R, withCtx as b, Fragment as G, renderList as M, createElementVNode as e, computed as H, onMounted as J, createCommentVNode as S, Transition as z, toDisplayString as U, withDirectives as K, vShow as Q, createTextVNode as W, pushScopeId as Y, popScopeId as Z } from "vue";
|
2
|
+
import { F as ee } from "./Field-e5ad88d3.mjs";
|
3
|
+
import { _ as te } from "./Button-9e1a9284.mjs";
|
4
|
+
import { S as ae } from "./Select-dab17282.mjs";
|
5
|
+
import { a as L } from "./axios-33aeb810.mjs";
|
6
|
+
import { V as se } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
|
7
|
+
import { _ as le } from "./UploadImageMultiple-c34a6c6f.mjs";
|
8
|
+
import { _ as oe } from "./_plugin-vue_export-helper-dad06003.mjs";
|
9
|
+
import "./Field.vue_vue_type_style_index_0_scoped_f4a29b0d_lang-4ed993c7.mjs";
|
10
|
+
import "./Button.vue_vue_type_style_index_0_lang-4ed993c7.mjs";
|
11
|
+
import "./Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-4ed993c7.mjs";
|
12
|
+
const ie = process.env.API_URL, V = L.create({ baseURL: ie, withCredentials: !0 }), g = q({
|
13
|
+
gallery: []
|
14
|
+
}), y = {
|
15
|
+
async fetchGallery(s, t) {
|
16
|
+
const n = [];
|
17
|
+
s && n.push(`page=${s}`), t && n.push(`limit=${t}`);
|
18
|
+
const l = `/api/gallery${n.length ? `?${n.join("&")}` : ""}`;
|
19
|
+
try {
|
20
|
+
const o = await V.get(l);
|
21
|
+
if (console.log(o), o && o.data)
|
22
|
+
return g.gallery = [...g.gallery, ...o.data], o.data;
|
23
|
+
} catch (o) {
|
24
|
+
throw console.error("Error fetching gallery:", o), o;
|
25
|
+
}
|
26
|
+
},
|
27
|
+
async createPhoto(s) {
|
28
|
+
try {
|
29
|
+
const t = await V.post("/api/gallery/create", s);
|
30
|
+
console.log(t.data), g.gallery = [...t.data, ...g.gallery];
|
31
|
+
} catch (t) {
|
32
|
+
console.error(t);
|
33
|
+
}
|
34
|
+
},
|
35
|
+
async updatePhoto(s) {
|
36
|
+
try {
|
37
|
+
const t = {
|
38
|
+
...s,
|
39
|
+
categories: typeof s.categories == "string" ? s.categories.split(",").map((o) => o.trim()) : s.categories
|
40
|
+
}, n = await L.post("/api/gallery/update", t), l = g.gallery.findIndex((o) => o._id === s._id);
|
41
|
+
l !== -1 && (g.gallery[l] = n.data);
|
42
|
+
} catch (t) {
|
43
|
+
console.error(t);
|
44
|
+
}
|
45
|
+
},
|
46
|
+
async deletePhoto(s) {
|
47
|
+
try {
|
48
|
+
const t = await V.post(`/api/gallery/delete/${s}`), n = g.gallery.findIndex((l) => l._id === s);
|
49
|
+
n !== -1 && g.gallery.splice(n, 1);
|
50
|
+
} catch (t) {
|
51
|
+
console.error(t);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
};
|
55
|
+
const ne = { class: "pos-relative" }, re = ["src"], ce = ["onClick"], de = {
|
56
|
+
__name: "EditImages",
|
57
|
+
props: {
|
58
|
+
images: Array
|
59
|
+
},
|
60
|
+
emits: ["update"],
|
61
|
+
setup(s, { emit: t }) {
|
62
|
+
const n = s, l = p([...n.images]);
|
63
|
+
X(() => {
|
64
|
+
l.value = [...n.images];
|
65
|
+
});
|
66
|
+
const o = () => {
|
67
|
+
t("update:images", l.value);
|
68
|
+
}, k = (u) => {
|
69
|
+
l.value = [...l.value, ...u], o();
|
70
|
+
}, x = (u) => {
|
71
|
+
l.value.splice(u, 1), o();
|
72
|
+
};
|
73
|
+
return (u, C) => (r(), c("div", null, [
|
74
|
+
_(le, {
|
75
|
+
"onUpdate:images": k,
|
76
|
+
uploadPath: "photos",
|
77
|
+
class: "mn-semi pd-small w-100 button bg-black t-white"
|
78
|
+
}),
|
79
|
+
_(R(se), {
|
80
|
+
class: "gap-small flex dragArea list-group w-full",
|
81
|
+
modelValue: l.value,
|
82
|
+
"onUpdate:modelValue": C[0] || (C[0] = (v) => l.value = v),
|
83
|
+
onChange: o
|
84
|
+
}, {
|
85
|
+
default: b(() => [
|
86
|
+
(r(!0), c(G, null, M(l.value, (v, E) => (r(), c("div", ne, [
|
87
|
+
e("img", {
|
88
|
+
class: "i-extra radius-small o-hidden mn-thin",
|
89
|
+
src: (u.FILE_SERVER_URL || "") + v
|
90
|
+
}, null, 8, re),
|
91
|
+
e("a", {
|
92
|
+
onClick: (h) => x(E),
|
93
|
+
class: "pos-absolute t-center radius-extra i-medium bg-red pos-t-0 pos-r-0"
|
94
|
+
}, "X", 8, ce)
|
95
|
+
]))), 256))
|
96
|
+
]),
|
97
|
+
_: 1
|
98
|
+
}, 8, ["modelValue"])
|
99
|
+
]));
|
100
|
+
}
|
101
|
+
};
|
102
|
+
const w = (s) => (Y("data-v-d6a1c805"), s = s(), Z(), s), ue = { class: "pos-relative w-100" }, me = { class: "mn-semi flex-v-center flex-nowrap flex" }, pe = /* @__PURE__ */ w(() => /* @__PURE__ */ e("h1", { class: "mn-r-small" }, "Manage Gallery", -1)), ge = ["data-id"], _e = ["src", "onClick"], ve = {
|
103
|
+
key: 1,
|
104
|
+
class: "radius-small bg-white"
|
105
|
+
}, he = ["src", "onClick"], fe = { class: "t-black p-small mn-thin" }, ye = /* @__PURE__ */ w(() => /* @__PURE__ */ e("span", { class: "uppercase t-transp" }, "Size", -1)), be = /* @__PURE__ */ w(() => /* @__PURE__ */ e("br", null, null, -1)), we = { class: "pd-2px radius-big d-inline-block bg-grey" }, ke = { class: "t-black p-small mn-small uppe" }, xe = /* @__PURE__ */ w(() => /* @__PURE__ */ e("span", { class: "uppercase t-transp" }, "Categories", -1)), Ce = /* @__PURE__ */ w(() => /* @__PURE__ */ e("br", null, null, -1)), Ie = { class: "pd-2px radius-big d-inline-block bg-grey t-semi" }, $e = { class: "flex-nowrap flex" }, Se = ["onClick"], Ee = { class: "modal pd-thin" }, Pe = { class: "modal-content radius-big" }, ze = { class: "" }, Ue = ["src"], Ve = {
|
106
|
+
key: 0,
|
107
|
+
class: "flex-v-center flex m modal pd-big"
|
108
|
+
}, Ge = { class: "modal-content radius-small pd-medium bg-white" }, Me = ["src"], je = ["src"], Be = {
|
109
|
+
__name: "BackofficeGallery",
|
110
|
+
setup(s) {
|
111
|
+
const t = p(!0), n = p(null);
|
112
|
+
let l = 1;
|
113
|
+
const o = 10;
|
114
|
+
let k = p(null), x = p(!1);
|
115
|
+
const u = p([]), C = (d) => {
|
116
|
+
u.value = d;
|
117
|
+
}, v = H(() => B.value === "all" ? g.gallery : g.gallery.filter((d) => d.categories.includes(B.value))), E = async () => {
|
118
|
+
x.value = !0, await y.fetchGallery(l, o), x.value = !1;
|
119
|
+
}, h = p(null), a = p({
|
120
|
+
categories: "",
|
121
|
+
size: "",
|
122
|
+
image: !1
|
123
|
+
}), I = p(null), P = (d) => {
|
124
|
+
console.log(t.value), t.value ? N(d) : (h.value = "modal", a.value.image = d, j());
|
125
|
+
}, N = (d) => {
|
126
|
+
h.value = "edit-modal", a.value = d || {
|
127
|
+
categories: "",
|
128
|
+
size: "",
|
129
|
+
image: null
|
130
|
+
}, j();
|
131
|
+
}, f = () => {
|
132
|
+
a.value = {
|
133
|
+
categories: "",
|
134
|
+
size: "",
|
135
|
+
image: !1
|
136
|
+
}, I.value = null, A();
|
137
|
+
}, j = () => {
|
138
|
+
document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden";
|
139
|
+
}, A = () => {
|
140
|
+
document.body.style.overflow = "", document.documentElement.style.overflow = "";
|
141
|
+
}, D = [
|
142
|
+
{ name: "Small", value: "" },
|
143
|
+
{ name: "Regular", value: "grid-item--width1 grid-item--height1" },
|
144
|
+
{ name: "Medium", value: "grid-item--width2 grid-item--height2" },
|
145
|
+
{ name: "Big", value: "grid-item--width3 grid-item--height3" }
|
146
|
+
], F = async (d) => {
|
147
|
+
await y.deletePhoto(d);
|
148
|
+
}, O = async () => {
|
149
|
+
await y.updatePhoto(a.value), f();
|
150
|
+
}, T = async (d) => {
|
151
|
+
if (u.length < 1 || !a.value.categories || !a.value.size) {
|
152
|
+
console.error("All fields are required.");
|
153
|
+
return;
|
154
|
+
}
|
155
|
+
await y.createPhoto({
|
156
|
+
images: u.value,
|
157
|
+
size: a.value.size,
|
158
|
+
categories: typeof a.value.categories == "string" ? a.value.categories.split(",").map((m) => m.trim()) : a.value.categories
|
159
|
+
}), f();
|
160
|
+
};
|
161
|
+
let B = p("all");
|
162
|
+
return J(async () => {
|
163
|
+
await y.fetchGallery(l, o), typeof window < "u" && new IntersectionObserver((m) => {
|
164
|
+
m.some((i) => i.isIntersecting) && (l += 1, E());
|
165
|
+
}).observe(k.value);
|
166
|
+
}), (d, m) => (r(), c("div", ue, [
|
167
|
+
e("div", me, [
|
168
|
+
pe,
|
169
|
+
t.value ? (r(), c("button", {
|
170
|
+
key: 0,
|
171
|
+
onClick: m[0] || (m[0] = (i) => P(null)),
|
172
|
+
class: "t-white t-black bg-second i-big radius-extra"
|
173
|
+
}, "+")) : S("", !0)
|
174
|
+
]),
|
175
|
+
e("div", {
|
176
|
+
ref_key: "grid",
|
177
|
+
ref: n,
|
178
|
+
class: "cols-4 gap-thin"
|
179
|
+
}, [
|
180
|
+
(r(!0), c(G, null, M(R(v), (i, Re) => (r(), c("div", {
|
181
|
+
key: i.id,
|
182
|
+
"data-id": i.id
|
183
|
+
}, [
|
184
|
+
_(z, {
|
185
|
+
name: "scaleIn",
|
186
|
+
mode: "in-out"
|
187
|
+
}, {
|
188
|
+
default: b(() => [
|
189
|
+
!t.value && n.value ? (r(), c("img", {
|
190
|
+
key: 0,
|
191
|
+
src: "https://thecommunephuket.com/photos/" + i.cover,
|
192
|
+
class: "w-100 h-100 o-hidden radius-medium object-fit-cover",
|
193
|
+
onClick: ($) => P(i.image)
|
194
|
+
}, null, 8, _e)) : (r(), c("div", ve, [
|
195
|
+
e("img", {
|
196
|
+
src: "https://thecommunephuket.com/photos/" + i.cover,
|
197
|
+
class: "w-100 radius-small mn-small h-10r object-fit-cover",
|
198
|
+
onClick: ($) => P(i)
|
199
|
+
}, null, 8, he),
|
200
|
+
e("p", fe, [
|
201
|
+
ye,
|
202
|
+
be,
|
203
|
+
e("span", we, U(i.size.name), 1)
|
204
|
+
]),
|
205
|
+
e("p", ke, [
|
206
|
+
xe,
|
207
|
+
Ce,
|
208
|
+
(r(!0), c(G, null, M(i.categories, ($) => (r(), c("span", Ie, U($), 1))), 256))
|
209
|
+
]),
|
210
|
+
e("div", $e, [
|
211
|
+
e("button", {
|
212
|
+
class: "button-small w-100 button",
|
213
|
+
onClick: ($) => F(i._id)
|
214
|
+
}, "Delete", 8, Se)
|
215
|
+
])
|
216
|
+
]))
|
217
|
+
]),
|
218
|
+
_: 2
|
219
|
+
}, 1024)
|
220
|
+
], 8, ge))), 128)),
|
221
|
+
e("div", {
|
222
|
+
ref_key: "sentinel",
|
223
|
+
ref: k,
|
224
|
+
class: "sentinel"
|
225
|
+
}, null, 512),
|
226
|
+
_(z, { name: "modal" }, {
|
227
|
+
default: b(() => [
|
228
|
+
K(e("div", Ee, [
|
229
|
+
e("div", Pe, [
|
230
|
+
e("div", ze, [
|
231
|
+
e("span", {
|
232
|
+
class: "close",
|
233
|
+
onClick: f
|
234
|
+
}, "×"),
|
235
|
+
e("img", {
|
236
|
+
src: "https://thecommunephuket.com/photos/" + a.value.image
|
237
|
+
}, null, 8, Ue)
|
238
|
+
])
|
239
|
+
])
|
240
|
+
], 512), [
|
241
|
+
[Q, a.value.image !== !1 && h.value === "modal"]
|
242
|
+
])
|
243
|
+
]),
|
244
|
+
_: 1
|
245
|
+
}),
|
246
|
+
_(z, { name: "modal" }, {
|
247
|
+
default: b(() => [
|
248
|
+
a.value.image !== !1 && h.value === "edit-modal" ? (r(), c("div", Ve, [
|
249
|
+
e("div", Ge, [
|
250
|
+
e("span", {
|
251
|
+
class: "close",
|
252
|
+
onClick: f
|
253
|
+
}, "×"),
|
254
|
+
typeof I.value == "string" ? (r(), c("img", {
|
255
|
+
key: 0,
|
256
|
+
src: I.value,
|
257
|
+
class: "radius-small w-100 mn-small h-20r object-fit-cover"
|
258
|
+
}, null, 8, Me)) : S("", !0),
|
259
|
+
typeof I.value == "object" && a.value.image !== null ? (r(), c("img", {
|
260
|
+
key: 1,
|
261
|
+
class: "radius-small w-100 mn-small h-20r object-fit-cover",
|
262
|
+
src: "/photos/" + a.value.cover
|
263
|
+
}, null, 8, je)) : S("", !0),
|
264
|
+
_(ae, {
|
265
|
+
options: D,
|
266
|
+
label: "Size",
|
267
|
+
select: a.value.size,
|
268
|
+
"onUpdate:select": m[1] || (m[1] = (i) => a.value.size = i),
|
269
|
+
placeholder: "Select Size",
|
270
|
+
class: "bg-grey pd-thin radius-small mn-thin t-black"
|
271
|
+
}, null, 8, ["select"]),
|
272
|
+
_(ee, {
|
273
|
+
field: a.value.categories,
|
274
|
+
"onUpdate:field": m[2] || (m[2] = (i) => a.value.categories = i),
|
275
|
+
type: "text",
|
276
|
+
label: "Categories",
|
277
|
+
placeholder: "Enter categories for image (comma separated)",
|
278
|
+
class: "bg-grey pd-thin radius-small mn-medium t-black"
|
279
|
+
}, null, 8, ["field"]),
|
280
|
+
_(de, {
|
281
|
+
images: u.value,
|
282
|
+
"onUpdate:images": C,
|
283
|
+
uploadPath: "photos",
|
284
|
+
class: "mn-semi"
|
285
|
+
}, null, 8, ["images"]),
|
286
|
+
_(te, {
|
287
|
+
submit: a.value._id ? O : T,
|
288
|
+
callback: f,
|
289
|
+
class: "mn-thin"
|
290
|
+
}, {
|
291
|
+
default: b(() => [
|
292
|
+
W(U(a.value._id ? "Update" : "Create"), 1)
|
293
|
+
]),
|
294
|
+
_: 1
|
295
|
+
}, 8, ["submit"])
|
296
|
+
])
|
297
|
+
])) : S("", !0)
|
298
|
+
]),
|
299
|
+
_: 1
|
300
|
+
})
|
301
|
+
], 512)
|
302
|
+
]));
|
303
|
+
}
|
304
|
+
}, Ke = /* @__PURE__ */ oe(Be, [["__scopeId", "data-v-d6a1c805"]]);
|
305
|
+
export {
|
306
|
+
Ke as default
|
307
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./reports-a67b4fb4.js");require("./globals-928eb13c.js");require("vue-i18n");require("./axios-ceccf20e.js");const l=e.createElementVNode("div",{class:"flex-v-center flex-nowrap flex mn-medium"},[e.createElementVNode("h3",{class:"mn-r-medium"},"Reports")],-1),n={class:"cols-3 gap-thin"},a={class:"t-black p-small mn-small"},o=e.createElementVNode("span",{class:"uppercase t-transp"},"User",-1),c=e.createElementVNode("br",null,null,-1),r={class:"pd-2px radius-big d-inline-block bg-grey t-semi"},i={class:"t-black p-small mn-small"},d=e.createElementVNode("span",{class:"uppercase t-transp"},"Type",-1),m=e.createElementVNode("br",null,null,-1),p={class:"pd-2px radius-big d-inline-block bg-grey t-semi"},u={class:"t-black p-small mn-small"},_=e.createElementVNode("span",{class:"uppercase t-transp"},"Reason",-1),b=e.createElementVNode("br",null,null,-1),g={class:"pd-2px radius-big d-inline-block bg-grey t-semi"},h=e.createElementVNode("div",{class:"gap-thin flex-nowrap flex"},[e.createElementVNode("button",{class:"button-small w-100 bg-black t-white button"}," Close Report "),e.createElementVNode("button",{class:"button-small w-100 bg-black t-white button"}," Hide Content ")],-1),E={__name:"BackofficeReports",setup(N){return s.actions.read(),(V,k)=>(e.openBlock(),e.createElementBlock("div",null,[l,e.createElementVNode("div",n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s.state).all,t=>(e.openBlock(),e.createElementBlock("div",{key:t._id,class:"radius-medium pd-small bg-grey"},[e.createElementVNode("p",a,[o,c,e.createElementVNode("span",r,e.toDisplayString(t.user),1)]),e.createElementVNode("p",i,[d,m,e.createElementVNode("span",p,e.toDisplayString(t.type),1)]),e.createElementVNode("p",u,[_,b,e.createElementVNode("span",g,e.toDisplayString(t.reason),1)]),h]))),128))])]))}};exports.default=E;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { openBlock as e, createElementBlock as l, createElementVNode as s, Fragment as a, renderList as o, unref as c, toDisplayString as n } from "vue";
|
2
|
+
import { a as i, s as p } from "./reports-c579b02a.mjs";
|
3
|
+
import "./globals-96ba60e4.mjs";
|
4
|
+
import "vue-i18n";
|
5
|
+
import "./axios-33aeb810.mjs";
|
6
|
+
const r = /* @__PURE__ */ s("div", { class: "flex-v-center flex-nowrap flex mn-medium" }, [
|
7
|
+
/* @__PURE__ */ s("h3", { class: "mn-r-medium" }, "Reports")
|
8
|
+
], -1), d = { class: "cols-3 gap-thin" }, _ = { class: "t-black p-small mn-small" }, m = /* @__PURE__ */ s("span", { class: "uppercase t-transp" }, "User", -1), u = /* @__PURE__ */ s("br", null, null, -1), b = { class: "pd-2px radius-big d-inline-block bg-grey t-semi" }, h = { class: "t-black p-small mn-small" }, g = /* @__PURE__ */ s("span", { class: "uppercase t-transp" }, "Type", -1), f = /* @__PURE__ */ s("br", null, null, -1), k = { class: "pd-2px radius-big d-inline-block bg-grey t-semi" }, x = { class: "t-black p-small mn-small" }, y = /* @__PURE__ */ s("span", { class: "uppercase t-transp" }, "Reason", -1), v = /* @__PURE__ */ s("br", null, null, -1), w = { class: "pd-2px radius-big d-inline-block bg-grey t-semi" }, R = /* @__PURE__ */ s("div", { class: "gap-thin flex-nowrap flex" }, [
|
9
|
+
/* @__PURE__ */ s("button", { class: "button-small w-100 bg-black t-white button" }, " Close Report "),
|
10
|
+
/* @__PURE__ */ s("button", { class: "button-small w-100 bg-black t-white button" }, " Hide Content ")
|
11
|
+
], -1), S = {
|
12
|
+
__name: "BackofficeReports",
|
13
|
+
setup(B) {
|
14
|
+
return i.read(), (C, E) => (e(), l("div", null, [
|
15
|
+
r,
|
16
|
+
s("div", d, [
|
17
|
+
(e(!0), l(a, null, o(c(p).all, (t) => (e(), l("div", {
|
18
|
+
key: t._id,
|
19
|
+
class: "radius-medium pd-small bg-grey"
|
20
|
+
}, [
|
21
|
+
s("p", _, [
|
22
|
+
m,
|
23
|
+
u,
|
24
|
+
s("span", b, n(t.user), 1)
|
25
|
+
]),
|
26
|
+
s("p", h, [
|
27
|
+
g,
|
28
|
+
f,
|
29
|
+
s("span", k, n(t.type), 1)
|
30
|
+
]),
|
31
|
+
s("p", x, [
|
32
|
+
y,
|
33
|
+
v,
|
34
|
+
s("span", w, n(t.reason), 1)
|
35
|
+
]),
|
36
|
+
R
|
37
|
+
]))), 128))
|
38
|
+
])
|
39
|
+
]));
|
40
|
+
}
|
41
|
+
};
|
42
|
+
export {
|
43
|
+
S as default
|
44
|
+
};
|