@ozdao/prometheus-framework 0.1.62 → 0.1.66
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/BackofficeGallery-30022293.js +1 -0
- package/dist/BackofficeGallery-f64daa0d.mjs +264 -0
- package/dist/BackofficeReports-cb4b180d.mjs +44 -0
- package/dist/BackofficeReports-d021871f.js +1 -0
- package/dist/BlockTags-8cddaef7.js +1 -0
- package/dist/BlockTags-ee310572.mjs +853 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/Button-7643c9aa.js +1 -0
- package/dist/Button-9e1a9284.mjs +226 -0
- package/dist/Button.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Button.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/ButtonToggleMembership-7ee4dc8e.mjs +90 -0
- package/dist/ButtonToggleMembership-b9352cec.js +1 -0
- package/dist/CardBlogpost-3c92fbc9.mjs +246 -0
- package/dist/CardBlogpost-c7364b1e.js +1 -0
- package/dist/CardOrganization-647cb571.js +1 -0
- package/dist/CardOrganization-facb77f7.mjs +234 -0
- package/dist/CardProduct-92affca1.js +1 -0
- package/dist/CardProduct-fca53299.mjs +193 -0
- package/dist/Checkbox-5dbe7b23.mjs +62 -0
- package/dist/Checkbox-76f09248.js +1 -0
- package/dist/Chips-0fdb31c9.js +1 -0
- package/dist/Chips-f1a0d085.mjs +214 -0
- package/dist/Community-534d473c.mjs +132 -0
- package/dist/Community-e9aff969.js +1 -0
- package/dist/Dashboard-91d73bc5.js +1 -0
- package/dist/Dashboard-ea9035bc.mjs +152 -0
- package/dist/Dropdown-31115457.js +1 -0
- package/dist/Dropdown-cab3605b.mjs +146 -0
- package/dist/EULA-aba6a807.js +1 -0
- package/dist/EULA-e05236af.mjs +4210 -0
- package/dist/EditOrder-94bbebff.mjs +221 -0
- package/dist/EditOrder-c070d474.js +1 -0
- package/dist/EmptyState-d65bab5b.js +1 -0
- package/dist/EmptyState-e404b05d.mjs +36 -0
- package/dist/Events-46ae8fc6.mjs +123 -0
- package/dist/Events-813c8c7b.js +1 -0
- package/dist/Feed-2d443ad2.mjs +146 -0
- package/dist/Feed-3a4e7a9c.js +1 -0
- package/dist/Feed-8b554fc1.js +1 -0
- package/dist/Feed-98b47c6f.js +1 -0
- package/dist/Feed-a21d6007.mjs +124 -0
- package/dist/Feed-b39138c8.js +1 -0
- package/dist/Feed-c41ef736.mjs +361 -0
- package/dist/Feed-d114330c.mjs +112 -0
- package/dist/Field-e2a43424.js +1 -0
- package/dist/Field-e5ad88d3.mjs +75 -0
- package/dist/Field.vue_vue_type_style_index_0_scoped_f4a29b0d_lang-0ea8fbf8.js +1 -0
- package/dist/Field.vue_vue_type_style_index_0_scoped_f4a29b0d_lang-4ed993c7.mjs +1 -0
- package/dist/Gallery-46b5f939.js +1 -0
- package/dist/Gallery-762a9c2d.mjs +241 -0
- package/dist/IconChevronRight-a55f838e.js +1 -0
- package/dist/IconChevronRight-fae9d012.mjs +28 -0
- package/dist/IconCommunity-468dc457.mjs +65 -0
- package/dist/IconCommunity-b339e806.js +1 -0
- package/dist/IconCross-5bf93179.js +1 -0
- package/dist/IconCross-84cb1292.mjs +28 -0
- package/dist/IconEdit-9edfd74d.mjs +21 -0
- package/dist/IconEdit-c0469b45.js +1 -0
- package/dist/Image-4dcfddb8.js +9 -0
- package/dist/Image-e0da17ac.mjs +571 -0
- package/dist/LabelGooglePlay-24feb437.mjs +31 -0
- package/dist/LabelGooglePlay-f80e5ff0.js +1 -0
- package/dist/LeftoverAdd-5a8988d9.js +1 -0
- package/dist/LeftoverAdd-c4f37f47.mjs +227 -0
- package/dist/Leftovers-470a1689.js +1 -0
- package/dist/Leftovers-69c7dcd9.mjs +136 -0
- package/dist/Loader-21f016da.js +1 -0
- package/dist/Loader-cd422786.mjs +41 -0
- package/dist/Loader.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Loader.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/Members-04273cd4.mjs +114 -0
- package/dist/Members-0685a15f.js +1 -0
- package/dist/Menu-b5d6a0c7.js +1 -0
- package/dist/Menu-dd7645c1.mjs +13 -0
- package/dist/MenuItem-56ae7f94.js +1 -0
- package/dist/MenuItem-6296d02f.mjs +63 -0
- package/dist/Orders-b64e8cb9.js +1 -0
- package/dist/Orders-ff30db05.mjs +75 -0
- package/dist/Organizations-46aab2c8.mjs +73 -0
- package/dist/Organizations-a8627bc5.js +1 -0
- package/dist/Payments-53e5fecf.js +1 -0
- package/dist/Payments-82e545e1.mjs +87 -0
- package/dist/PlaceholderUserpic-14c6ea7e.mjs +28 -0
- package/dist/PlaceholderUserpic-47f6f319.js +1 -0
- package/dist/Popup-0915427c.mjs +74 -0
- package/dist/Popup-795f5c88.js +1 -0
- package/dist/Popup.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Popup.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/Product-7e001b81.js +7 -0
- package/dist/Product-f3f42158.mjs +653 -0
- package/dist/ProductEdit-959b3cd3.mjs +295 -0
- package/dist/ProductEdit-bae5e898.js +1 -0
- package/dist/ProductsBackoffice-0716123f.js +1 -0
- package/dist/ProductsBackoffice-a36ecbc6.mjs +85 -0
- package/dist/ProfileBlogposts-c790d1b2.js +1 -0
- package/dist/ProfileBlogposts-f43cf32e.mjs +79 -0
- package/dist/ProfileEvents-12f80fff.mjs +70 -0
- package/dist/ProfileEvents-585570a3.js +1 -0
- package/dist/ProfileOrganizations-bbc2cf40.mjs +73 -0
- package/dist/ProfileOrganizations-d7103514.js +1 -0
- package/dist/Publics-094f3c2c.mjs +45 -0
- package/dist/Publics-1032c0f4.js +1 -0
- package/dist/Select-11ddabf5.mjs +79 -0
- package/dist/Select-3ca5ab39.js +1 -0
- package/dist/SelectMulti-58704d69.mjs +1038 -0
- package/dist/SelectMulti-c25765cf.js +1 -0
- package/dist/SkeletonBlogpost-95db0fa9.js +1 -0
- package/dist/SkeletonBlogpost-e0621af7.mjs +16 -0
- package/dist/SkeletonEvent-8690422d.mjs +16 -0
- package/dist/SkeletonEvent-eb284de8.js +1 -0
- package/dist/SkeletonEventShort-6c9e3940.js +1 -0
- package/dist/SkeletonEventShort-f030e56f.mjs +16 -0
- package/dist/SkeletonOrganization-5c09cfc5.js +1 -0
- package/dist/SkeletonOrganization-8690422d.mjs +16 -0
- package/dist/Socials-31c06635.mjs +74 -0
- package/dist/Socials-cceaeaf2.js +1 -0
- package/dist/Tab-054b61f7.mjs +46 -0
- package/dist/Tab-2c1e4224.js +1 -0
- package/dist/Tab.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Tab.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/Upload-06d93178.js +1 -0
- package/dist/Upload-23212d9d.mjs +74 -0
- package/dist/UploadImage-0f488170.js +1 -0
- package/dist/UploadImage-3c627d89.mjs +83 -0
- package/dist/UploadImageMultiple-cb6c7188.mjs +58 -0
- package/dist/UploadImageMultiple-eddaac87.js +1 -0
- package/dist/Wallet-2043b611.mjs +24682 -0
- package/dist/Wallet-8fa7386a.js +55 -0
- package/dist/_plugin-vue_export-helper-dad06003.mjs +9 -0
- package/dist/_plugin-vue_export-helper-f246444f.js +1 -0
- package/dist/auth-56dc2ba7.mjs +607 -0
- package/dist/auth-f018f5b3.js +7 -0
- package/dist/auth.client.cjs +7 -0
- package/dist/auth.client.js +3874 -0
- package/dist/auth.validation-c31a60e7.mjs +24 -0
- package/dist/auth.validation-d049b341.js +1 -0
- package/dist/backoffice.client.cjs +1 -0
- package/dist/backoffice.client.js +265 -0
- package/dist/carousel.es-44c501bc.mjs +383 -0
- package/dist/carousel.es-cdfb392c.js +5 -0
- package/dist/categories-5b08da53.mjs +121 -0
- package/dist/categories-7ccd6be9.js +1 -0
- package/dist/click-outside-0b0727d1.js +2 -0
- package/dist/click-outside-6101836c.mjs +19 -0
- package/dist/community.client.cjs +1 -0
- package/dist/community.client.js +692 -0
- package/dist/dribbble-8e8e169b.js +1 -0
- package/dist/dribbble-ae37c2ac.mjs +127 -0
- package/dist/events.client.cjs +2 -0
- package/dist/events.client.js +8885 -0
- package/dist/files.client.cjs +1 -0
- package/dist/files.client.js +1 -0
- package/dist/gallery-d4297191.mjs +54 -0
- package/dist/gallery-f92912df.js +1 -0
- package/dist/gallery.client.cjs +1 -0
- package/dist/gallery.client.js +18 -0
- package/dist/globals-928eb13c.js +1 -0
- package/dist/globals-96ba60e4.mjs +91 -0
- package/dist/globals.client.cjs +1 -0
- package/dist/globals.client.js +12 -0
- package/dist/icons.client.cjs +1 -0
- package/dist/icons.client.js +84 -0
- package/dist/index-a661083c.mjs +934 -0
- package/dist/index-b41aac19.js +2 -0
- package/dist/inputs.validation-d7cef32b.js +1 -0
- package/dist/inputs.validation-db65277a.mjs +83 -0
- package/dist/landing.client.cjs +1 -0
- package/dist/landing.client.js +111 -0
- package/dist/leftovers-5d1ff88b.mjs +67 -0
- package/dist/leftovers-b60180cf.js +1 -0
- package/dist/legal.client.cjs +1 -0
- package/dist/legal.client.js +8512 -0
- package/dist/memberships-12210953.mjs +68 -0
- package/dist/memberships-393765d8.js +1 -0
- package/dist/middlewares.client.cjs +1 -0
- package/dist/middlewares.client.js +1 -0
- package/dist/orders-13c10d49.mjs +85 -0
- package/dist/orders-37f041aa.js +1 -0
- package/dist/organizations-587d5a4d.mjs +122 -0
- package/dist/organizations-b4d902a2.js +1 -0
- package/dist/organizations.client-35b74e44.mjs +2997 -0
- package/dist/organizations.client-f982f55a.js +3 -0
- package/dist/organizations.client.cjs +1 -0
- package/dist/organizations.client.js +86 -0
- package/dist/products-3c43eb18.js +1 -0
- package/dist/products-943fb95e.mjs +107 -0
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +2 -78
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +78 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +65 -67
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -4
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +2 -61
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +4 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +61 -2
- 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 +1 -1
- 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 +1 -1
- 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 +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 +1 -1
- 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/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 +1 -1
- 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 +1 -1
- package/dist/reports-270f69df.js +1 -0
- package/dist/reports-79cd9459.mjs +91 -0
- package/dist/reports.client.cjs +1 -0
- package/dist/reports.client.js +8 -0
- package/dist/states.validation-3b70f83a.js +1 -0
- package/dist/states.validation-944e334c.mjs +13 -0
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -0
- package/dist/users.client.js +632 -0
- package/dist/vue-draggable-next.esm-bundler-21a209c6.js +10 -0
- package/dist/vue-draggable-next.esm-bundler-ff6e3f52.mjs +1557 -0
- package/dist/vuex.esm-bundler-57d8b6ba.mjs +750 -0
- package/dist/vuex.esm-bundler-685cf29f.js +5 -0
- package/package.json +1 -1
- package/src/modules/auth/components/pages/SignIn.vue +2 -2
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),q=require("./Field-e2a43424.js"),z=require("./Button-7643c9aa.js"),$=require("./Select-3ca5ab39.js"),c=require("./gallery-f92912df.js"),P=require("./vue-draggable-next.esm-bundler-21a209c6.js"),U=require("./UploadImageMultiple-eddaac87.js"),M=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("./index-b41aac19.js");const D={class:"pos-relative"},G=["src"],j=["onClick"],F={__name:"EditImages",props:{images:Array},emits:["update"],setup(i,{emit:r}){const u=i,o=e.ref([...u.images]);e.watchEffect(()=>{o.value=[...u.images]});const d=()=>{r("update:images",o.value)},_=s=>{o.value=[...o.value,...s],d()},h=s=>{o.value.splice(s,1),d()};return(s,f)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(U._sfc_main,{"onUpdate:images":_,uploadPath:"photos",class:"mn-semi pd-small w-100 button bg-black t-white"}),e.createVNode(e.unref(P.VueDraggableNext),{class:"gap-small flex dragArea list-group w-full",modelValue:o.value,"onUpdate:modelValue":f[0]||(f[0]=m=>o.value=m),onChange:d},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(m,y)=>(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("img",{class:"i-extra radius-small o-hidden mn-thin",src:(s.FILE_SERVER_URL||"")+m},null,8,G),e.createElementVNode("a",{onClick:p=>h(y),class:"pos-absolute t-center radius-extra i-medium bg-red pos-t-0 pos-r-0"},"X",8,j)]))),256))]),_:1},8,["modelValue"])]))}};const v=i=>(e.pushScopeId("data-v-d6a1c805"),i=i(),e.popScopeId(),i),L={class:"pos-relative w-100"},T={class:"mn-semi flex-v-center flex-nowrap flex"},R=v(()=>e.createElementVNode("h1",{class:"mn-r-small"},"Manage Gallery",-1)),A=["data-id"],O=["src","onClick"],H={key:1,class:"radius-small bg-white"},X=["src","onClick"],J={class:"t-black p-small mn-thin"},K=v(()=>e.createElementVNode("span",{class:"uppercase t-transp"},"Size",-1)),Q=v(()=>e.createElementVNode("br",null,null,-1)),W={class:"pd-2px radius-big d-inline-block bg-grey"},Y={class:"t-black p-small mn-small uppe"},Z=v(()=>e.createElementVNode("span",{class:"uppercase t-transp"},"Categories",-1)),ee=v(()=>e.createElementVNode("br",null,null,-1)),te={class:"pd-2px radius-big d-inline-block bg-grey t-semi"},le={class:"flex-nowrap flex"},ae=["onClick"],oe={class:"modal pd-thin"},se={class:"modal-content radius-big"},ne={class:""},ce=["src"],ie={key:0,class:"flex-v-center flex m modal pd-big"},re={class:"modal-content radius-small pd-medium bg-white"},de=["src"],ue=["src"],me={__name:"BackofficeGallery",setup(i){const r=e.ref(!0),u=e.ref(null);let o=1;const d=10;let _=e.ref(null),h=e.ref(!1);const s=e.ref([]),f=a=>{s.value=a},m=e.computed(()=>w.value==="all"?c.state.gallery:c.state.gallery.filter(a=>a.categories.includes(w.value))),y=async()=>{h.value=!0,await c.actions.fetchGallery(o,d),h.value=!1},p=e.ref(null),t=e.ref({categories:"",size:"",image:!1}),k=e.ref(null),E=a=>{console.log(r.value),r.value?N(a):(p.value="modal",t.value.image=a,V())},N=a=>{p.value="edit-modal",t.value=a||{categories:"",size:"",image:null},V()},g=()=>{t.value={categories:"",size:"",image:!1},k.value=null,B()},V=()=>{document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"},B=()=>{document.body.style.overflow="",document.documentElement.style.overflow=""},x=[{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"}],C=async a=>{await c.actions.deletePhoto(a)},S=async()=>{await c.actions.updatePhoto(t.value),g()},I=async a=>{if(s.length<1||!t.value.categories||!t.value.size){console.error("All fields are required.");return}await c.actions.createPhoto({images:s.value,size:t.value.size,categories:typeof t.value.categories=="string"?t.value.categories.split(",").map(n=>n.trim()):t.value.categories}),g()};let w=e.ref("all");return e.onMounted(async()=>{await c.actions.fetchGallery(o,d),typeof window<"u"&&new IntersectionObserver(n=>{n.some(l=>l.isIntersecting)&&(o+=1,y())}).observe(_.value)}),(a,n)=>(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("div",T,[R,r.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:n[0]||(n[0]=l=>E(null)),class:"t-white t-black bg-second i-big radius-extra"},"+")):e.createCommentVNode("",!0)]),e.createElementVNode("div",{ref_key:"grid",ref:u,class:"cols-4 gap-thin"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(l,ge)=>(e.openBlock(),e.createElementBlock("div",{key:l.id,"data-id":l.id},[e.createVNode(e.Transition,{name:"scaleIn",mode:"in-out"},{default:e.withCtx(()=>[!r.value&&u.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:"https://thecommunephuket.com/photos/"+l.cover,class:"w-100 h-100 o-hidden radius-medium object-fit-cover",onClick:b=>E(l.image)},null,8,O)):(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+l.cover,class:"w-100 radius-small mn-small h-10r object-fit-cover",onClick:b=>E(l)},null,8,X),e.createElementVNode("p",J,[K,Q,e.createElementVNode("span",W,e.toDisplayString(l.size.name),1)]),e.createElementVNode("p",Y,[Z,ee,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.categories,b=>(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(b),1))),256))]),e.createElementVNode("div",le,[e.createElementVNode("button",{class:"button-small w-100 button",onClick:b=>C(l._id)},"Delete",8,ae)])]))]),_:2},1024)],8,A))),128)),e.createElementVNode("div",{ref_key:"sentinel",ref:_,class:"sentinel"},null,512),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",oe,[e.createElementVNode("div",se,[e.createElementVNode("div",ne,[e.createElementVNode("span",{class:"close",onClick:g},"×"),e.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+t.value.image},null,8,ce)])])],512),[[e.vShow,t.value.image!==!1&&p.value==="modal"]])]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[t.value.image!==!1&&p.value==="edit-modal"?(e.openBlock(),e.createElementBlock("div",ie,[e.createElementVNode("div",re,[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,de)):e.createCommentVNode("",!0),typeof k.value=="object"&&t.value.image!==null?(e.openBlock(),e.createElementBlock("img",{key:1,class:"radius-small w-100 mn-small h-20r object-fit-cover",src:"/photos/"+t.value.cover},null,8,ue)):e.createCommentVNode("",!0),e.createVNode($.Select,{options:x,label:"Size",select:t.value.size,"onUpdate:select":n[1]||(n[1]=l=>t.value.size=l),placeholder:"Select Size",class:"bg-grey pd-thin radius-small mn-thin t-black"},null,8,["select"]),e.createVNode(q.Field,{field:t.value.categories,"onUpdate:field":n[2]||(n[2]=l=>t.value.categories=l),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(F,{images:s.value,"onUpdate:images":f,uploadPath:"photos",class:"mn-semi"},null,8,["images"]),e.createVNode(z._sfc_main,{submit:t.value._id?S:I,callback:g,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value._id?"Update":"Create"),1)]),_:1},8,["submit"])])])):e.createCommentVNode("",!0)]),_:1})],512)]))}},pe=M._export_sfc(me,[["__scopeId","data-v-d6a1c805"]]);exports.default=pe;
|
@@ -0,0 +1,264 @@
|
|
1
|
+
import { ref as r, watchEffect as O, openBlock as l, createElementBlock as a, createVNode as d, unref as j, withCtx as b, Fragment as P, renderList as U, createElementVNode as e, computed as T, onMounted as q, createCommentVNode as S, Transition as $, toDisplayString as V, withDirectives as X, vShow as H, createTextVNode as J, pushScopeId as K, popScopeId as Q } from "vue";
|
2
|
+
import { F as W } from "./Field-e5ad88d3.mjs";
|
3
|
+
import { _ as Y } from "./Button-9e1a9284.mjs";
|
4
|
+
import { S as Z } from "./Select-11ddabf5.mjs";
|
5
|
+
import { s as B, a as f } from "./gallery-d4297191.mjs";
|
6
|
+
import { V as ee } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
|
7
|
+
import { _ as te } from "./UploadImageMultiple-cb6c7188.mjs";
|
8
|
+
import { _ as se } 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 "./index-a661083c.mjs";
|
12
|
+
const le = { class: "pos-relative" }, ae = ["src"], oe = ["onClick"], ie = {
|
13
|
+
__name: "EditImages",
|
14
|
+
props: {
|
15
|
+
images: Array
|
16
|
+
},
|
17
|
+
emits: ["update"],
|
18
|
+
setup(u, { emit: m }) {
|
19
|
+
const g = u, i = r([...g.images]);
|
20
|
+
O(() => {
|
21
|
+
i.value = [...g.images];
|
22
|
+
});
|
23
|
+
const p = () => {
|
24
|
+
m("update:images", i.value);
|
25
|
+
}, k = (n) => {
|
26
|
+
i.value = [...i.value, ...n], p();
|
27
|
+
}, w = (n) => {
|
28
|
+
i.value.splice(n, 1), p();
|
29
|
+
};
|
30
|
+
return (n, x) => (l(), a("div", null, [
|
31
|
+
d(te, {
|
32
|
+
"onUpdate:images": k,
|
33
|
+
uploadPath: "photos",
|
34
|
+
class: "mn-semi pd-small w-100 button bg-black t-white"
|
35
|
+
}),
|
36
|
+
d(j(ee), {
|
37
|
+
class: "gap-small flex dragArea list-group w-full",
|
38
|
+
modelValue: i.value,
|
39
|
+
"onUpdate:modelValue": x[0] || (x[0] = (v) => i.value = v),
|
40
|
+
onChange: p
|
41
|
+
}, {
|
42
|
+
default: b(() => [
|
43
|
+
(l(!0), a(P, null, U(i.value, (v, z) => (l(), a("div", le, [
|
44
|
+
e("img", {
|
45
|
+
class: "i-extra radius-small o-hidden mn-thin",
|
46
|
+
src: (n.FILE_SERVER_URL || "") + v
|
47
|
+
}, null, 8, ae),
|
48
|
+
e("a", {
|
49
|
+
onClick: (_) => w(z),
|
50
|
+
class: "pos-absolute t-center radius-extra i-medium bg-red pos-t-0 pos-r-0"
|
51
|
+
}, "X", 8, oe)
|
52
|
+
]))), 256))
|
53
|
+
]),
|
54
|
+
_: 1
|
55
|
+
}, 8, ["modelValue"])
|
56
|
+
]));
|
57
|
+
}
|
58
|
+
};
|
59
|
+
const y = (u) => (K("data-v-d6a1c805"), u = u(), Q(), u), ne = { class: "pos-relative w-100" }, ce = { class: "mn-semi flex-v-center flex-nowrap flex" }, re = /* @__PURE__ */ y(() => /* @__PURE__ */ e("h1", { class: "mn-r-small" }, "Manage Gallery", -1)), de = ["data-id"], ue = ["src", "onClick"], me = {
|
60
|
+
key: 1,
|
61
|
+
class: "radius-small bg-white"
|
62
|
+
}, pe = ["src", "onClick"], ge = { class: "t-black p-small mn-thin" }, ve = /* @__PURE__ */ y(() => /* @__PURE__ */ e("span", { class: "uppercase t-transp" }, "Size", -1)), _e = /* @__PURE__ */ y(() => /* @__PURE__ */ e("br", null, null, -1)), he = { class: "pd-2px radius-big d-inline-block bg-grey" }, fe = { class: "t-black p-small mn-small uppe" }, be = /* @__PURE__ */ y(() => /* @__PURE__ */ e("span", { class: "uppercase t-transp" }, "Categories", -1)), ye = /* @__PURE__ */ y(() => /* @__PURE__ */ e("br", null, null, -1)), ke = { class: "pd-2px radius-big d-inline-block bg-grey t-semi" }, we = { class: "flex-nowrap flex" }, xe = ["onClick"], Ce = { class: "modal pd-thin" }, Ie = { class: "modal-content radius-big" }, Se = { class: "" }, ze = ["src"], Ee = {
|
63
|
+
key: 0,
|
64
|
+
class: "flex-v-center flex m modal pd-big"
|
65
|
+
}, $e = { class: "modal-content radius-small pd-medium bg-white" }, Ve = ["src"], Pe = ["src"], Ue = {
|
66
|
+
__name: "BackofficeGallery",
|
67
|
+
setup(u) {
|
68
|
+
const m = r(!0), g = r(null);
|
69
|
+
let i = 1;
|
70
|
+
const p = 10;
|
71
|
+
let k = r(null), w = r(!1);
|
72
|
+
const n = r([]), x = (o) => {
|
73
|
+
n.value = o;
|
74
|
+
}, v = T(() => M.value === "all" ? B.gallery : B.gallery.filter((o) => o.categories.includes(M.value))), z = async () => {
|
75
|
+
w.value = !0, await f.fetchGallery(i, p), w.value = !1;
|
76
|
+
}, _ = r(null), t = r({
|
77
|
+
categories: "",
|
78
|
+
size: "",
|
79
|
+
image: !1
|
80
|
+
}), C = r(null), E = (o) => {
|
81
|
+
console.log(m.value), m.value ? N(o) : (_.value = "modal", t.value.image = o, G());
|
82
|
+
}, N = (o) => {
|
83
|
+
_.value = "edit-modal", t.value = o || {
|
84
|
+
categories: "",
|
85
|
+
size: "",
|
86
|
+
image: null
|
87
|
+
}, G();
|
88
|
+
}, h = () => {
|
89
|
+
t.value = {
|
90
|
+
categories: "",
|
91
|
+
size: "",
|
92
|
+
image: !1
|
93
|
+
}, C.value = null, D();
|
94
|
+
}, G = () => {
|
95
|
+
document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden";
|
96
|
+
}, D = () => {
|
97
|
+
document.body.style.overflow = "", document.documentElement.style.overflow = "";
|
98
|
+
}, F = [
|
99
|
+
{ name: "Small", value: "" },
|
100
|
+
{ name: "Regular", value: "grid-item--width1 grid-item--height1" },
|
101
|
+
{ name: "Medium", value: "grid-item--width2 grid-item--height2" },
|
102
|
+
{ name: "Big", value: "grid-item--width3 grid-item--height3" }
|
103
|
+
], R = async (o) => {
|
104
|
+
await f.deletePhoto(o);
|
105
|
+
}, A = async () => {
|
106
|
+
await f.updatePhoto(t.value), h();
|
107
|
+
}, L = async (o) => {
|
108
|
+
if (n.length < 1 || !t.value.categories || !t.value.size) {
|
109
|
+
console.error("All fields are required.");
|
110
|
+
return;
|
111
|
+
}
|
112
|
+
await f.createPhoto({
|
113
|
+
images: n.value,
|
114
|
+
size: t.value.size,
|
115
|
+
categories: typeof t.value.categories == "string" ? t.value.categories.split(",").map((c) => c.trim()) : t.value.categories
|
116
|
+
}), h();
|
117
|
+
};
|
118
|
+
let M = r("all");
|
119
|
+
return q(async () => {
|
120
|
+
await f.fetchGallery(i, p), typeof window < "u" && new IntersectionObserver((c) => {
|
121
|
+
c.some((s) => s.isIntersecting) && (i += 1, z());
|
122
|
+
}).observe(k.value);
|
123
|
+
}), (o, c) => (l(), a("div", ne, [
|
124
|
+
e("div", ce, [
|
125
|
+
re,
|
126
|
+
m.value ? (l(), a("button", {
|
127
|
+
key: 0,
|
128
|
+
onClick: c[0] || (c[0] = (s) => E(null)),
|
129
|
+
class: "t-white t-black bg-second i-big radius-extra"
|
130
|
+
}, "+")) : S("", !0)
|
131
|
+
]),
|
132
|
+
e("div", {
|
133
|
+
ref_key: "grid",
|
134
|
+
ref: g,
|
135
|
+
class: "cols-4 gap-thin"
|
136
|
+
}, [
|
137
|
+
(l(!0), a(P, null, U(j(v), (s, Ge) => (l(), a("div", {
|
138
|
+
key: s.id,
|
139
|
+
"data-id": s.id
|
140
|
+
}, [
|
141
|
+
d($, {
|
142
|
+
name: "scaleIn",
|
143
|
+
mode: "in-out"
|
144
|
+
}, {
|
145
|
+
default: b(() => [
|
146
|
+
!m.value && g.value ? (l(), a("img", {
|
147
|
+
key: 0,
|
148
|
+
src: "https://thecommunephuket.com/photos/" + s.cover,
|
149
|
+
class: "w-100 h-100 o-hidden radius-medium object-fit-cover",
|
150
|
+
onClick: (I) => E(s.image)
|
151
|
+
}, null, 8, ue)) : (l(), a("div", me, [
|
152
|
+
e("img", {
|
153
|
+
src: "https://thecommunephuket.com/photos/" + s.cover,
|
154
|
+
class: "w-100 radius-small mn-small h-10r object-fit-cover",
|
155
|
+
onClick: (I) => E(s)
|
156
|
+
}, null, 8, pe),
|
157
|
+
e("p", ge, [
|
158
|
+
ve,
|
159
|
+
_e,
|
160
|
+
e("span", he, V(s.size.name), 1)
|
161
|
+
]),
|
162
|
+
e("p", fe, [
|
163
|
+
be,
|
164
|
+
ye,
|
165
|
+
(l(!0), a(P, null, U(s.categories, (I) => (l(), a("span", ke, V(I), 1))), 256))
|
166
|
+
]),
|
167
|
+
e("div", we, [
|
168
|
+
e("button", {
|
169
|
+
class: "button-small w-100 button",
|
170
|
+
onClick: (I) => R(s._id)
|
171
|
+
}, "Delete", 8, xe)
|
172
|
+
])
|
173
|
+
]))
|
174
|
+
]),
|
175
|
+
_: 2
|
176
|
+
}, 1024)
|
177
|
+
], 8, de))), 128)),
|
178
|
+
e("div", {
|
179
|
+
ref_key: "sentinel",
|
180
|
+
ref: k,
|
181
|
+
class: "sentinel"
|
182
|
+
}, null, 512),
|
183
|
+
d($, { name: "modal" }, {
|
184
|
+
default: b(() => [
|
185
|
+
X(e("div", Ce, [
|
186
|
+
e("div", Ie, [
|
187
|
+
e("div", Se, [
|
188
|
+
e("span", {
|
189
|
+
class: "close",
|
190
|
+
onClick: h
|
191
|
+
}, "×"),
|
192
|
+
e("img", {
|
193
|
+
src: "https://thecommunephuket.com/photos/" + t.value.image
|
194
|
+
}, null, 8, ze)
|
195
|
+
])
|
196
|
+
])
|
197
|
+
], 512), [
|
198
|
+
[H, t.value.image !== !1 && _.value === "modal"]
|
199
|
+
])
|
200
|
+
]),
|
201
|
+
_: 1
|
202
|
+
}),
|
203
|
+
d($, { name: "modal" }, {
|
204
|
+
default: b(() => [
|
205
|
+
t.value.image !== !1 && _.value === "edit-modal" ? (l(), a("div", Ee, [
|
206
|
+
e("div", $e, [
|
207
|
+
e("span", {
|
208
|
+
class: "close",
|
209
|
+
onClick: h
|
210
|
+
}, "×"),
|
211
|
+
typeof C.value == "string" ? (l(), a("img", {
|
212
|
+
key: 0,
|
213
|
+
src: C.value,
|
214
|
+
class: "radius-small w-100 mn-small h-20r object-fit-cover"
|
215
|
+
}, null, 8, Ve)) : S("", !0),
|
216
|
+
typeof C.value == "object" && t.value.image !== null ? (l(), a("img", {
|
217
|
+
key: 1,
|
218
|
+
class: "radius-small w-100 mn-small h-20r object-fit-cover",
|
219
|
+
src: "/photos/" + t.value.cover
|
220
|
+
}, null, 8, Pe)) : S("", !0),
|
221
|
+
d(Z, {
|
222
|
+
options: F,
|
223
|
+
label: "Size",
|
224
|
+
select: t.value.size,
|
225
|
+
"onUpdate:select": c[1] || (c[1] = (s) => t.value.size = s),
|
226
|
+
placeholder: "Select Size",
|
227
|
+
class: "bg-grey pd-thin radius-small mn-thin t-black"
|
228
|
+
}, null, 8, ["select"]),
|
229
|
+
d(W, {
|
230
|
+
field: t.value.categories,
|
231
|
+
"onUpdate:field": c[2] || (c[2] = (s) => t.value.categories = s),
|
232
|
+
type: "text",
|
233
|
+
label: "Categories",
|
234
|
+
placeholder: "Enter categories for image (comma separated)",
|
235
|
+
class: "bg-grey pd-thin radius-small mn-medium t-black"
|
236
|
+
}, null, 8, ["field"]),
|
237
|
+
d(ie, {
|
238
|
+
images: n.value,
|
239
|
+
"onUpdate:images": x,
|
240
|
+
uploadPath: "photos",
|
241
|
+
class: "mn-semi"
|
242
|
+
}, null, 8, ["images"]),
|
243
|
+
d(Y, {
|
244
|
+
submit: t.value._id ? A : L,
|
245
|
+
callback: h,
|
246
|
+
class: "mn-thin"
|
247
|
+
}, {
|
248
|
+
default: b(() => [
|
249
|
+
J(V(t.value._id ? "Update" : "Create"), 1)
|
250
|
+
]),
|
251
|
+
_: 1
|
252
|
+
}, 8, ["submit"])
|
253
|
+
])
|
254
|
+
])) : S("", !0)
|
255
|
+
]),
|
256
|
+
_: 1
|
257
|
+
})
|
258
|
+
], 512)
|
259
|
+
]));
|
260
|
+
}
|
261
|
+
}, qe = /* @__PURE__ */ se(Ue, [["__scopeId", "data-v-d6a1c805"]]);
|
262
|
+
export {
|
263
|
+
qe as default
|
264
|
+
};
|
@@ -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-79cd9459.mjs";
|
3
|
+
import "./globals-96ba60e4.mjs";
|
4
|
+
import "vue-i18n";
|
5
|
+
import "./index-a661083c.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
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./reports-270f69df.js");require("./globals-928eb13c.js");require("vue-i18n");require("./index-b41aac19.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 @@
|
|
1
|
+
"use strict";const s=require("vue"),E=require("./index-b41aac19.js"),T=require("./_plugin-vue_export-helper-f246444f.js");var C=function e(t,a){if(t===a)return!0;if(t&&a&&typeof t=="object"&&typeof a=="object"){if(t.constructor!==a.constructor)return!1;var i,n,l;if(Array.isArray(t)){if(i=t.length,i!=a.length)return!1;for(n=i;n--!==0;)if(!e(t[n],a[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if(l=Object.keys(t),i=l.length,i!==Object.keys(a).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(a,l[n]))return!1;for(n=i;n--!==0;){var d=l[n];if(!e(t[d],a[d]))return!1}return!0}return t!==t&&a!==a};const B=E.getDefaultExportFromCjs(C),S=(e,t)=>t.filter(a=>{const{text:i}=e;if(typeof a.rule=="string")return!new RegExp(a.rule).test(i);if(a.rule instanceof RegExp)return!a.rule.test(i);if({}.toString.call(a.rule)==="[object Function]")return a.rule(e)}).map(a=>a.classes),c=e=>JSON.parse(JSON.stringify(e)),w=(e,t)=>{let a=0;for(;a<e.length;){if(t(e[a],a,e))return a;a++}return-1},k=(e,t,a=[],i)=>{e.text===void 0&&(e={text:e});const n=S(e,a),l=w(t,u=>u===e),d=c(t),o=l!==-1?d.splice(l,1)[0]:c(e);return(i?i(d,o):d.map(u=>u.text).indexOf(o.text)!==-1)&&n.push("ti-duplicate"),n.length===0?n.push("ti-valid"):n.push("ti-invalid"),n},m=(e,...t)=>{e.text===void 0&&(e={text:e});const a=c(e);return a.tiClasses=k(e,...t),a},$=(e,...t)=>e.map(a=>m(a,e,...t));const D={name:"TagInput",props:{scope:{type:Object}}},O=["maxlength"];function I(e,t,a,i,n,l){return a.scope.edit?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,"onUpdate:modelValue":t[0]||(t[0]=d=>a.scope.tag.text=d),maxlength:a.scope.maxlength,type:"text",class:"ti-tag-input",size:"1",onInput:t[1]||(t[1]=d=>a.scope.validateTag(a.scope.index,d)),onBlur:t[2]||(t[2]=d=>a.scope.performCancelEdit(a.scope.index)),onKeydown:t[3]||(t[3]=d=>a.scope.performSaveEdit(a.scope.index,d))},null,40,O)),[[s.vModelText,a.scope.tag.text]]):s.createCommentVNode("",!0)}const A=T._export_sfc(D,[["render",I],["__scopeId","data-v-a1f1c345"]]),h=e=>!e.some(t=>{const a=!t.text;a&&console.warn('Missing property "text"',t);let i=!1;return t.classes&&(i=typeof t.classes!="string"),i&&console.warn('Property "classes" must be type of string',t),a||i}),y=e=>!e.some(t=>{if(typeof t=="number"){const a=isFinite(t)&&Math.floor(t)===t;return a||console.warn("Only numerics are allowed for this prop. Found:",t),!a}else if(typeof t=="string"){const a=/\W|[a-z]|!\d/i.test(t);return a||console.warn("Only alpha strings are allowed for this prop. Found:",t),!a}else return console.warn("Only numeric and string values are allowed. Found:",t),!1}),b={modelValue:{type:String,default:"",required:!0},tags:{type:Array,default:()=>[],validator:h},autocompleteItems:{type:Array,default:()=>[],validator:h},allowEditTags:{type:Boolean,default:!1},autocompleteFilterDuplicates:{default:!0,type:Boolean},addOnlyFromAutocomplete:{type:Boolean,default:!1},autocompleteMinLength:{type:Number,default:1},autocompleteAlwaysOpen:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:"Add Tag"},addOnKey:{type:Array,default:()=>[13],validator:y},saveOnKey:{type:Array,default:()=>[13],validator:y},maxTags:{type:Number},maxlength:{type:Number},validation:{type:Array,default:()=>[],validator(e){return!e.some(t=>{const a=!t.rule;a&&console.warn('Property "rule" is missing',t);const i=t.rule&&(typeof t.rule=="string"||t.rule instanceof RegExp||{}.toString.call(t.rule)==="[object Function]");i||console.warn("A rule must be type of string, RegExp or function. Found:",JSON.stringify(t.rule));const n=!t.classes;n&&console.warn('Property "classes" is missing',t);const l=t.type&&typeof t.type!="string";return l&&console.warn('Property "type" must be type of string. Found:',t),!i||a||n||l})}},separators:{type:Array,default:()=>[";"],validator(e){return!e.some(t=>{const a=typeof t!="string";return a&&console.warn("Separators must be type of string. Found:",t),a})}},avoidAddingDuplicates:{type:Boolean,default:!0},addOnBlur:{type:Boolean,default:!0},isDuplicate:{type:Function,default:null},addFromPaste:{type:Boolean,default:!0},deleteOnBackspace:{default:!0,type:Boolean},onBeforeAddingTag:Function,onBeforeDeletingTag:Function,onBeforeEditingTag:Function,onBeforeSavingTag:Function},F={name:"VueTagsInput",components:{TagInput:A},props:b,emits:["adding-duplicate","before-adding-tag","before-deleting-tag","before-editing-tag","before-saving-tag","max-tags-reached","saving-duplicate","tags-changed","tag-clicked","update:modelValue","update:tags"],inheritAttrs:!1,data(){return{tagCenter:[],newTag:null,tagsCopy:[],tagsEditStatus:null,deletionMark:null,deletionMarkTime:null,selectedItem:null,focused:null}},computed:{autocompleteOpen(){return this.autocompleteAlwaysOpen?!0:this.newTag!==null&&this.newTag.length>=this.autocompleteMinLength&&this.filteredAutocompleteItems.length>0&&this.focused},filteredAutocompleteItems(){const e=this.autocompleteItems.map(t=>m(t,this.tags,this.validation,this.isDuplicate));return this.autocompleteFilterDuplicates?e.filter(this.duplicateFilter):e}},methods:{createClasses:k,getSelectedIndex(e){const t=this.filteredAutocompleteItems,a=this.selectedItem,i=t.length-1;if(t.length!==0)return a===null?0:e==="before"&&a===0?i:e==="after"&&a===i?0:e==="after"?a+1:a-1},selectDefaultItem(){this.addOnlyFromAutocomplete&&this.filteredAutocompleteItems.length>0?this.selectedItem=0:this.selectedItem=null},selectItem(e,t){e.preventDefault(),this.selectedItem=this.getSelectedIndex(t)},isSelected(e){return this.selectedItem===e},isMarked(e){return this.deletionMark===e},setTagCenter(e){e&&this.tagCenter.push(e)},invokeDelete(){if(!this.deleteOnBackspace||this.newTag.length>0)return;const e=this.tagsCopy.length-1;this.deletionMark===null?(this.deletionMarkTime=setTimeout(()=>this.deletionMark=null,1e3),this.deletionMark=e):this.performDeleteTag(e)},addTagsFromPaste(){this.addFromPaste&&setTimeout(()=>this.performAddTags(this.newTag),10)},performEditTag(e){this.allowEditTags&&(this.onBeforeAddingTag||this.editTag(e),this.$emit("before-editing-tag",{index:e,tag:this.tagsCopy[e],editTag:()=>this.editTag(e)}))},editTag(e){this.allowEditTags&&(this.toggleEditMode(e),this.focus(e))},toggleEditMode(e){!this.allowEditTags||this.disabled||(this.tagsEditStatus[e]=!this.tagsEditStatus[e])},createChangedTag(e,t){const a=this.tagsCopy[e];a.text=t?t.target.value:this.tagsCopy[e].text,this.tagsCopy[e]=m(a,this.tagsCopy,this.validation,this.isDuplicate)},focus(e){this.$nextTick(()=>{const t=this.tagCenter[e].querySelector("input.ti-tag-input");t&&t.focus()})},quote(e){return e.replace(/([()[{*+.$^\\|?])/g,"\\$1")},cancelEdit(e){this.tags[e]&&(this.tagsCopy[e]=c(m(this.tags[e],this.tags,this.validation,this.isDuplicate)),this.tagsEditStatus[e]=!1)},hasForbiddingAddRule(e){return e.some(t=>{const a=this.validation.find(i=>t===i.classes);return a?a.disableAdd:!1})},createTagTexts(e){const t=new RegExp(this.separators.map(a=>this.quote(a)).join("|"));return e.split(t).map(a=>({text:a}))},performDeleteTag(e){this.onBeforeDeletingTag||this.deleteTag(e),this.$emit("before-deleting-tag",{index:e,tag:this.tagsCopy[e],deleteTag:()=>this.deleteTag(e)})},deleteTag(e){this.disabled||(this.deletionMark=null,clearTimeout(this.deletionMarkTime),this.tagsCopy.splice(e,1),this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},noTriggerKey(e,t){const a=this[t].indexOf(e.keyCode)!==-1||this[t].indexOf(e.key)!==-1;return a&&e.preventDefault(),!a},performAddTags(e,t,a){if(this.disabled||t&&this.noTriggerKey(t,"addOnKey"))return;let i=[];typeof e=="object"&&(i=[e]),typeof e=="string"&&(i=this.createTagTexts(e)),i=i.filter(n=>n.text.trim().length>0),i.forEach(n=>{n=m(n,this.tags,this.validation,this.isDuplicate),this.onBeforeAddingTag||this.addTag(n,a),this.$emit("before-adding-tag",{tag:n,addTag:()=>this.addTag(n,a)})})},duplicateFilter(e){return this.isDuplicate?!this.isDuplicate(this.tagsCopy,e):!this.tagsCopy.find(t=>t.text===e.text)},addTag(e,t="new-tag-input"){const a=this.filteredAutocompleteItems.map(i=>i.text);this.addOnlyFromAutocomplete&&a.indexOf(e.text)===-1||this.$nextTick(()=>{if(this.maxTags&&this.maxTags<=this.tagsCopy.length)return this.$emit("max-tags-reached",e);if(this.avoidAddingDuplicates&&!this.duplicateFilter(e))return this.$emit("adding-duplicate",e);this.hasForbiddingAddRule(e.tiClasses)||(this.newTag="",this.tagsCopy.push(e),this.$emit("update:tags",this.tagsCopy),t==="autocomplete"&&this.$refs.newTagInput.focus(),this.$emit("tags-changed",this.tagsCopy))})},performSaveTag(e,t){const a=this.tagsCopy[e];this.disabled||t&&this.noTriggerKey(t,"addOnKey")||a.text.trim().length!==0&&(this["on-before-saving-tag"]||this.saveTag(e,a),this.$emit("before-saving-tag",{index:e,tag:a,saveTag:()=>this.saveTag(e,a)}))},saveTag(e,t){if(this.avoidAddingDuplicates){const a=c(this.tagsCopy),i=a.splice(e,1)[0];if(this.isDuplicate?this.isDuplicate(a,i):a.map(l=>l.text).indexOf(i.text)!==-1)return this.$emit("saving-duplicate",t)}this.hasForbiddingAddRule(t.tiClasses)||(this.tagsCopy[e]=t,this.toggleEditMode(e),this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},tagsEqual(){return!this.tagsCopy.some((e,t)=>!B(e,this.tags[t]))},updateNewTag(e){const t=e.target.value;this.newTag=t,this.$emit("update:modelValue",t)},initTags(){this.tagsCopy=$(this.tags,this.validation,this.isDuplicate),this.tagsEditStatus=c(this.tags).map(()=>!1),this.tagsEqual()||this.$emit("update:tags",this.tagsCopy)},blurredOnClick(e){this.$el.contains(e.target)||this.$el.contains(document.activeElement)||this.performBlur(e)},performBlur(){this.addOnBlur&&this.focused&&this.performAddTags(this.newTag),this.focused=!1}},watch:{modelValue(e){this.addOnlyFromAutocomplete||(this.selectedItem=null),this.newTag=e},tags:{handler(){this.initTags()},deep:!0},autocompleteOpen:"selectDefaultItem"},created(){this.newTag=this.modelValue,this.initTags()},mounted(){this.selectDefaultItem(),document.addEventListener("click",this.blurredOnClick)},beforeUpdate(){this.tagCenter=[]},unmounted(){document.removeEventListener("click",this.blurredOnClick)}};const V={class:"ti-input"},N={key:0,class:"ti-tags"},M=["onClick"],K={class:"ti-content"},R={key:0,class:"ti-tag-left"},j=["onClick"],q={key:1,class:"ti-tag-right"},P={class:"ti-actions"},z=["onClick"],L=["onClick"],U={class:"ti-new-tag-input-wrapper"},J=["placeholder","value","maxlength","disabled"],H=["onMouseover"],W=["onClick"];function Y(e,t,a,i,n,l){const d=s.resolveComponent("tag-input");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["vue-tags-input",[{"ti-disabled":e.disabled},{"ti-focus":e.focused},e.$attrs.class]]),style:s.normalizeStyle(e.$attrs.style)},[s.createElementVNode("div",V,[e.tagsCopy?(s.openBlock(),s.createElementBlock("ul",N,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.tagsCopy,(o,r)=>(s.openBlock(),s.createElementBlock("li",{key:r,style:s.normalizeStyle(o.style),class:s.normalizeClass([[{"ti-editing":e.tagsEditStatus[r]},o.tiClasses,o.classes,{"ti-deletion-mark":e.isMarked(r)}],"ti-tag"]),tabindex:"0",onClick:u=>e.$emit("tag-clicked",{tag:o,index:r})},[s.createElementVNode("div",K,[e.$slots["tag-left"]?(s.openBlock(),s.createElementBlock("div",R,[s.renderSlot(e.$slots,"tag-left",{tag:o,index:r,edit:e.tagsEditStatus[r],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(r)},void 0,!0)])):s.createCommentVNode("",!0),s.createElementVNode("div",{ref_for:!0,ref:e.setTagCenter,class:"ti-tag-center"},[e.$slots["tag-center"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass({"ti-hidden":e.tagsEditStatus[r]}),onClick:u=>e.performEditTag(r)},s.toDisplayString(o.text),11,j)),e.$slots["tag-center"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(d,{key:1,scope:{edit:e.tagsEditStatus[r],maxlength:e.maxlength,tag:o,index:r,validateTag:e.createChangedTag,performCancelEdit:e.cancelEdit,performSaveEdit:e.performSaveTag}},null,8,["scope"])),s.renderSlot(e.$slots,"tag-center",{tag:o,index:r,maxlength:e.maxlength,edit:e.tagsEditStatus[r],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,validateTag:e.createChangedTag,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(r)},void 0,!0)],512),e.$slots["tag-right"]?(s.openBlock(),s.createElementBlock("div",q,[s.renderSlot(e.$slots,"tag-right",{tag:o,index:r,edit:e.tagsEditStatus[r],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(r)},void 0,!0)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",P,[e.$slots["tag-actions"]?s.createCommentVNode("",!0):s.withDirectives((s.openBlock(),s.createElementBlock("i",{key:0,class:"ti-icon-undo",onClick:u=>e.cancelEdit(r)},null,8,z)),[[s.vShow,e.tagsEditStatus[r]]]),e.$slots["tag-actions"]?s.createCommentVNode("",!0):s.withDirectives((s.openBlock(),s.createElementBlock("i",{key:1,class:"ti-icon-close",onClick:u=>e.performDeleteTag(r)},null,8,L)),[[s.vShow,!e.tagsEditStatus[r]]]),e.$slots["tag-actions"]?s.renderSlot(e.$slots,"tag-actions",{key:2,tag:o,index:r,edit:e.tagsEditStatus[r],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(r)},void 0,!0):s.createCommentVNode("",!0)])],14,M))),128)),s.createElementVNode("li",U,[s.createElementVNode("input",s.mergeProps({ref:"newTagInput"},e.$attrs,{class:[[e.createClasses(e.newTag,e.tags,e.validation,e.isDuplicate)],"ti-new-tag-input"],placeholder:e.placeholder,value:e.newTag,maxlength:e.maxlength,disabled:e.disabled,type:"text",size:"1",onKeydown:[t[0]||(t[0]=o=>e.performAddTags(e.filteredAutocompleteItems[e.selectedItem]||e.newTag,o)),t[2]||(t[2]=s.withKeys((...o)=>e.invokeDelete&&e.invokeDelete(...o),["delete"])),t[3]||(t[3]=s.withKeys((...o)=>e.performBlur&&e.performBlur(...o),["tab"])),t[4]||(t[4]=s.withKeys(o=>e.selectItem(o,"before"),["up"])),t[5]||(t[5]=s.withKeys(o=>e.selectItem(o,"after"),["down"]))],onPaste:t[1]||(t[1]=(...o)=>e.addTagsFromPaste&&e.addTagsFromPaste(...o)),onInput:t[6]||(t[6]=(...o)=>e.updateNewTag&&e.updateNewTag(...o)),onFocus:t[7]||(t[7]=o=>e.focused=!0),onClick:t[8]||(t[8]=o=>e.addOnlyFromAutocomplete?!1:e.selectedItem=null)}),null,16,J)])])):s.createCommentVNode("",!0)]),s.renderSlot(e.$slots,"between-elements",{},void 0,!0),e.autocompleteOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["ti-autocomplete",e.$attrs.class]),onMouseout:t[9]||(t[9]=o=>e.selectedItem=null)},[s.renderSlot(e.$slots,"autocomplete-header",{},void 0,!0),s.createElementVNode("ul",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.filteredAutocompleteItems,(o,r)=>(s.openBlock(),s.createElementBlock("li",{key:r,style:s.normalizeStyle(o.style),class:s.normalizeClass([[o.tiClasses,o.classes,{"ti-selected-item":e.isSelected(r)}],"ti-item"]),onMouseover:u=>e.disabled?!1:e.selectedItem=r},[e.$slots["autocomplete-item"]?s.renderSlot(e.$slots,"autocomplete-item",{key:1,item:o,index:r,performAdd:u=>e.performAddTags(u,void 0,"autocomplete"),selected:e.isSelected(r)},void 0,!0):(s.openBlock(),s.createElementBlock("div",{key:0,onClick:u=>e.performAddTags(o,void 0,"autocomplete")},s.toDisplayString(o.text),9,W))],46,H))),128))]),s.renderSlot(e.$slots,"autocomplete-footer",{},void 0,!0)],34)):s.createCommentVNode("",!0)],6)}const G=T._export_sfc(F,[["render",Y],["__scopeId","data-v-d14eec25"]]);const Q=s.createElementVNode("h5",{class:"mn-thin"},"Tags (maximum 20):",-1),X={class:"mn-medium"},Z=s.createElementVNode("p",{class:"p-small mn-thin"},"Suggested:",-1),_=["onClick"],x={key:1},ee={__name:"BlockTags",props:["tags"],emits:["tags-changed"],setup(e,{emit:t}){const a=e,i=s.ref(""),n=s.ref([]),l=s.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);a.tags&&(n.value=a.tags.map(p=>({text:p})));const d=s.computed(()=>l.value.filter(p=>p.text.toLowerCase().includes(i.value.toLowerCase()))),o=s.computed(()=>l.value.filter(p=>!n.value.some(g=>g.text===p.text)));function r(p){n.value.push(p),t("tags-changed",n.value.map(g=>g.text))}function u(p){n.value=p,t("tags-changed",n.value.map(g=>g.text))}return(p,g)=>(s.openBlock(),s.createElementBlock("div",null,[Q,s.createVNode(G,{modelValue:i.value,"onUpdate:modelValue":g[0]||(g[0]=f=>i.value=f),tags:n.value,"autocomplete-items":s.unref(d),"add-on-key":[13,":",";",","],"save-on-key":[13,":",";",","],separators:[";",","],"max-tags":20,maxlength:20,placeholder:"Please add tags","add-from-paste":!0,"allow-edit-tags":!0,onTagsChanged:u,class:"mn-thin bg-grey radius-medium pd-small"},null,8,["modelValue","tags","autocomplete-items"]),s.createElementVNode("p",X,[Z,s.unref(o).length>0?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(s.unref(o),(f,v)=>(s.openBlock(),s.createElementBlock("span",{onClick:te=>r(f),class:s.normalizeClass(["cursor-pointer ti-tag-toDefactor",{"mn-r-micro":v!==s.unref(o).length-1}])},s.toDisplayString(f.text),11,_))),256)):(s.openBlock(),s.createElementBlock("span",x,"You added all suggested tags"))])]))}};exports._sfc_main=ee;
|