@ozdao/prometheus-framework 0.2.36 → 0.2.38

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. package/dist/main.css +1 -1
  2. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  3. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +42 -52
  4. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  5. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  6. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
  7. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +39 -242
  8. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -0
  9. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +373 -0
  10. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.cjs +1 -0
  11. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.js +4 -0
  12. package/dist/prometheus-framework/src/components/FieldPhone/click-outside.cjs +1 -2
  13. package/dist/prometheus-framework/src/components/FieldPhone/click-outside.js +13 -13
  14. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +111 -2
  16. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +49 -47
  18. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  19. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +43 -42
  20. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs +2 -2
  21. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js +61 -56
  22. package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue.js +1 -1
  24. package/dist/prometheus-framework/src/modules/events/store/events.cjs +1 -1
  25. package/dist/prometheus-framework/src/modules/events/store/events.js +59 -39
  26. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +31 -31
  28. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +85 -55
  30. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/orders/store/orders.js +30 -38
  32. package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +31 -21
  34. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +95 -92
  36. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +54 -74
  38. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +58 -48
  40. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/products/store/products.js +26 -26
  42. package/dist/prometheus-framework.cjs.js +18 -18
  43. package/dist/prometheus-framework.es.js +507 -493
  44. package/dist/style.css +1 -1
  45. package/package.json +1 -1
  46. package/src/modules/globals/store/globals.js +0 -1
@@ -1,59 +1,71 @@
1
- import { openBlock as u, createElementBlock as p, createVNode as a, withCtx as t, createElementVNode as d } from "vue";
1
+ import { onMounted as y, openBlock as p, createElementBlock as f, createVNode as d, withCtx as a, createElementVNode as o } from "vue";
2
+ import { state as t } from "../../../globals/store/globals.js";
2
3
  import "../../store/orders.js";
3
- import s from "../../../../components/Block/Block.vue.js";
4
- import i from "../../../../components/Field/Field.vue2.js";
5
- import f from "../../../../components/FieldPhone/FieldPhone.vue.js";
6
- import o from "../../../../components/Select/Select.vue2.js";
7
- import y from "../../../../components/Address/Address.vue2.js";
8
- import n from "../../../../components/Radio/Radio.vue.js";
9
- const c = { class: "order-form col" }, h = /* @__PURE__ */ d("p", { class: "mn-b-small" }, " Prefer to chat instead of calling? Just drop your messenger info here: ", -1), v = { class: "flex-nowrap flex" }, b = { class: "mn-b-small flex-nowrap flex" }, g = { class: "mn-b-small flex-nowrap flex" }, k = {
4
+ import i from "../../../../components/Block/Block.vue.js";
5
+ import s from "../../../../components/Field/Field.vue2.js";
6
+ import v from "../../../../components/FieldPhone/FieldPhone2.vue.js";
7
+ import m from "../../../../components/Select/Select.vue2.js";
8
+ import b from "../../../../components/Address/Address.vue2.js";
9
+ import c from "../../../../components/LocationMarker/LocationMarker.vue2.js";
10
+ import u from "../../../../components/Radio/Radio.vue.js";
11
+ const g = { class: "order-form col" }, w = /* @__PURE__ */ o("p", { class: "mn-b-small" }, " Prefer to chat instead of calling? Just drop your messenger info here: ", -1), h = { class: "flex-nowrap flex" }, D = { class: "mn-b-small flex-nowrap flex" }, U = { class: "mn-b-small flex-nowrap flex" }, B = {
10
12
  __name: "FormOrderDetails",
11
13
  props: {
12
14
  order: Object
13
15
  },
14
- setup(e) {
15
- return (m, l) => (u(), p("div", c, [
16
- a(s, {
16
+ setup(l) {
17
+ const n = l;
18
+ return y(() => {
19
+ t.position && (n.order.delivery.address = t.position.address), t.position && (n.order.delivery.location = t.position.location);
20
+ }), (x, e) => (p(), f("div", g, [
21
+ d(i, {
17
22
  title: "Personal Data",
18
23
  class: "mn-b-thin"
19
24
  }, {
20
- default: t(() => [
21
- a(i, {
22
- field: e.order.user.name,
23
- "onUpdate:field": l[0] || (l[0] = (r) => e.order.user.name = r),
25
+ default: a(() => [
26
+ d(s, {
27
+ field: l.order.user.name,
28
+ "onUpdate:field": e[0] || (e[0] = (r) => l.order.user.name = r),
24
29
  label: "Name*",
25
30
  placeholder: "Enter your name",
26
31
  class: "bg-white pd-medium radius-small mn-b-thin"
27
32
  }, null, 8, ["field"]),
28
- a(f, {
29
- modelValue: e.order.user.phone,
30
- "onUpdate:modelValue": l[1] || (l[1] = (r) => e.order.user.phone = r),
33
+ d(v, {
34
+ modelValue: l.order.user.phone,
35
+ "onUpdate:modelValue": e[1] || (e[1] = (r) => l.order.user.phone = r),
36
+ onCountry: e[2] || (e[2] = (r) => {
37
+ l.order.user.number = r;
38
+ }),
39
+ inputOptions: {
40
+ placeholder: "Enter contact phone number",
41
+ type: "tel"
42
+ },
43
+ defaultCountry: "TH",
44
+ validCharactersOnly: !0,
31
45
  dropdownOptions: {
32
46
  showDialCodeInSelection: !0,
33
47
  showFlags: !0,
34
48
  showDialCodeInList: !0
35
49
  },
36
- validation: m.phoneValidation,
37
50
  mode: "national",
38
- inputOptions: { placeholder: "Enter contact phone number" },
39
51
  class: "bg-white pd-small radius-small mn-b-thin"
40
- }, null, 8, ["modelValue", "validation"]),
41
- h,
42
- d("div", v, [
43
- a(o, {
52
+ }, null, 8, ["modelValue"]),
53
+ w,
54
+ o("div", h, [
55
+ d(m, {
44
56
  options: [
45
57
  { name: "Telegram", value: "telegram" },
46
58
  { name: "WhatsApp", value: "whatsapp" },
47
59
  { name: "Line", value: "line" }
48
60
  ],
49
- select: e.order.user.messenger.type,
61
+ "onUpdate:select": e[3] || (e[3] = (r) => l.order.user.messenger.type = r.value),
50
62
  placeholder: "Messenger",
51
63
  size: "small",
52
64
  class: "bg-white pd-medium radius-small mn-r-small"
53
- }, null, 8, ["select"]),
54
- a(i, {
55
- field: e.order.user.messenger.value,
56
- "onUpdate:field": l[2] || (l[2] = (r) => e.order.user.messenger.value = r),
65
+ }),
66
+ d(s, {
67
+ field: l.order.user.messenger.value,
68
+ "onUpdate:field": e[4] || (e[4] = (r) => l.order.user.messenger.value = r),
57
69
  placeholder: "Enter your contact here",
58
70
  class: "bg-white pd-medium radius-small w-100"
59
71
  }, null, 8, ["field"])
@@ -61,39 +73,57 @@ const c = { class: "order-form col" }, h = /* @__PURE__ */ d("p", { class: "mn-b
61
73
  ]),
62
74
  _: 1
63
75
  }),
64
- a(s, {
76
+ d(i, {
65
77
  title: "Delivery",
66
78
  class: "mn-b-thin",
67
79
  tooltip: "Delivery by mail takes 3-5 days."
68
80
  }, {
69
- default: t(() => [
70
- d("div", b, [
71
- a(n, {
72
- radio: e.order.delivery.type,
73
- "onUpdate:radio": l[3] || (l[3] = (r) => e.order.delivery.type = r),
81
+ default: a(() => [
82
+ o("div", D, [
83
+ d(u, {
84
+ radio: l.order.delivery.type,
85
+ "onUpdate:radio": e[5] || (e[5] = (r) => l.order.delivery.type = r),
74
86
  label: "Courier",
75
87
  value: "courier",
76
88
  class: "bg-white pd-medium radius-small w-100 mn-r-small"
77
89
  }, null, 8, ["radio"]),
78
- a(n, {
79
- radio: e.order.delivery.type,
80
- "onUpdate:radio": l[4] || (l[4] = (r) => e.order.delivery.type = r),
90
+ d(u, {
91
+ radio: l.order.delivery.type,
92
+ "onUpdate:radio": e[6] || (e[6] = (r) => l.order.delivery.type = r),
81
93
  label: "Post",
82
94
  value: "Post",
83
95
  class: "bg-white pd-medium radius-small w-100 mn-r-small"
84
96
  }, null, 8, ["radio"])
85
97
  ]),
86
- a(y, {
87
- apiKey: "AIzaSyDDR6WgYB7XMt7yTDDzQNEdF_gTdUiq8dI",
88
- address: e.order.delivery.address,
89
- "onUpdate:address": l[5] || (l[5] = (r) => e.order.delivery.address = r),
98
+ d(b, {
90
99
  label: "Address",
91
- placeholder: "Enter delivery address",
92
- class: "bg-white pd-medium radius-small w-100 mn-b-thin"
93
- }, null, 8, ["address"]),
94
- a(i, {
95
- field: e.order.comment,
96
- "onUpdate:field": l[6] || (l[6] = (r) => e.order.comment = r),
100
+ apiKey: "AIzaSyDDR6WgYB7XMt7yTDDzQNEdF_gTdUiq8dI",
101
+ address: l.order.delivery.address,
102
+ location: l.order.delivery.location,
103
+ placeholder: "Enter your address",
104
+ class: "bg-white radius-tl-medium radius-tr-medium t-black br-grey br-solid br-2px pd-medium",
105
+ "onUpdate:location": e[7] || (e[7] = (r) => {
106
+ l.order.delivery.location = r;
107
+ }),
108
+ "onUpdate:address": e[8] || (e[8] = (r) => {
109
+ l.order.delivery.address = r;
110
+ })
111
+ }, null, 8, ["address", "location"]),
112
+ d(c, {
113
+ apiKey: "AIzaSyDDR6WgYB7XMt7yTDDzQNEdF_gTdUiq8dI",
114
+ address: l.order.delivery.address,
115
+ location: l.order.delivery.location,
116
+ class: "mn-b-thin radius-bl-medium radius-br-medium h-15r o-hidden",
117
+ "onUpdate:location": e[9] || (e[9] = (r) => {
118
+ l.order.delivery.location = r;
119
+ }),
120
+ "onUpdate:address": e[10] || (e[10] = (r) => {
121
+ l.order.delivery.address = r;
122
+ })
123
+ }, null, 8, ["address", "location"]),
124
+ d(s, {
125
+ field: l.order.comment,
126
+ "onUpdate:field": e[11] || (e[11] = (r) => l.order.comment = r),
97
127
  placeholder: "Comments regarding the address (apartment unit, floor level, building section)",
98
128
  type: "textarea",
99
129
  class: "bg-white pd-medium radius-small"
@@ -101,12 +131,12 @@ const c = { class: "order-form col" }, h = /* @__PURE__ */ d("p", { class: "mn-b
101
131
  ]),
102
132
  _: 1
103
133
  }, 8, ["tooltip"]),
104
- a(s, { title: "Payment" }, {
105
- default: t(() => [
106
- d("div", g, [
107
- a(o, {
108
- select: e.order.payment.type,
109
- "onUpdate:select": l[7] || (l[7] = (r) => e.order.payment.type = r),
134
+ d(i, { title: "Payment" }, {
135
+ default: a(() => [
136
+ o("div", U, [
137
+ d(m, {
138
+ select: l.order.payment.type,
139
+ "onUpdate:select": e[12] || (e[12] = (r) => l.order.payment.type = r),
110
140
  property: "value",
111
141
  options: [
112
142
  { name: "Cash On Delivery", value: "cash" },
@@ -125,5 +155,5 @@ const c = { class: "order-form col" }, h = /* @__PURE__ */ d("p", { class: "mn-b
125
155
  }
126
156
  };
127
157
  export {
128
- k as default
158
+ B as default
129
159
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),l=require("../../../../node_modules/axios/lib/axios.cjs"),s=require("../../globals/store/globals.cjs"),o=l.default.create({baseURL:process.env.API_URL,withCredentials:!0}),r=c.reactive({all:[],current:{_id:"",organization:"",positions:[],status:!1,comment:"",user:{_id:!1,name:"",phone:"",messenger:{type:"",value:""}},payment:{type:"",status:""},delivery:{type:null,address:"",status:""}}}),d={async create(t,e){try{r.current.positions=t,r.current.organization=e,console.log(r.current);const a=await o.post("/api/orders/create",r.current);return r.all.push(a.data),Promise.resolve(a.data)}catch(a){s.setError(a)}},async fetchOrder(t){try{const e=await o.get(`/api/orders/${t}`);console.log(e),r.current=e.data}catch(e){s.setError(e)}},async read(t){try{const e=await o.get("/api/orders/read");console.log(e),r.all=e.data}catch(e){s.setError(e)}},async update(t){try{const e=await o.post(`/api/orders/${t._id}`,t),a=r.all.findIndex(n=>n._id===t._id);a!==-1&&(r.all[a]=e.data)}catch(e){s.setError(e)}},async confirm(t){try{const e=await o.post(`/api/orders/confirm/${t}`),a=r.all.findIndex(n=>n._id===t);a!==-1&&(r.all[a]=e.data)}catch(e){s.setError(e)}},async changePaymentStatus(t,e){try{const a=await o.post(`/api/orders/payment/${t}`,{status:e}),n=r.all.findIndex(i=>i._id===t);n!==-1&&(r.all[n]=a.data)}catch(a){s.setError(a)}},async delete(t){try{await o.delete(`/api/orders/${t}`),r.all=r.all.filter(e=>e._id!==t)}catch(e){s.setError(e)}}};c.watch(r,(t,e)=>{});exports.actions=d;exports.state=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),l=require("../../../../node_modules/axios/lib/axios.cjs"),s=require("../../globals/store/globals.cjs"),n=l.default.create({baseURL:process.env.API_URL,withCredentials:!0}),r=c.reactive({all:[],current:{_id:"",organization:"",positions:[],status:null,comment:"",user:{_id:null,name:"",phone:null,messenger:{type:"",value:""}},payment:{type:"",status:""},delivery:{type:null,address:"",status:""}}}),d={async create(e,t){try{r.current.positions=e,r.current.organization=t;const a=await n.post("/api/orders/create",r.current);return r.all.push(a.data),a.data}catch(a){s.setError(a)}},async fetchOrder(e){try{const t=await n.get(`/api/orders/${e}`);return r.current=t.data,console.log(t.data),t.data}catch(t){throw s.setError(t),err}},async read(e){try{const t=await n.get("/api/orders/read");return r.all=t.data,t.data}catch(t){throw s.setError(t),t}},async update(e){try{const t=await n.post(`/api/orders/${e._id}`,e),a=r.all.findIndex(o=>o._id===e._id);return a!==-1&&(r.all[a]=t.data),t.data}catch(t){s.setError(t)}},async delete(e){try{await n.delete(`/api/orders/${e}`),r.all=r.all.filter(t=>t._id!==e)}catch(t){s.setError(t)}},async changePaymentStatus(e,t){try{const a=await n.post(`/api/orders/payment/${e}`,{status:t}),o=r.all.findIndex(i=>i._id===e);o!==-1&&(r.all[o]=a.data)}catch(a){s.setError(a)}}};c.watch(r,(e,t)=>{});exports.actions=d;exports.state=r;
@@ -1,18 +1,18 @@
1
- import { reactive as i, watch as l } from "vue";
2
- import d from "../../../../node_modules/axios/lib/axios.js";
1
+ import { reactive as i, watch as d } from "vue";
2
+ import l from "../../../../node_modules/axios/lib/axios.js";
3
3
  import { setError as s } from "../../globals/store/globals.js";
4
- const o = d.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = i({
4
+ const n = l.create({ baseURL: process.env.API_URL, withCredentials: !0 }), e = i({
5
5
  all: [],
6
6
  current: {
7
7
  _id: "",
8
8
  organization: "",
9
9
  positions: [],
10
- status: !1,
10
+ status: null,
11
11
  comment: "",
12
12
  user: {
13
- _id: !1,
13
+ _id: null,
14
14
  name: "",
15
- phone: "",
15
+ phone: null,
16
16
  messenger: {
17
17
  type: "",
18
18
  value: ""
@@ -28,67 +28,59 @@ const o = d.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = i
28
28
  status: ""
29
29
  }
30
30
  }
31
- }), m = {
32
- async create(e, t) {
31
+ }), h = {
32
+ async create(a, t) {
33
33
  try {
34
- a.current.positions = e, a.current.organization = t, console.log(a.current);
35
- const r = await o.post("/api/orders/create", a.current);
36
- return a.all.push(r.data), Promise.resolve(r.data);
34
+ e.current.positions = a, e.current.organization = t;
35
+ const r = await n.post("/api/orders/create", e.current);
36
+ return e.all.push(r.data), r.data;
37
37
  } catch (r) {
38
38
  s(r);
39
39
  }
40
40
  },
41
- async fetchOrder(e) {
41
+ async fetchOrder(a) {
42
42
  try {
43
- const t = await o.get(`/api/orders/${e}`);
44
- console.log(t), a.current = t.data;
43
+ const t = await n.get(`/api/orders/${a}`);
44
+ return e.current = t.data, console.log(t.data), t.data;
45
45
  } catch (t) {
46
- s(t);
46
+ throw s(t), err;
47
47
  }
48
48
  },
49
- async read(e) {
49
+ async read(a) {
50
50
  try {
51
- const t = await o.get("/api/orders/read");
52
- console.log(t), a.all = t.data;
51
+ const t = await n.get("/api/orders/read");
52
+ return e.all = t.data, t.data;
53
53
  } catch (t) {
54
- s(t);
54
+ throw s(t), t;
55
55
  }
56
56
  },
57
- async update(e) {
57
+ async update(a) {
58
58
  try {
59
- const t = await o.post(`/api/orders/${e._id}`, e), r = a.all.findIndex((n) => n._id === e._id);
60
- r !== -1 && (a.all[r] = t.data);
59
+ const t = await n.post(`/api/orders/${a._id}`, a), r = e.all.findIndex((o) => o._id === a._id);
60
+ return r !== -1 && (e.all[r] = t.data), t.data;
61
61
  } catch (t) {
62
62
  s(t);
63
63
  }
64
64
  },
65
- async confirm(e) {
65
+ async delete(a) {
66
66
  try {
67
- const t = await o.post(`/api/orders/confirm/${e}`), r = a.all.findIndex((n) => n._id === e);
68
- r !== -1 && (a.all[r] = t.data);
67
+ await n.delete(`/api/orders/${a}`), e.all = e.all.filter((t) => t._id !== a);
69
68
  } catch (t) {
70
69
  s(t);
71
70
  }
72
71
  },
73
- async changePaymentStatus(e, t) {
72
+ async changePaymentStatus(a, t) {
74
73
  try {
75
- const r = await o.post(`/api/orders/payment/${e}`, { status: t }), n = a.all.findIndex((c) => c._id === e);
76
- n !== -1 && (a.all[n] = r.data);
74
+ const r = await n.post(`/api/orders/payment/${a}`, { status: t }), o = e.all.findIndex((c) => c._id === a);
75
+ o !== -1 && (e.all[o] = r.data);
77
76
  } catch (r) {
78
77
  s(r);
79
78
  }
80
- },
81
- async delete(e) {
82
- try {
83
- await o.delete(`/api/orders/${e}`), a.all = a.all.filter((t) => t._id !== e);
84
- } catch (t) {
85
- s(t);
86
- }
87
79
  }
88
80
  };
89
- l(a, (e, t) => {
81
+ d(e, (a, t) => {
90
82
  });
91
83
  export {
92
- m as actions,
93
- a as state
84
+ h as actions,
85
+ e as state
94
86
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("../../globals/store/globals.cjs");const e=s.reactive({organization:null,positions:[],currentState:!1}),n={toggleShopcart(){e.currentState=!e.currentState},setShopcart(){try{localStorage.getItem("shopcart")&&(e.positions=JSON.parse(localStorage.getItem("shopcart")))}catch(t){throw console.error(t),t}},addProductToCart(t,i){const o=e.positions.find(r=>r._id===t._id);o?o.quantity++:e.positions.push({_id:t._id,images:t.images,name:t.name,price:t.price,quantity:1}),localStorage.setItem("shopcart",JSON.stringify(e.positions))},removeProduct(t){const i=e.positions.find(r=>r._id===t),o=e.positions.indexOf(i);o>-1&&(e.positions.splice(o,1),localStorage.setItem("shopcart",JSON.stringify(e.positions)))},decrementItemQuantity(t){const i=e.positions.find(r=>r._id===t),o=e.positions.indexOf(i);o>-1&&(i.quantity--,i.quantity<1&&e.positions.splice(o,1),localStorage.setItem("shopcart",JSON.stringify(e.positions)))},incrementItemQuantity(t){const i=e.positions.find(o=>o._id===t);i&&(i.quantity++,localStorage.setItem("shopcart",JSON.stringify(e.positions)))},resetShopcart({state:t}){t.positions=[],localStorage.removeItem("shopcart")}};s.computed(()=>Number(e.positions.reduce((t,i)=>t+i.price*i.quantity,0))),s.computed(()=>Number(e.positions.reduce((t,i)=>t+i.quantity,0))),s.computed(()=>Number(e.currentState));s.watch(e,(t,i)=>{});exports.actions=n;exports.state=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("../../globals/store/globals.cjs");const e=s.reactive({organization:null,positions:[],currentState:!1}),n={toggleShopcart(){e.currentState=!e.currentState},setShopcart(){try{const t=localStorage.getItem("shopcart");if(t){const o=JSON.parse(t);e.positions=o.positions,e.organization=o.organization}}catch(t){throw console.error(t),t}},addProductToCart(t,o){const i=e.positions.find(r=>r._id===t._id);i?i.quantity++:e.positions.push({_id:t._id,images:t.images,name:t.name,price:t.price,quantity:1,org_id:o}),localStorage.setItem("shopcart",JSON.stringify({positions:e.positions,organization:o}))},removeProduct(t){const o=e.positions.find(r=>r._id===t),i=e.positions.indexOf(o);i>-1&&(e.positions.splice(i,1),localStorage.setItem("shopcart",JSON.stringify(e.positions)))},decrementItemQuantity(t){const o=e.positions.find(r=>r._id===t),i=e.positions.indexOf(o);i>-1&&(o.quantity--,o.quantity<1&&e.positions.splice(i,1),localStorage.setItem("shopcart",JSON.stringify(e.positions)))},incrementItemQuantity(t){const o=e.positions.find(i=>i._id===t);o&&(o.quantity++,localStorage.setItem("shopcart",JSON.stringify(e.positions)))},resetShopcart({state:t}){t.positions=[],localStorage.removeItem("shopcart")}};s.computed(()=>Number(e.positions.reduce((t,o)=>t+o.price*o.quantity,0))),s.computed(()=>Number(e.positions.reduce((t,o)=>t+o.quantity,0))),s.computed(()=>Number(e.currentState));s.watch(e,(t,o)=>{});exports.actions=n;exports.state=e;
@@ -1,59 +1,69 @@
1
1
  import { reactive as n, computed as s, watch as a } from "vue";
2
2
  import "../../../../../node_modules/js-cookie/dist/js.cookie.js";
3
3
  import "../../globals/store/globals.js";
4
- const e = n({
4
+ const o = n({
5
5
  organization: null,
6
6
  positions: [],
7
7
  currentState: !1
8
- }), l = {
8
+ }), u = {
9
9
  toggleShopcart() {
10
- e.currentState = !e.currentState;
10
+ o.currentState = !o.currentState;
11
11
  },
12
12
  setShopcart() {
13
13
  try {
14
- localStorage.getItem("shopcart") && (e.positions = JSON.parse(localStorage.getItem("shopcart")));
14
+ const t = localStorage.getItem("shopcart");
15
+ if (t) {
16
+ const i = JSON.parse(t);
17
+ o.positions = i.positions, o.organization = i.organization;
18
+ }
15
19
  } catch (t) {
16
20
  throw console.error(t), t;
17
21
  }
18
22
  },
19
23
  addProductToCart(t, i) {
20
- const o = e.positions.find(
24
+ const e = o.positions.find(
21
25
  (r) => r._id === t._id
22
26
  );
23
- o ? o.quantity++ : e.positions.push({
27
+ e ? e.quantity++ : o.positions.push({
24
28
  _id: t._id,
25
29
  images: t.images,
26
30
  name: t.name,
27
31
  price: t.price,
28
- quantity: 1
29
- }), localStorage.setItem("shopcart", JSON.stringify(e.positions));
32
+ quantity: 1,
33
+ org_id: i
34
+ // Добавляем _id организации к каждому продукту
35
+ }), localStorage.setItem("shopcart", JSON.stringify({
36
+ positions: o.positions,
37
+ organization: i
38
+ // Сохраняем _id организации в корне объекта корзины
39
+ }));
30
40
  },
31
41
  removeProduct(t) {
32
- const i = e.positions.find(
42
+ const i = o.positions.find(
33
43
  (r) => r._id === t
34
- ), o = e.positions.indexOf(i);
35
- o > -1 && (e.positions.splice(o, 1), localStorage.setItem("shopcart", JSON.stringify(e.positions)));
44
+ ), e = o.positions.indexOf(i);
45
+ e > -1 && (o.positions.splice(e, 1), localStorage.setItem("shopcart", JSON.stringify(o.positions)));
36
46
  },
37
47
  decrementItemQuantity(t) {
38
- const i = e.positions.find(
48
+ const i = o.positions.find(
39
49
  (r) => r._id === t
40
- ), o = e.positions.indexOf(i);
41
- o > -1 && (i.quantity--, i.quantity < 1 && e.positions.splice(o, 1), localStorage.setItem("shopcart", JSON.stringify(e.positions)));
50
+ ), e = o.positions.indexOf(i);
51
+ e > -1 && (i.quantity--, i.quantity < 1 && o.positions.splice(e, 1), localStorage.setItem("shopcart", JSON.stringify(o.positions)));
42
52
  },
43
53
  incrementItemQuantity(t) {
44
- const i = e.positions.find(
45
- (o) => o._id === t
54
+ const i = o.positions.find(
55
+ (e) => e._id === t
46
56
  );
47
- i && (i.quantity++, localStorage.setItem("shopcart", JSON.stringify(e.positions)));
57
+ i && (i.quantity++, localStorage.setItem("shopcart", JSON.stringify(o.positions)));
48
58
  },
49
59
  resetShopcart({ state: t }) {
50
60
  t.positions = [], localStorage.removeItem("shopcart");
51
61
  }
52
62
  };
53
- s(() => Number(e.positions.reduce((t, i) => t + i.price * i.quantity, 0))), s(() => Number(e.positions.reduce((t, i) => t + i.quantity, 0))), s(() => Number(e.currentState));
54
- a(e, (t, i) => {
63
+ s(() => Number(o.positions.reduce((t, i) => t + i.price * i.quantity, 0))), s(() => Number(o.positions.reduce((t, i) => t + i.quantity, 0))), s(() => Number(o.currentState));
64
+ a(o, (t, i) => {
55
65
  });
56
66
  export {
57
- l as actions,
58
- e as state
67
+ u as actions,
68
+ o as state
59
69
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("vue-router"),d=require("../../../../components/Dropdown/Dropdown.vue.cjs"),m=require("../../../../components/Text/Text.vue.cjs"),g=require("../../../../components/Chips/Chips.vue.cjs"),b=require("../../../icons/navigation/IconEdit.vue.cjs"),f=require("../../../icons/placeholders/PlaceholderOrganizationPic.vue.cjs"),s=require("../elements/ButtonToggleMembership.vue.cjs"),k=require("../blocks/Socials.vue.cjs"),h=require("../../../reports/components/sections/FormReport.vue.cjs"),z=require("../../store/organizations.cjs"),B=require("../../store/memberships.cjs"),w={class:"t-center flex-center flex-column flex pd-medium radius-big bg-grey"},y={class:"bg-black pd-thin radius-small"},x=e.createElementVNode("button",{class:"w-100 bg-black br-solid br-1px br-white-transp-20 t-white button-small button"}," Report ",-1),V=["src"],N={class:"mn-b-thin"},E={class:"mn-b-medium p-big"},q={class:"t-semi mn-b-small"},C={key:6,class:"mn-t-small mn-b-thin"},S={__name:"DetailsTab",props:{organization:Object,user:Object},setup(t){const n=u.useRoute(),r=({membership:a,status:o,target:i},l,c)=>{B.mutations.handleMembershipUpdate(z.state.current,a,o,i,l,c)};return(a,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.createElementVNode("section",w,[t.user._id!==t.organization.owner?(e.openBlock(),e.createBlock(d.default,{key:0,label:"...",align:"right",class:"cursor-pointer pos-absolute pos-r-0 pos-t-0 pd-thin radius-extra"},{default:e.withCtx(()=>[e.createElementVNode("section",y,[e.createVNode(h.default,{user:t.user._id,type:"organization",target:t.organization._id,text:"Report",class:"w-100"},{default:e.withCtx(()=>[x]),_:1},8,["user","target"]),t.user._id&&t.user._id!==t.organization.owner?(e.openBlock(),e.createBlock(s.default,{key:0,user:t.user._id,type:"organization",role:"blocked",target:t.organization._id,status:t.organization.isBlocked,text:{create:"Block",remove:"Unblock"},onUpdateMembership:o[0]||(o[0]=i=>r(i,"isBlocked")),class:"t-white mn-t-thin bg-red"},null,8,["user","target","status"])):e.createCommentVNode("",!0)])]),_:1},8,["label"])):e.createCommentVNode("",!0),t.user._id===t.organization.owner?(e.openBlock(),e.createBlock(b.default,{key:1,onClick:o[1]||(o[1]=i=>a.$router.push({name:"Organization Edit",params:{_id:t.organization._id}})),class:"pos-absolute cursor-pointer pos-t-big pos-r-big i-regular t-transp"})):e.createCommentVNode("",!0),t.organization.profile.photo?(e.openBlock(),e.createElementBlock("img",{key:2,src:(a.FILE_SERVER_URL||"")+t.organization.profile.photo,class:"radius-big bg-grey flex-center flex mn-b-small i-extra"},null,8,V)):(e.openBlock(),e.createBlock(f.default,{key:3,class:"radius-medium mn-b-small i-extra"})),e.createElementVNode("h1",N,e.toDisplayString(t.organization.profile.name),1),e.createElementVNode("p",E,[e.createVNode(m.default,{text:t.organization.profile.description?t.organization.profile.description:"",maxLen:240},null,8,["text"])]),t.organization.profile.tags.length>0?(e.openBlock(),e.createBlock(g.default,{key:4,chips:t.organization.profile.tags,class:"mn-b-semi"},null,8,["chips"])):e.createCommentVNode("",!0),e.createElementVNode("p",q," 👨‍👨‍👧‍👧 "+e.toDisplayString(t.organization.numberOfSubscribers)+" followers ",1),t.user._id&&e.unref(n).params._id&&e.unref(n).params._id!==t.user._id&&t.organization.owner!==t.user._id?(e.openBlock(),e.createBlock(s.default,{key:5,user:t.user._id,type:"organization",role:"subscriber",target:t.organization._id,status:t.organization.isSubscriber,text:{create:"Follow",remove:"Unfollow"},onUpdateMembership:o[2]||(o[2]=i=>r(i,"isSubscriber","numberOfSubscribers")),class:"w-min mn-b-medium mn-r-auto mn-l-auto"},null,8,["user","target","status"])):e.createCommentVNode("",!0),Object.values(t.organization.socials).some(i=>i)?(e.openBlock(),e.createElementBlock("h4",C," Find us in socials ")):e.createCommentVNode("",!0),e.createVNode(k.default,{telegram:t.organization.socials.telegram,facebook:t.organization.socials.facebook,instagram:t.organization.socials.instagram,twitter:t.organization.socials.twitter,youtube:t.organization.socials.youtube},null,8,["telegram","facebook","instagram","twitter","youtube"])])]),_:1}))}};exports.default=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("vue-router"),d=require("../../../../components/Dropdown/Dropdown.vue.cjs"),m=require("../../../../components/Text/Text.vue.cjs"),g=require("../../../../components/Chips/Chips.vue.cjs"),b=require("../../../icons/navigation/IconEdit.vue.cjs"),k=require("../../../icons/placeholders/PlaceholderOrganizationPic.vue.cjs"),c=require("../elements/ButtonToggleMembership.vue.cjs"),f=require("../blocks/Socials.vue.cjs"),h=require("../../../reports/components/sections/FormReport.vue.cjs"),z=require("../../store/organizations.cjs"),B=require("../../store/memberships.cjs"),w={class:"t-center flex-center flex-column flex pd-medium radius-big bg-grey"},y={class:"bg-black pd-thin radius-small"},x=e.createElementVNode("button",{class:"w-100 bg-black br-solid br-1px br-white-transp-20 t-white button-small button"}," Report ",-1),V=["src"],N={class:"mn-b-thin"},E={class:"mn-b-medium p-big"},q={class:"t-semi mn-b-small"},C={key:6,class:"mn-t-small mn-b-thin"},S={__name:"DetailsTab",props:{organization:Object,user:Object},setup(t){const s=u.useRoute(),l=({membership:i,status:o,target:n},r,a)=>{B.mutations.handleMembershipUpdate(z.state.current,i,o,n,r,a)};return(i,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>{var n,r;return[e.createElementVNode("section",w,[t.user._id!==t.organization.owner?(e.openBlock(),e.createBlock(d.default,{key:0,label:"...",align:"right",class:"cursor-pointer pos-absolute pos-r-0 pos-t-0 pd-thin radius-extra"},{default:e.withCtx(()=>[e.createElementVNode("section",y,[e.createVNode(h.default,{user:t.user._id,type:"organization",target:t.organization._id,text:"Report",class:"w-100"},{default:e.withCtx(()=>[x]),_:1},8,["user","target"]),t.user._id&&t.user._id!==t.organization.owner?(e.openBlock(),e.createBlock(c.default,{key:0,user:t.user._id,type:"organization",role:"blocked",target:t.organization._id,status:t.organization.isBlocked,text:{create:"Block",remove:"Unblock"},onUpdateMembership:o[0]||(o[0]=a=>l(a,"isBlocked")),class:"t-white mn-t-thin bg-red"},null,8,["user","target","status"])):e.createCommentVNode("",!0)])]),_:1},8,["label"])):e.createCommentVNode("",!0),t.user._id===t.organization.owner?(e.openBlock(),e.createBlock(b.default,{key:1,onClick:o[1]||(o[1]=a=>i.$router.push({name:"Organization Edit",params:{_id:t.organization._id}})),class:"pos-absolute cursor-pointer pos-t-big pos-r-big i-regular t-transp"})):e.createCommentVNode("",!0),t.organization.profile.photo?(e.openBlock(),e.createElementBlock("img",{key:2,src:(i.FILE_SERVER_URL||"")+t.organization.profile.photo,class:"radius-big bg-grey flex-center flex mn-b-small i-extra"},null,8,V)):(e.openBlock(),e.createBlock(k.default,{key:3,class:"radius-medium mn-b-small i-extra"})),e.createElementVNode("h1",N,e.toDisplayString(t.organization.profile.name),1),e.createElementVNode("p",E,[e.createVNode(m.default,{text:t.organization.profile.description||"",maxLen:240},null,8,["text"])]),((r=(n=t.organization.profile)==null?void 0:n.tags)==null?void 0:r.length)>0?(e.openBlock(),e.createBlock(g.default,{key:4,chips:t.organization.profile.tags,class:"mn-b-semi"},null,8,["chips"])):e.createCommentVNode("",!0),e.createElementVNode("p",q," 👨‍👨‍👧‍👧 "+e.toDisplayString(t.organization.numberOfSubscribers)+" followers ",1),t.user._id&&e.unref(s).params._id&&e.unref(s).params._id!==t.user._id&&t.organization.owner!==t.user._id?(e.openBlock(),e.createBlock(c.default,{key:5,user:t.user._id,type:"organization",role:"subscriber",target:t.organization._id,status:t.organization.isSubscriber,text:{create:"Follow",remove:"Unfollow"},onUpdateMembership:o[2]||(o[2]=a=>l(a,"isSubscriber","numberOfSubscribers")),class:"w-min mn-b-medium mn-r-auto mn-l-auto"},null,8,["user","target","status"])):e.createCommentVNode("",!0),Object.values(t.organization.socials).some(a=>a)?(e.openBlock(),e.createElementBlock("h4",C," Find us in socials ")):e.createCommentVNode("",!0),e.createVNode(f.default,{telegram:t.organization.socials.telegram,facebook:t.organization.socials.facebook,instagram:t.organization.socials.instagram,twitter:t.organization.socials.twitter,youtube:t.organization.socials.youtube},null,8,["telegram","facebook","instagram","twitter","youtube"])])]}),_:1}))}};exports.default=S;