@ozdao/prometheus-framework 0.0.93 → 0.0.94

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("vue-router"),n=require("./organizations.client-c6fd9351.js");require("./inputs.validation-24ae76b9.js");const p=require("./auth-5a58f8cb.js"),k=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-e32a3041.js");require("vue-i18n");const y=require("./Publics-103da60e.js"),x=require("./vuex.esm-bundler-e8cf3cd2.js"),E=require("./vue-draggable-next.esm-bundler-80731ae0.js");require("./globals-928eb13c.js");require("./Tab-6f0a4909.js");require("./ButtonFollow-959861db.js");require("./_plugin-vue_export-helper-f246444f.js");require("./Feed-a2870bbf.js");require("./EmptyState-7658d7d6.js");require("./Chips-2a0d9bfe.js");require("./PlaceholderUserpic-20d58460.js");require("./Feed-c25dc839.js");require("./IconEdit-823ddda9.js");require("./CardOrganization-82c5b4c6.js");require("./organizations-e97a0f85.js");require("./UploadImage-73d66f27.js");const V={class:"mn-big flex-column flex"},w={__name:"EditProductInfo",props:{product:Object},setup(c){const s=c,o=x.useStore();return e.toRefs(s),(t,l)=>(e.openBlock(),e.createElementBlock("div",V,[e.createTextVNode(e.toDisplayString(e.unref(o).products.current)+" ",1),e.createVNode(y.Select,{options:["unpublished","published","archivied"],select:e.unref(o).products.state.current.status,"onUpdate:select":l[0]||(l[0]=r=>e.unref(o).products.state.current.status=r),placeholder:"Display product",class:"w-100 mn-small bg-white radius-small pd-medium"},null,8,["select"]),e.createVNode(p.Field,{field:e.unref(o).products.state.current.name,"onUpdate:field":l[1]||(l[1]=r=>e.unref(o).products.state.current.name=r),placeholder:"Введите название",class:"w-100 mn-small bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(p.Field,{field:e.unref(o).products.state.current.price,"onUpdate:field":l[2]||(l[2]=r=>e.unref(o).products.state.current.price=r),placeholder:"Введите цену",class:"w-100 mn-small bg-white radius-small pd-medium",type:"number"},null,8,["field"]),e.createVNode(p.Field,{field:e.unref(o).products.state.current.description,"onUpdate:field":l[3]||(l[3]=r=>e.unref(o).products.state.current.description=r),placeholder:"Введите описание",class:"w-100 mn-small bg-white radius-small pd-medium",type:"textarea"},null,8,["field"])]))}},B={class:"mn-big"},C={class:"mn-small flex-nowrap flex"},$={class:"mn-r-thin"},q={class:"flex-column flex"},P={key:0,class:"w-100 mn-small"},z=["onClick"],D=e.createElementVNode("svg",{class:"i-small",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"clip-rule":"evenodd",d:"m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",fill:"#8a8a8a","fill-rule":"evenodd"})],-1),I=[D],N={__name:"EditParameters",props:{items:{type:Array,default:()=>[]},title:String,addButtonLabel:String,emptyMessage:String,keyName:String,valueName:String},emits:["add-info","delete-info"],setup(c,{emit:s}){const o=c;function t(){s("add-info",{})}function l(a){s("delete-info",a)}const{items:r,title:m,emptyMessage:_,addButtonLabel:d,keyName:i,valueName:f}=e.toRefs(o);return(a,v)=>(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",C,[e.createElementVNode("h5",$,e.toDisplayString(e.unref(m)),1),e.createElementVNode("button",{onClick:t,class:"i-small pd-thin button-delete button"},"+")]),e.createElementVNode("div",q,[e.unref(r).length==0?(e.openBlock(),e.createElementBlock("p",P,e.toDisplayString(e.unref(_)),1)):e.createCommentVNode("",!0),e.unref(r).length==0?(e.openBlock(),e.createBlock(p._sfc_main,{key:1,onClick:t,class:"button"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)),1)]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),(u,g)=>(e.openBlock(),e.createElementBlock("div",{class:"mn-medium w-100 flex-nowrap flex",key:g},[e.createVNode(p.Field,{field:u[e.unref(i)],"onUpdate:field":h=>u[e.unref(i)]=h,placeholder:"Название параметра",class:"w-100 mn-r-small bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(p.Field,{field:u[e.unref(f)],"onUpdate:field":h=>u[e.unref(f)]=h,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("button",{onClick:h=>l(g),class:"mn-l-small button"},I,8,z)]))),128))])]))}},S=e.createElementVNode("div",{class:"flex-v-center flex-h-center flex w-100 h-100"}," upload ",-1),U={__name:"UploadImageMultiple",props:["uploadPath"],emits:["update:images"],setup(c,{emit:s}){const o=c,t=e.ref([]),l=e.ref(null);function r(){l.value.click()}async function m(d){let i=d.target.files,f=new FormData;for(let a=0;a<i.length;a++)f.append("file",i[a]);try{(await p.axios.create({baseURL:process.env.API_URL,withCredentials:!0}).post(`/api/upload/multiple?folderName=${encodeURIComponent(o.uploadPath)}`,f,{headers:{"Content-Type":"multipart/form-data"}})).data.forEach(u=>{t.value.push(u.filepath)}),s("update:images",t.value)}catch(a){console.error(a)}}function _(d){d.preventDefault(),m({target:{files:d.dataTransfer.files}})}return(d,i)=>(e.openBlock(),e.createElementBlock("div",{onClick:r,onDrop:_,onDragover:i[0]||(i[0]=e.withModifiers(()=>{},["prevent"])),class:"flex-v-center flex-h-center flex"},[S,e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:l,onChange:m,multiple:"",style:{display:"none"}},null,544)],32))}},L={key:0,class:"mn-big"},A={class:"flex-column block"},F=["src"],R=["onClick"],T={__name:"EditProductImages",props:{product:Object},setup(c){function s(t){console.log(t),console.log(n.state.current.images),n.state.current.images.push(...t)}function o(t){n.state.current.images.splice(t,1)}return(t,l)=>(e.openBlock(),e.createElementBlock("div",null,[c.product.images.length<1?(e.openBlock(),e.createElementBlock("p",L," The product doesn't have any images yet. ")):e.createCommentVNode("",!0),e.createVNode(e.unref(E.VueDraggableNext),{class:"cols-4 dragArea list-group w-full",list:c.product.images,sort:!0,onChange:t.log},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.product.images,(r,m)=>(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("img",{class:"w-100 mn-small",src:r},null,8,F),e.createElementVNode("a",{onClick:_=>o(m),class:"w-100 br-grey br-solid br-1px button"},"Удалить",8,R)]))),256))]),_:1},8,["list","onChange"]),e.createVNode(U,{"onUpdate:images":s,uploadPath:"organizations/"+t.$route.params._id+"/products",class:"mn-t-semi pd-small w-100 button bg-main"},null,8,["uploadPath"])]))}};const M={class:"for-transition w-100"},j={class:"pd-b-zero pd-t-zero pd-thin"},O={class:"pd-thin"},G={class:"flex-nowrap flex bg-grey pd-medium radius-big"},H={key:0,class:"mn-r-auto"},J={key:1,class:"mn-r-auto"},K={class:"flex-nowrap flex pd-thin"},Q={class:"pd-b-zero pd-t-zero pd-thin cols-2 gap-thin"},W={class:"mn-thin bg-grey pd-medium o-hidden radius-big"},X=e.createElementVNode("h3",{class:"mn-semi"},"Profile",-1),Y={class:"mn-semi"},Z=e.createElementVNode("h5",null,"Categories",-1),ee={class:""},te={class:"mn-thin bg-grey pd-medium o-hidden radius-big"},ne=e.createElementVNode("h3",{class:"mn-semi"},"Images",-1),oe={__name:"ProductEdit",async setup(c){let s,o;const t=b.useRoute(),l=b.useRouter();[s,o]=e.withAsyncContext(()=>n.actions.fetchCategories()),await s,o(),t.params.product&&([s,o]=e.withAsyncContext(()=>n.actions$1.read({_id:t.params.product})),await s,o());function r(){n.state.current.information.push({name:"",value:""})}function m(a){n.state.current.information.splice(a,1)}function _(){n.state.current.localization.push({locale:"",text:""})}function d(a){n.state.current.localization.splice(a,1)}function i(){t.params.product?n.actions$1.update(t.params.product,n.state.current):n.actions$1.create(t.params._id,n.state.current)}function f(){l.push({name:"ProductEdit",params:{_id:t.params._id,product:n.state.current._id}})}return(a,v)=>(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",j,[e.createVNode(n._sfc_main,{class:"pd-medium bg-grey radius-big"})]),e.createElementVNode("div",O,[e.createElementVNode("header",G,[e.unref(t).params.product?(e.openBlock(),e.createElementBlock("h1",H,"Edit Product")):(e.openBlock(),e.createElementBlock("h1",J,"Create Product")),e.createElementVNode("section",K,[e.createVNode(p._sfc_main,{submit:i,callback:f},{default:e.withCtx(()=>[e.createTextVNode("Save Product")]),_:1})])])]),e.createElementVNode("div",Q,[e.createElementVNode("div",W,[X,e.createVNode(w,{product:n.state.current},null,8,["product"]),e.createElementVNode("div",Y,[Z,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.state$1.all,(u,g)=>(e.openBlock(),e.createBlock(k.Checkbox,{label:u.name,name:"categories",value:u.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:n.state.current.category},null,8,["label","value","radio"]))),256))]),e.createVNode(N,{items:n.state.current.information,title:"Parameters",emptyMessage:"No parameters",addButtonLabel:"Add parameter",keyName:"name",valueName:"value",onAddInfo:r,onDeleteInfo:m},null,8,["items"]),e.createVNode(N,{items:n.state.current.localization,title:"Localization",emptyMessage:"No localizations",addButtonLabel:"Add localization",keyName:"locale",valueName:"text",onAddInfo:_,onDeleteInfo:d},null,8,["items"])]),e.createElementVNode("div",ee,[e.createElementVNode("div",te,[ne,e.createVNode(T,{product:n.state.current},null,8,["product"])])])])]))}};exports.default=oe;
@@ -0,0 +1,350 @@
1
+ import { toRefs as A, openBlock as n, createElementBlock as c, createTextVNode as C, toDisplayString as w, unref as s, createVNode as d, createElementVNode as e, createCommentVNode as k, createBlock as E, withCtx as N, Fragment as P, renderList as z, ref as U, withModifiers as B, withAsyncContext as D } from "vue";
2
+ import { useRoute as M, useRouter as R } from "vue-router";
3
+ import { s as r, a as V, b as $, _ as F, c as T } from "./organizations.client-d0cae5f4.mjs";
4
+ import "./inputs.validation-14e8e01f.mjs";
5
+ import { F as b, _ as L, a as j } from "./auth-5217f6a5.mjs";
6
+ import { C as O } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-d9c6e4d1.mjs";
7
+ import "vue-i18n";
8
+ import { S as q } from "./Publics-f4c3ef5b.mjs";
9
+ import { u as G } from "./vuex.esm-bundler-57d8b6ba.mjs";
10
+ import { V as H } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
11
+ import "./globals-96ba60e4.mjs";
12
+ import "./Tab-a243605d.mjs";
13
+ import "./ButtonFollow-5e19fc49.mjs";
14
+ import "./_plugin-vue_export-helper-dad06003.mjs";
15
+ import "./Feed-986ddd21.mjs";
16
+ import "./EmptyState-34d85f10.mjs";
17
+ import "./Chips-f0b7ce36.mjs";
18
+ import "./PlaceholderUserpic-14c6ea7e.mjs";
19
+ import "./Feed-530e40ab.mjs";
20
+ import "./IconEdit-f0ad8b9a.mjs";
21
+ import "./CardOrganization-df0a4506.mjs";
22
+ import "./organizations-2adff182.mjs";
23
+ import "./UploadImage-a3ef4012.mjs";
24
+ const J = { class: "mn-big flex-column flex" }, K = {
25
+ __name: "EditProductInfo",
26
+ props: {
27
+ product: Object
28
+ },
29
+ setup(m) {
30
+ const u = m, o = G();
31
+ return A(u), (t, l) => (n(), c("div", J, [
32
+ C(w(s(o).products.current) + " ", 1),
33
+ d(q, {
34
+ options: [
35
+ "unpublished",
36
+ "published",
37
+ "archivied"
38
+ ],
39
+ select: s(o).products.state.current.status,
40
+ "onUpdate:select": l[0] || (l[0] = (a) => s(o).products.state.current.status = a),
41
+ placeholder: "Display product",
42
+ class: "w-100 mn-small bg-white radius-small pd-medium"
43
+ }, null, 8, ["select"]),
44
+ d(b, {
45
+ field: s(o).products.state.current.name,
46
+ "onUpdate:field": l[1] || (l[1] = (a) => s(o).products.state.current.name = a),
47
+ placeholder: "Введите название",
48
+ class: "w-100 mn-small bg-white radius-small pd-medium"
49
+ }, null, 8, ["field"]),
50
+ d(b, {
51
+ field: s(o).products.state.current.price,
52
+ "onUpdate:field": l[2] || (l[2] = (a) => s(o).products.state.current.price = a),
53
+ placeholder: "Введите цену",
54
+ class: "w-100 mn-small bg-white radius-small pd-medium",
55
+ type: "number"
56
+ }, null, 8, ["field"]),
57
+ d(b, {
58
+ field: s(o).products.state.current.description,
59
+ "onUpdate:field": l[3] || (l[3] = (a) => s(o).products.state.current.description = a),
60
+ placeholder: "Введите описание",
61
+ class: "w-100 mn-small bg-white radius-small pd-medium",
62
+ type: "textarea"
63
+ }, null, 8, ["field"])
64
+ ]));
65
+ }
66
+ }, Q = { class: "mn-big" }, W = { class: "mn-small flex-nowrap flex" }, X = { class: "mn-r-thin" }, Y = { class: "flex-column flex" }, Z = {
67
+ key: 0,
68
+ class: "w-100 mn-small"
69
+ }, ee = ["onClick"], te = /* @__PURE__ */ e("svg", {
70
+ class: "i-small",
71
+ fill: "none",
72
+ height: "20",
73
+ viewBox: "0 0 20 20",
74
+ width: "20",
75
+ xmlns: "http://www.w3.org/2000/svg"
76
+ }, [
77
+ /* @__PURE__ */ e("path", {
78
+ "clip-rule": "evenodd",
79
+ d: "m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",
80
+ fill: "#8a8a8a",
81
+ "fill-rule": "evenodd"
82
+ })
83
+ ], -1), se = [
84
+ te
85
+ ], S = {
86
+ __name: "EditParameters",
87
+ props: {
88
+ items: {
89
+ type: Array,
90
+ default: () => []
91
+ },
92
+ title: String,
93
+ addButtonLabel: String,
94
+ emptyMessage: String,
95
+ keyName: String,
96
+ valueName: String
97
+ },
98
+ emits: ["add-info", "delete-info"],
99
+ setup(m, { emit: u }) {
100
+ const o = m;
101
+ function t() {
102
+ u("add-info", {});
103
+ }
104
+ function l(i) {
105
+ u("delete-info", i);
106
+ }
107
+ const { items: a, title: _, emptyMessage: v, addButtonLabel: f, keyName: p, valueName: g } = A(o);
108
+ return (i, I) => (n(), c("div", Q, [
109
+ e("div", W, [
110
+ e("h5", X, w(s(_)), 1),
111
+ e("button", {
112
+ onClick: t,
113
+ class: "i-small pd-thin button-delete button"
114
+ }, "+")
115
+ ]),
116
+ e("div", Y, [
117
+ s(a).length == 0 ? (n(), c("p", Z, w(s(v)), 1)) : k("", !0),
118
+ s(a).length == 0 ? (n(), E(L, {
119
+ key: 1,
120
+ onClick: t,
121
+ class: "button"
122
+ }, {
123
+ default: N(() => [
124
+ C(w(s(f)), 1)
125
+ ]),
126
+ _: 1
127
+ })) : k("", !0),
128
+ (n(!0), c(P, null, z(s(a), (h, x) => (n(), c("div", {
129
+ class: "mn-medium w-100 flex-nowrap flex",
130
+ key: x
131
+ }, [
132
+ d(b, {
133
+ field: h[s(p)],
134
+ "onUpdate:field": (y) => h[s(p)] = y,
135
+ placeholder: "Название параметра",
136
+ class: "w-100 mn-r-small bg-white radius-small pd-medium"
137
+ }, null, 8, ["field", "onUpdate:field"]),
138
+ d(b, {
139
+ field: h[s(g)],
140
+ "onUpdate:field": (y) => h[s(g)] = y,
141
+ placeholder: "Значение параметра",
142
+ class: "w-100 bg-white radius-small pd-medium"
143
+ }, null, 8, ["field", "onUpdate:field"]),
144
+ e("button", {
145
+ onClick: (y) => l(x),
146
+ class: "mn-l-small button"
147
+ }, se, 8, ee)
148
+ ]))), 128))
149
+ ])
150
+ ]));
151
+ }
152
+ }, oe = /* @__PURE__ */ e("div", { class: "flex-v-center flex-h-center flex w-100 h-100" }, " upload ", -1), ae = {
153
+ __name: "UploadImageMultiple",
154
+ props: [
155
+ "uploadPath"
156
+ ],
157
+ emits: ["update:images"],
158
+ setup(m, { emit: u }) {
159
+ const o = m, t = U([]), l = U(null);
160
+ function a() {
161
+ l.value.click();
162
+ }
163
+ async function _(f) {
164
+ let p = f.target.files, g = new FormData();
165
+ for (let i = 0; i < p.length; i++)
166
+ g.append("file", p[i]);
167
+ try {
168
+ (await j.create({ baseURL: process.env.API_URL, withCredentials: !0 }).post(`/api/upload/multiple?folderName=${encodeURIComponent(o.uploadPath)}`, g, {
169
+ headers: {
170
+ "Content-Type": "multipart/form-data"
171
+ }
172
+ })).data.forEach((h) => {
173
+ t.value.push(h.filepath);
174
+ }), u("update:images", t.value);
175
+ } catch (i) {
176
+ console.error(i);
177
+ }
178
+ }
179
+ function v(f) {
180
+ f.preventDefault(), _({
181
+ target: {
182
+ files: f.dataTransfer.files
183
+ }
184
+ });
185
+ }
186
+ return (f, p) => (n(), c("div", {
187
+ onClick: a,
188
+ onDrop: v,
189
+ onDragover: p[0] || (p[0] = B(() => {
190
+ }, ["prevent"])),
191
+ class: "flex-v-center flex-h-center flex"
192
+ }, [
193
+ oe,
194
+ e("input", {
195
+ type: "file",
196
+ ref_key: "fileInput",
197
+ ref: l,
198
+ onChange: _,
199
+ multiple: "",
200
+ style: { display: "none" }
201
+ }, null, 544)
202
+ ], 32));
203
+ }
204
+ }, le = {
205
+ key: 0,
206
+ class: "mn-big"
207
+ }, ne = { class: "flex-column block" }, re = ["src"], ie = ["onClick"], de = {
208
+ __name: "EditProductImages",
209
+ props: {
210
+ product: Object
211
+ },
212
+ setup(m) {
213
+ function u(t) {
214
+ console.log(t), console.log(r.current.images), r.current.images.push(...t);
215
+ }
216
+ function o(t) {
217
+ r.current.images.splice(t, 1);
218
+ }
219
+ return (t, l) => (n(), c("div", null, [
220
+ m.product.images.length < 1 ? (n(), c("p", le, " The product doesn't have any images yet. ")) : k("", !0),
221
+ d(s(H), {
222
+ class: "cols-4 dragArea list-group w-full",
223
+ list: m.product.images,
224
+ sort: !0,
225
+ onChange: t.log
226
+ }, {
227
+ default: N(() => [
228
+ (n(!0), c(P, null, z(m.product.images, (a, _) => (n(), c("div", ne, [
229
+ e("img", {
230
+ class: "w-100 mn-small",
231
+ src: a
232
+ }, null, 8, re),
233
+ e("a", {
234
+ onClick: (v) => o(_),
235
+ class: "w-100 br-grey br-solid br-1px button"
236
+ }, "Удалить", 8, ie)
237
+ ]))), 256))
238
+ ]),
239
+ _: 1
240
+ }, 8, ["list", "onChange"]),
241
+ d(ae, {
242
+ "onUpdate:images": u,
243
+ uploadPath: "organizations/" + t.$route.params._id + "/products",
244
+ class: "mn-t-semi pd-small w-100 button bg-main"
245
+ }, null, 8, ["uploadPath"])
246
+ ]));
247
+ }
248
+ };
249
+ const ce = { class: "for-transition w-100" }, ue = { class: "pd-b-zero pd-t-zero pd-thin" }, me = { class: "pd-thin" }, pe = { class: "flex-nowrap flex bg-grey pd-medium radius-big" }, fe = {
250
+ key: 0,
251
+ class: "mn-r-auto"
252
+ }, he = {
253
+ key: 1,
254
+ class: "mn-r-auto"
255
+ }, _e = { class: "flex-nowrap flex pd-thin" }, ge = { class: "pd-b-zero pd-t-zero pd-thin cols-2 gap-thin" }, ve = { class: "mn-thin bg-grey pd-medium o-hidden radius-big" }, be = /* @__PURE__ */ e("h3", { class: "mn-semi" }, "Profile", -1), ye = { class: "mn-semi" }, we = /* @__PURE__ */ e("h5", null, "Categories", -1), xe = { class: "" }, $e = { class: "mn-thin bg-grey pd-medium o-hidden radius-big" }, ke = /* @__PURE__ */ e("h3", { class: "mn-semi" }, "Images", -1), Ke = {
256
+ __name: "ProductEdit",
257
+ async setup(m) {
258
+ let u, o;
259
+ const t = M(), l = R();
260
+ [u, o] = D(() => V.fetchCategories()), await u, o(), t.params.product && ([u, o] = D(() => $.read({ _id: t.params.product })), await u, o());
261
+ function a() {
262
+ r.current.information.push({ name: "", value: "" });
263
+ }
264
+ function _(i) {
265
+ r.current.information.splice(i, 1);
266
+ }
267
+ function v() {
268
+ r.current.localization.push({ locale: "", text: "" });
269
+ }
270
+ function f(i) {
271
+ r.current.localization.splice(i, 1);
272
+ }
273
+ function p() {
274
+ t.params.product ? $.update(t.params.product, r.current) : $.create(t.params._id, r.current);
275
+ }
276
+ function g() {
277
+ l.push({ name: "ProductEdit", params: { _id: t.params._id, product: r.current._id } });
278
+ }
279
+ return (i, I) => (n(), c("div", ce, [
280
+ e("div", ue, [
281
+ d(F, { class: "pd-medium bg-grey radius-big" })
282
+ ]),
283
+ e("div", me, [
284
+ e("header", pe, [
285
+ s(t).params.product ? (n(), c("h1", fe, "Edit Product")) : (n(), c("h1", he, "Create Product")),
286
+ e("section", _e, [
287
+ d(L, {
288
+ submit: p,
289
+ callback: g
290
+ }, {
291
+ default: N(() => [
292
+ C("Save Product")
293
+ ]),
294
+ _: 1
295
+ })
296
+ ])
297
+ ])
298
+ ]),
299
+ e("div", ge, [
300
+ e("div", ve, [
301
+ be,
302
+ d(K, {
303
+ product: r.current
304
+ }, null, 8, ["product"]),
305
+ e("div", ye, [
306
+ we,
307
+ (n(!0), c(P, null, z(T.all, (h, x) => (n(), E(O, {
308
+ label: h.name,
309
+ name: "categories",
310
+ value: h.url,
311
+ class: "w-100 mn-t-small bg-white radius-small pd-small",
312
+ radio: r.current.category
313
+ }, null, 8, ["label", "value", "radio"]))), 256))
314
+ ]),
315
+ d(S, {
316
+ items: r.current.information,
317
+ title: "Parameters",
318
+ emptyMessage: "No parameters",
319
+ addButtonLabel: "Add parameter",
320
+ keyName: "name",
321
+ valueName: "value",
322
+ onAddInfo: a,
323
+ onDeleteInfo: _
324
+ }, null, 8, ["items"]),
325
+ d(S, {
326
+ items: r.current.localization,
327
+ title: "Localization",
328
+ emptyMessage: "No localizations",
329
+ addButtonLabel: "Add localization",
330
+ keyName: "locale",
331
+ valueName: "text",
332
+ onAddInfo: v,
333
+ onDeleteInfo: f
334
+ }, null, 8, ["items"])
335
+ ]),
336
+ e("div", xe, [
337
+ e("div", $e, [
338
+ ke,
339
+ d(de, {
340
+ product: r.current
341
+ }, null, 8, ["product"])
342
+ ])
343
+ ])
344
+ ])
345
+ ]));
346
+ }
347
+ };
348
+ export {
349
+ Ke as default
350
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),m=require("vue-router"),f=require("./Tab-6f0a4909.js"),y=require("./EmptyState-7658d7d6.js"),h=require("./CardOrganization-82c5b4c6.js"),k=require("./_plugin-vue_export-helper-f246444f.js"),g=require("./organizations-e97a0f85.js"),d=require("./auth-5a58f8cb.js");require("./inputs.validation-24ae76b9.js");require("./globals-928eb13c.js");require("vue-i18n");require("./ButtonFollow-959861db.js");const _={},v={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},w=e.createStaticVNode('<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="45" rx="5" ry="5" width="70%" height="50" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="110" rx="3" ry="3" width="90%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="130" rx="3" ry="3" width="70%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" mask="url(#myMask)" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>',6),x=[w];function B(u,t){return e.openBlock(),e.createElementBlock("svg",v,x)}const C=k._export_sfc(_,[["render",B]]),N={class:"feed"},p={__name:"Feed",props:{category:{type:String,default:null},selectedDate:{type:String,default:null},organization:{type:String,default:null},owner:{type:String,default:null},user:{type:[String,Number],default:null},member:{type:[String,Number],default:null},subscriber:{type:[String,Number],default:null},sortOrder:{type:String,default:"desc"},participant:{type:String,default:null},period:{type:String,default:null},status:{type:String,default:null}},setup(u){const t=u,a=e.ref([]),o=e.ref(!1),r=e.ref(!0),l=e.ref(0),n=e.ref(20),c=async()=>{if(o.value){l.value+=n.value;const i=await g.actions.read({skip:l.value,limit:n.value,category:t.category,sortOrder:t.sortOrder,member:t.member,subscriber:t.subscriber,onlyuser:t.onlyuser,user:t.user,date:t.selectedDate,owner:t.owner,organization:t.organization,period:t.period,status:t.status});i.length===0?o.value=!1:o.value=!0,a.value=[...a.value,...i]}};return e.onMounted(async()=>{r.value=!0,console.log(t.selectedDate);const i=await g.actions.read({skip:l.value,limit:n.value,category:t.category,member:t.member,subscriber:t.subscriber,onlyuser:t.onlyuser,sortOrder:t.sortOrder,user:t.user,owner:t.owner,date:t.selectedDate,organization:t.organization,period:t.period,status:t.status});i.length===0?o.value=!1:o.value=!0,a.value=i,r.value=!1}),(i,O)=>(e.openBlock(),e.createElementBlock("section",N,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[r.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.value,s=>(e.openBlock(),e.createBlock(C,{key:s}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!r.value&&a.value.length<1?(e.openBlock(),e.createBlock(y._sfc_main,{key:0,title:"No Organizations Found",description:"Currently, there are no organizations available. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"container"},{default:e.withCtx(()=>[!r.value&&a.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.value,(s,b)=>(e.openBlock(),e.createBlock(h._sfc_main,{onClick:E=>i.$router.push({name:"Organization",params:{_id:s._id}}),key:s._id,organization:s,user:u.user,type:"normal",class:e.normalizeClass(["w-100 radius-big mn-medium",{"br-b br-solid br-black-transp-10":b!==a.value.length-1}])},null,8,["onClick","organization","user","class"]))),128)):e.createCommentVNode("",!0),o.value&&a.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c,class:"w-100 bg-main button"},"Load more")):e.createCommentVNode("",!0)]),_:1})]))}},z={class:"pd-thin"},q={class:"mn-medium flex-v-center flex-nowrap flex"},V=e.createElementVNode("h2",{class:"mn-r-medium"},"Groups",-1),S={__name:"ProfileOrganizations",setup(u){const t=m.useRoute(),a=m.useRouter();let o=t.query.tab?t.query.tab:"member";const r=e.ref(o);return t.query.tab=r.value,e.watch(r,l=>{a.push({query:{...t.query,tab:l}})}),(l,n)=>(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("header",q,[V,d.state.user._id===e.unref(t).params._id?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:n[0]||(n[0]=c=>l.$router.push({name:"Create Organization"})),class:"radius-100p i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")):e.createCommentVNode("",!0)]),e.createVNode(f._sfc_main,{selected:r.value,"onUpdate:selected":n[1]||(n[1]=c=>r.value=c),tabs:[{name:"Member",value:"member"},{name:"Follower",value:"follower"}],class:"mn-medium mn-r-medium o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="member"?(e.openBlock(),e.createBlock(p,{key:0,user:d.state.user._id,owner:e.unref(t).params._id},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="follower"?(e.openBlock(),e.createBlock(p,{key:0,user:d.state.user._id,subscriber:e.unref(t).params._id},null,8,["user","subscriber"])):e.createCommentVNode("",!0)]),_:1})]))}};exports.default=S;
@@ -0,0 +1,212 @@
1
+ import { openBlock as r, createElementBlock as o, createStaticVNode as $, ref as c, onMounted as C, createVNode as d, TransitionGroup as v, withCtx as g, Fragment as k, renderList as w, createBlock as f, createCommentVNode as u, Transition as h, normalizeClass as N, watch as q, createElementVNode as O, unref as y } from "vue";
2
+ import { useRoute as M, useRouter as D } from "vue-router";
3
+ import { _ as F } from "./Tab-a243605d.mjs";
4
+ import { _ as L } from "./EmptyState-34d85f10.mjs";
5
+ import { _ as V } from "./CardOrganization-df0a4506.mjs";
6
+ import { _ as B } from "./_plugin-vue_export-helper-dad06003.mjs";
7
+ import { a as x } from "./organizations-2adff182.mjs";
8
+ import { s as _ } from "./auth-5217f6a5.mjs";
9
+ import "./inputs.validation-14e8e01f.mjs";
10
+ import "./globals-96ba60e4.mjs";
11
+ import "vue-i18n";
12
+ import "./ButtonFollow-5e19fc49.mjs";
13
+ const E = {}, G = {
14
+ width: "100%",
15
+ height: "20rem",
16
+ xmlns: "http://www.w3.org/2000/svg"
17
+ }, P = /* @__PURE__ */ $('<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="45" rx="5" ry="5" width="70%" height="50" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="110" rx="3" ry="3" width="90%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="130" rx="3" ry="3" width="70%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" mask="url(#myMask)" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>', 6), R = [
18
+ P
19
+ ];
20
+ function T(b, e) {
21
+ return r(), o("svg", G, R);
22
+ }
23
+ const U = /* @__PURE__ */ B(E, [["render", T]]), j = { class: "feed" }, z = {
24
+ __name: "Feed",
25
+ props: {
26
+ category: {
27
+ type: String,
28
+ default: null
29
+ },
30
+ selectedDate: {
31
+ type: String,
32
+ default: null
33
+ },
34
+ organization: {
35
+ type: String,
36
+ default: null
37
+ },
38
+ owner: {
39
+ type: String,
40
+ default: null
41
+ },
42
+ user: {
43
+ type: [String, Number],
44
+ default: null
45
+ },
46
+ member: {
47
+ type: [String, Number],
48
+ default: null
49
+ },
50
+ subscriber: {
51
+ type: [String, Number],
52
+ default: null
53
+ },
54
+ sortOrder: {
55
+ type: String,
56
+ default: "desc"
57
+ },
58
+ participant: {
59
+ type: String,
60
+ default: null
61
+ },
62
+ period: {
63
+ type: String,
64
+ default: null
65
+ },
66
+ status: {
67
+ type: String,
68
+ default: null
69
+ }
70
+ },
71
+ setup(b) {
72
+ const e = b, a = c([]), n = c(!1), t = c(!0), i = c(0), s = c(20), p = async () => {
73
+ if (n.value) {
74
+ i.value += s.value;
75
+ const l = await x.read({
76
+ skip: i.value,
77
+ limit: s.value,
78
+ category: e.category,
79
+ sortOrder: e.sortOrder,
80
+ member: e.member,
81
+ subscriber: e.subscriber,
82
+ onlyuser: e.onlyuser,
83
+ user: e.user,
84
+ date: e.selectedDate,
85
+ owner: e.owner,
86
+ organization: e.organization,
87
+ period: e.period,
88
+ status: e.status
89
+ });
90
+ l.length === 0 ? n.value = !1 : n.value = !0, a.value = [...a.value, ...l];
91
+ }
92
+ };
93
+ return C(async () => {
94
+ t.value = !0, console.log(e.selectedDate);
95
+ const l = await x.read({
96
+ skip: i.value,
97
+ limit: s.value,
98
+ category: e.category,
99
+ member: e.member,
100
+ subscriber: e.subscriber,
101
+ onlyuser: e.onlyuser,
102
+ sortOrder: e.sortOrder,
103
+ user: e.user,
104
+ owner: e.owner,
105
+ date: e.selectedDate,
106
+ organization: e.organization,
107
+ period: e.period,
108
+ status: e.status
109
+ });
110
+ l.length === 0 ? n.value = !1 : n.value = !0, a.value = l, t.value = !1;
111
+ }), (l, J) => (r(), o("section", j, [
112
+ d(v, {
113
+ tag: "ul",
114
+ name: "fade",
115
+ class: "o-hidden bg-grey radius-big"
116
+ }, {
117
+ default: g(() => [
118
+ t.value ? (r(!0), o(k, { key: 0 }, w(s.value, (m) => (r(), f(U, { key: m }))), 128)) : u("", !0)
119
+ ]),
120
+ _: 1
121
+ }),
122
+ d(h, { name: "fade" }, {
123
+ default: g(() => [
124
+ !t.value && a.value.length < 1 ? (r(), f(L, {
125
+ key: 0,
126
+ title: "No Organizations Found",
127
+ description: "Currently, there are no organizations available. Please check back later.",
128
+ class: "pd-medium mn-thin bg-grey radius-big"
129
+ })) : u("", !0)
130
+ ]),
131
+ _: 1
132
+ }),
133
+ d(v, {
134
+ tag: "ul",
135
+ name: "fade",
136
+ class: "container"
137
+ }, {
138
+ default: g(() => [
139
+ !t.value && a.value.length > 0 ? (r(!0), o(k, { key: 0 }, w(a.value, (m, S) => (r(), f(V, {
140
+ onClick: (K) => l.$router.push({ name: "Organization", params: { _id: m._id } }),
141
+ key: m._id,
142
+ organization: m,
143
+ user: b.user,
144
+ type: "normal",
145
+ class: N(["w-100 radius-big mn-medium", {
146
+ "br-b br-solid br-black-transp-10": S !== a.value.length - 1
147
+ }])
148
+ }, null, 8, ["onClick", "organization", "user", "class"]))), 128)) : u("", !0),
149
+ n.value && a.value.length > 0 ? (r(), o("button", {
150
+ key: 1,
151
+ onClick: p,
152
+ class: "w-100 bg-main button"
153
+ }, "Load more")) : u("", !0)
154
+ ]),
155
+ _: 1
156
+ })
157
+ ]));
158
+ }
159
+ }, A = { class: "pd-thin" }, H = { class: "mn-medium flex-v-center flex-nowrap flex" }, I = /* @__PURE__ */ O("h2", { class: "mn-r-medium" }, "Groups", -1), le = {
160
+ __name: "ProfileOrganizations",
161
+ setup(b) {
162
+ const e = M(), a = D();
163
+ let n = e.query.tab ? e.query.tab : "member";
164
+ const t = c(n);
165
+ return e.query.tab = t.value, q(t, (i) => {
166
+ a.push({ query: { ...e.query, tab: i } });
167
+ }), (i, s) => (r(), o("div", A, [
168
+ O("header", H, [
169
+ I,
170
+ _.user._id === y(e).params._id ? (r(), o("button", {
171
+ key: 0,
172
+ onClick: s[0] || (s[0] = (p) => i.$router.push({
173
+ name: "Create Organization"
174
+ })),
175
+ class: "radius-100p i-big hover-scale-1 cursor-pointer t-white bg-second"
176
+ }, " + ")) : u("", !0)
177
+ ]),
178
+ d(F, {
179
+ selected: t.value,
180
+ "onUpdate:selected": s[1] || (s[1] = (p) => t.value = p),
181
+ tabs: [
182
+ { name: "Member", value: "member" },
183
+ { name: "Follower", value: "follower" }
184
+ ],
185
+ class: "mn-medium mn-r-medium o-hidden h5 radius-big bg-grey"
186
+ }, null, 8, ["selected"]),
187
+ d(h, { name: "slide-fade" }, {
188
+ default: g(() => [
189
+ t.value === "member" ? (r(), f(z, {
190
+ key: 0,
191
+ user: _.user._id,
192
+ owner: y(e).params._id
193
+ }, null, 8, ["user", "owner"])) : u("", !0)
194
+ ]),
195
+ _: 1
196
+ }),
197
+ d(h, { name: "slide-fade" }, {
198
+ default: g(() => [
199
+ t.value === "follower" ? (r(), f(z, {
200
+ key: 0,
201
+ user: _.user._id,
202
+ subscriber: y(e).params._id
203
+ }, null, 8, ["user", "subscriber"])) : u("", !0)
204
+ ]),
205
+ _: 1
206
+ })
207
+ ]));
208
+ }
209
+ };
210
+ export {
211
+ le as default
212
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue");require("./Breadcrumbs.vue_vue_type_style_index_0_lang-e32a3041.js");const p=require("./_plugin-vue_export-helper-f246444f.js"),f=require("./CardOrganization-82c5b4c6.js"),k=require("./EmptyState-7658d7d6.js"),d=require("./auth-5a58f8cb.js"),_=require("./organizations-e97a0f85.js"),h=require("./ButtonFollow-959861db.js"),y={key:0,class:"t-transp mn-r-small"},B=["onClick"],g=["onClick"],v={key:0,class:"mn-t-thin invalid-feedback"},b={__name:"Select",props:{label:String,select:[String,Object],placeholder:{type:String,default:"Please select an item"},options:{type:Array,default:()=>[]},validation:Boolean},emits:["update:select","focus","blur"],setup(a,{emit:t}){const n=a,l=e.ref(n.select),s=e.ref(!1);e.watch(()=>n.select,o=>{l.value=o});const c=e.computed(()=>n.select?n.options.filter(o=>o!==n.select):n.options),i=()=>{s.value=!s.value,t(s.value?"focus":"blur")},m=o=>{l.value=o,i(),t("update:select",l.value)};return(o,V)=>{var u;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass([o.$attrs.class,"flex-nowrap flex"])},[a.label?(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("span",null,e.toDisplayString(a.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("li",{onClick:e.withModifiers(i,["stop"]),class:"w-100"},[e.createElementVNode("span",null,e.toDisplayString(((u=l.value)==null?void 0:u.name)||l.value||a.placeholder),1)],8,B),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("ul",{key:0,class:e.normalizeClass([o.$attrs.class,"pos-absolute pos-l-0 z-index-5 w-100 mn-t-big"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),r=>(e.openBlock(),e.createElementBlock("li",null,[r?(e.openBlock(),e.createElementBlock("span",{key:0,onClick:N=>m(r),class:"w-100"},e.toDisplayString(r.name||r),9,g)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0)]),_:1})],2),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[a.validation?(e.openBlock(),e.createElementBlock("div",v," * "+e.toDisplayString(a.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64)}}},w=p._export_sfc(b,[["__scopeId","data-v-a78dbba1"]]);const E={class:"w-100 o-scroll"},x={key:1,class:"w-max gap-thin flex-nowrap flex"},C={__name:"Publics",setup(a){let t=e.ref(null);e.onMounted(async()=>{t.value=await _.actions.read({user:d.state.user._id,sort:"numberOfMemberships",limit:10,types:["public"]})});const n=({membership:l,isMember:s,targetId:c})=>{h.mutations.handleMembershipUpdate(t.value,l,s,c)};return(l,s)=>(e.openBlock(),e.createElementBlock("div",E,[!e.unref(t)||e.unref(t).length<1?(e.openBlock(),e.createBlock(k._sfc_main,{key:0,title:"Unfortunately, we couldn't find any recommendations for you",description:"Explore and find a community or organization that suits your interests.",class:"radius-big bg-grey pd-medium"})):(e.openBlock(),e.createElementBlock("div",x,[e.unref(t)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(t),(c,i)=>(e.openBlock(),e.createBlock(f._sfc_main,{key:c._id,organization:c,user:d.state.user,onUpdateMembership:n,class:"flex-child-1 flex-child w-100"},null,8,["organization","user"]))),128)):e.createCommentVNode("",!0)]))]))}};exports.Select=w;exports._sfc_main=C;