@ozdao/prometheus-framework 0.2.62 → 0.2.64

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. package/dist/products.server.js +8 -1
  2. package/dist/products.server.mjs +8 -1
  3. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  4. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +55 -1
  5. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
  6. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +1 -55
  7. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +20 -20
  9. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Select/Select.vue.js +97 -1
  11. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -97
  13. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  15. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  16. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  17. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  19. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  21. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  22. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
  23. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  24. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
  25. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  31. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
  33. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  35. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  37. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  39. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  41. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +1 -13
  43. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +13 -1
  45. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  51. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
  53. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  55. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  57. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  61. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  63. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  65. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  67. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +54 -48
  69. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +18 -18
  71. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +28 -33
  73. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +58 -44
  75. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  77. package/dist/prometheus-framework/src/modules/products/store/leftovers.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/products/store/leftovers.js +8 -8
  79. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  81. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  83. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +2 -2
  85. package/dist/style.css +1 -1
  86. package/package.json +1 -1
  87. package/src/components/Feed/Feed.vue +2 -1
  88. package/src/modules/products/components/pages/EditLeftover.vue +98 -86
  89. package/src/modules/products/components/pages/Leftovers.vue +3 -3
  90. package/src/modules/products/components/pages/Product.vue +2 -2
  91. package/src/modules/products/components/pages/Products.vue +12 -11
  92. package/src/modules/products/controllers/leftovers.controller.js +10 -1
  93. package/src/modules/products/store/leftovers.js +2 -2
@@ -1,32 +1,33 @@
1
- import { ref as y, computed as S, onMounted as C, openBlock as c, createElementBlock as d, Fragment as b, createElementVNode as n, toDisplayString as h, unref as g, createVNode as i, withCtx as f, renderList as D, createBlock as L, createCommentVNode as R } from "vue";
1
+ import { ref as y, computed as N, onMounted as S, openBlock as c, createElementBlock as d, createElementVNode as n, toDisplayString as b, unref as g, createVNode as i, withCtx as f, Fragment as C, renderList as D, createBlock as L, createCommentVNode as R } from "vue";
2
2
  import v from "../../../../components/Block/Block.vue.js";
3
3
  import "../../../../components/Field/Field.vue2.js";
4
- import A from "../../../../components/Select/Select.vue2.js";
4
+ import A from "../../../../components/Select/Select.vue.js";
5
5
  import "../../../../components/SelectMulti/SelectMulti.vue2.js";
6
- import k from "../blocks/CardPosition.vue.js";
6
+ import h from "../blocks/CardPosition.vue.js";
7
7
  import { useRoute as E, useRouter as P } from "vue-router";
8
8
  import { actions as p } from "../../../globals/store/globals.js";
9
- import { state as t, actions as l } from "../../store/leftovers.js";
9
+ import { state as z } from "../../../auth/store/auth.js";
10
+ import { state as e, actions as l } from "../../store/leftovers.js";
10
11
  import { state as B, actions as I } from "../../store/products.js";
11
12
  import "./EditLeftover.vue2.js";
12
- const U = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, V = { class: "" }, z = { class: "gap-thin flex-v-center flex-nojustify flex" }, j = { class: "mn-r-auto" }, Y = {
13
+ const U = { class: "pd-thin" }, V = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, j = { class: "" }, F = { class: "gap-thin flex-v-center flex-nojustify flex" }, M = { class: "mn-r-auto" }, te = {
13
14
  __name: "EditLeftover",
14
- setup(F) {
15
- const r = E(), u = P(), m = y(B.all);
15
+ setup(q) {
16
+ const t = E(), u = P(), m = y(B.all);
16
17
  y(null);
17
- const w = S(() => Number(t.current.positions.reduce((o, e) => Number(o) + Number(e.price), 0)));
18
- C(async () => {
19
- if (r.params.leftover)
18
+ const k = N(() => Number(e.current.positions.reduce((o, r) => Number(o) + Number(r.price), 0)));
19
+ S(async () => {
20
+ if (t.params.leftover)
20
21
  try {
21
- await l.fetch(r.params.leftover);
22
+ await l.fetch(t.params.leftover);
22
23
  } catch {
23
24
  console.error("error");
24
25
  }
25
26
  else
26
- t.current = { type: "", order: "", positions: [] };
27
+ e.current = { type: "", order: "", positions: [] };
27
28
  try {
28
29
  const o = await I.read({
29
- organization: r.params._id,
30
+ organization: t.params._id,
30
31
  limit: 100
31
32
  });
32
33
  m.value = o;
@@ -34,34 +35,39 @@ const U = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, V =
34
35
  console.error("error");
35
36
  }
36
37
  });
37
- function x() {
38
- r.params.leftover ? l.fetch(r.params.leftover) : t.current = { type: "", order: "", positions: [] };
39
- }
40
38
  function $() {
41
- t.current.organization = r.params._id, r.params.leftover ? l.update(t.current).then(
42
- () => u.push({ name: "Leftovers", params: { _id: r.params._id } }),
39
+ t.params.leftover ? l.fetch(t.params.leftover) : e.current = { type: "", order: "", positions: [] };
40
+ }
41
+ function w() {
42
+ e.current.organization = t.params._id, t.params.leftover ? l.update(e.current).then(
43
+ () => u.push({ name: "Leftovers", params: { _id: t.params._id } }),
43
44
  (o) => console.error("error")
44
- ) : l.create(t.current).then(
45
- () => u.push({ name: "Leftovers", params: { _id: r.params._id } }),
45
+ ) : (e.current.creator = {
46
+ type: "user",
47
+ target: z.user._id
48
+ }, e.current.owner = {
49
+ type: "organization",
50
+ target: t.params._id
51
+ }, console.log("leftover state is", e.current), l.create(e.current).then(
52
+ () => u.push({ name: "Leftovers", params: { _id: t.params._id } }),
46
53
  (o) => console.error("error")
47
- );
54
+ ));
48
55
  }
49
- function N() {
50
- l.delete(r.params.leftover).then(
51
- () => u.push({ name: "Leftovers", params: { _id: r.params._id } }),
56
+ function x() {
57
+ l.delete(t.params.leftover).then(
58
+ () => u.push({ name: "Leftovers", params: { _id: t.params._id } }),
52
59
  (o) => console.error("error")
53
60
  );
54
61
  }
55
- return (o, e) => (c(), d(b, null, [
56
- n("header", U, [
57
- n("h2", V, h(g(r).params.leftover ? "Edit " : "Add ") + " Inventory", 1),
62
+ return (o, r) => (c(), d("div", U, [
63
+ n("header", V, [
64
+ n("h2", j, b(g(t).params.leftover ? "Edit " : "Add ") + " Inventory", 1),
58
65
  i(A, {
59
- select: t.current.type,
60
- "onUpdate:select": e[0] || (e[0] = (s) => t.current.type = s),
66
+ select: e.current.type,
67
+ "onUpdate:select": r[0] || (r[0] = (s) => e.current.type = s),
61
68
  options: [
62
69
  "stock-in",
63
- "stock-out",
64
- "write-off"
70
+ "stock-out"
65
71
  ],
66
72
  placeholder: "Select type",
67
73
  class: "bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"
@@ -72,9 +78,9 @@ const U = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, V =
72
78
  class: "mn-b-semi"
73
79
  }, {
74
80
  default: f(() => [
75
- i(k, {
76
- onAdd: e[1] || (e[1] = (s) => p.add(
77
- t.current.positions,
81
+ i(h, {
82
+ onAdd: r[1] || (r[1] = (s) => p.add(
83
+ e.current.positions,
78
84
  s
79
85
  )),
80
86
  products: m.value
@@ -88,22 +94,22 @@ const U = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, V =
88
94
  class: "mn-b-semi"
89
95
  }, {
90
96
  default: f(() => [
91
- (c(!0), d(b, null, D(t.current.positions, (s, _) => (c(), L(k, {
97
+ (c(!0), d(C, null, D(e.current.positions, (s, _) => (c(), L(h, {
92
98
  key: s._id,
93
99
  product: s,
94
- array: t.current.positions,
100
+ array: e.current.positions,
95
101
  products: m.value,
96
- onAdd: e[2] || (e[2] = (a) => p.add(
97
- t.current.positions,
102
+ onAdd: r[2] || (r[2] = (a) => p.add(
103
+ e.current.positions,
98
104
  a
99
105
  )),
100
106
  onUpdate: (a) => p.update(
101
- t.current.positions,
107
+ e.current.positions,
102
108
  a,
103
109
  _
104
110
  ),
105
111
  onDelete: (a) => p.delete(
106
- t.current.positions,
112
+ e.current.positions,
107
113
  a,
108
114
  _
109
115
  )
@@ -113,28 +119,28 @@ const U = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, V =
113
119
  }),
114
120
  i(v, { class: "" }, {
115
121
  default: f(() => [
116
- n("section", z, [
117
- n("h3", j, " In total: " + h(o.formatPrice(w.value)), 1),
122
+ n("section", F, [
123
+ n("h3", M, " In total: " + b(o.formatPrice(k.value)), 1),
118
124
  n("a", {
119
- onClick: e[3] || (e[3] = (s) => $()),
125
+ onClick: r[3] || (r[3] = (s) => w()),
120
126
  class: "bg-main button"
121
127
  }, " Save "),
122
128
  n("a", {
123
129
  class: "t-white bg-second button",
124
- onClick: e[4] || (e[4] = (s) => x())
130
+ onClick: r[4] || (r[4] = (s) => $())
125
131
  }, " Reset "),
126
- g(r).params.leftover ? (c(), d("a", {
132
+ g(t).params.leftover ? (c(), d("a", {
127
133
  key: 0,
128
- onClick: e[5] || (e[5] = (s) => N()),
134
+ onClick: r[5] || (r[5] = (s) => x()),
129
135
  class: "t-white bg-red button"
130
136
  }, " Delete ")) : R("", !0)
131
137
  ])
132
138
  ]),
133
139
  _: 1
134
140
  })
135
- ], 64));
141
+ ]));
136
142
  }
137
143
  };
138
144
  export {
139
- Y as default
145
+ te as default
140
146
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("vue-router"),d=require("../../../../components/Tab/Tab.vue2.cjs"),m=require("../../../../components/Feed/Feed.vue.cjs"),f=require("../blocks/CardLeftover.vue.cjs"),u=require("../../store/leftovers.cjs");require("./Leftovers.vue2.cjs");const p={class:"pd-thin"},v={class:"mn-b-medium flex-v-center flex-nowrap flex"},b=e.createElementVNode("h2",{class:"mn-r-medium"},"Inventory",-1),_={class:"mn-b-semi pd-medium bg-grey radius-big"},g=e.createElementVNode("p",{class:"mn-b-thin"},"Spended:",-1),h={__name:"Leftovers",setup(k){const s=a.useRoute();a.useRouter();const l=e.ref(s.query.tab?s.query.tab:"all"),i=e.computed(()=>u.state.all.reduce((o,r)=>{const t=r.positions.reduce((n,c)=>n+c.price,0);return r.type==="stock-in"?o-t:r.type==="stock-out"?o+t:o},0));return(o,r)=>(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("header",v,[b,e.createElementVNode("button",{onClick:r[0]||(r[0]=t=>o.$router.push({name:"LeftoverAdd"})),class:"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")]),e.createElementVNode("section",_,[g,e.createElementVNode("h3",null,e.toDisplayString(o.formatPrice(i.value)),1)]),e.createVNode(d.default,{selected:l.value,"onUpdate:selected":r[1]||(r[1]=t=>l.value=t),tabs:[{name:"All",value:"all"},{name:"Stock-In",value:"stock-in"},{name:"Stock-Out",value:"stock-out"},{name:"Write-Off",value:"write-off"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(m.default,{states:{empty:{title:"No Leftovers Found",description:"Currently, there are no leftovers available."}},store:{read:t=>u.actions.read(t)},options:{limit:15,organization:e.unref(s).params._id}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,n=>(e.openBlock(),e.createBlock(f.default,{leftover:n,class:"bg-grey pd-small mn-b-thin radius-small"},null,8,["leftover"]))),256))]),_:1},8,["states","store","options"])]))}};exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("vue-router"),d=require("../../../../components/Tab/Tab.vue2.cjs"),m=require("../../../../components/Feed/Feed.vue.cjs"),p=require("../blocks/CardLeftover.vue.cjs"),u=require("../../store/leftovers.cjs");require("./Leftovers.vue2.cjs");const v={class:"pd-thin"},f={class:"mn-b-medium flex-v-center flex-nowrap flex"},b=e.createElementVNode("h2",{class:"mn-r-medium"},"Inventory",-1),_={class:"mn-b-semi pd-medium bg-grey radius-big"},g=e.createElementVNode("p",{class:"mn-b-thin"},"Spended:",-1),h={__name:"Leftovers",setup(k){const n=a.useRoute();a.useRouter();const s=e.ref(n.query.tab?n.query.tab:"all"),i=e.computed(()=>u.state.all.reduce((o,r)=>{const t=r.positions.reduce((l,c)=>l+c.price,0);return r.type==="stock-in"?o-t:r.type==="stock-out"?o+t:o},0));return(o,r)=>(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("header",f,[b,e.createElementVNode("button",{onClick:r[0]||(r[0]=t=>o.$router.push({name:"LeftoverAdd"})),class:"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")]),e.createElementVNode("section",_,[g,e.createElementVNode("h3",null,e.toDisplayString(o.formatPrice(i.value)),1)]),e.createVNode(d.default,{selected:s.value,"onUpdate:selected":r[1]||(r[1]=t=>s.value=t),tabs:[{name:"All",value:"all"},{name:"Stock-In",value:"stock-in"},{name:"Stock-Out",value:"stock-out"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(m.default,{states:{empty:{title:"No Leftovers Found",description:"Currently, there are no leftovers available."}},store:{read:t=>u.actions.read(t)},options:{limit:15,organization:e.unref(n).params._id,...s.value!=="all"&&{type:s.value}}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,l=>(e.openBlock(),e.createBlock(p.default,{leftover:l,class:"bg-grey pd-small mn-b-thin radius-small"},null,8,["leftover"]))),256))]),_:1},8,["states","store","options"])]))}};exports.default=h;
@@ -1,17 +1,17 @@
1
- import { ref as d, computed as p, openBlock as a, createElementBlock as i, createElementVNode as o, toDisplayString as f, createVNode as u, unref as v, withCtx as b, Fragment as _, renderList as h, createBlock as g } from "vue";
1
+ import { ref as m, computed as p, openBlock as a, createElementBlock as i, createElementVNode as o, toDisplayString as f, createVNode as u, unref as v, withCtx as b, Fragment as _, renderList as h, createBlock as g } from "vue";
2
2
  import { useRoute as y, useRouter as k } from "vue-router";
3
3
  import L from "../../../../components/Tab/Tab.vue2.js";
4
- import w from "../../../../components/Feed/Feed.vue.js";
5
- import x from "../blocks/CardLeftover.vue.js";
6
- import { state as C, actions as $ } from "../../store/leftovers.js";
4
+ import x from "../../../../components/Feed/Feed.vue.js";
5
+ import C from "../blocks/CardLeftover.vue.js";
6
+ import { state as $, actions as w } from "../../store/leftovers.js";
7
7
  import "./Leftovers.vue2.js";
8
- const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-nowrap flex" }, q = /* @__PURE__ */ o("h2", { class: "mn-r-medium" }, "Inventory", -1), A = { class: "mn-b-semi pd-medium bg-grey radius-big" }, E = /* @__PURE__ */ o("p", { class: "mn-b-thin" }, "Spended:", -1), D = {
8
+ const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-nowrap flex" }, q = /* @__PURE__ */ o("h2", { class: "mn-r-medium" }, "Inventory", -1), A = { class: "mn-b-semi pd-medium bg-grey radius-big" }, E = /* @__PURE__ */ o("p", { class: "mn-b-thin" }, "Spended:", -1), O = {
9
9
  __name: "Leftovers",
10
10
  setup(F) {
11
- const s = y();
11
+ const n = y();
12
12
  k();
13
- const l = d(s.query.tab ? s.query.tab : "all"), c = p(() => C.all.reduce((r, t) => {
14
- const e = t.positions.reduce((n, m) => n + m.price, 0);
13
+ const s = m(n.query.tab ? n.query.tab : "all"), c = p(() => $.all.reduce((r, t) => {
14
+ const e = t.positions.reduce((l, d) => l + d.price, 0);
15
15
  return t.type === "stock-in" ? r - e : t.type === "stock-out" ? r + e : r;
16
16
  }, 0));
17
17
  return (r, t) => (a(), i("div", B, [
@@ -29,17 +29,16 @@ const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-now
29
29
  o("h3", null, f(r.formatPrice(c.value)), 1)
30
30
  ]),
31
31
  u(L, {
32
- selected: l.value,
33
- "onUpdate:selected": t[1] || (t[1] = (e) => l.value = e),
32
+ selected: s.value,
33
+ "onUpdate:selected": t[1] || (t[1] = (e) => s.value = e),
34
34
  tabs: [
35
35
  { name: "All", value: "all" },
36
36
  { name: "Stock-In", value: "stock-in" },
37
- { name: "Stock-Out", value: "stock-out" },
38
- { name: "Write-Off", value: "write-off" }
37
+ { name: "Stock-Out", value: "stock-out" }
39
38
  ],
40
39
  class: "mn-b-small o-hidden h5 radius-big bg-grey"
41
40
  }, null, 8, ["selected"]),
42
- u(w, {
41
+ u(x, {
43
42
  states: {
44
43
  empty: {
45
44
  title: "No Leftovers Found",
@@ -47,19 +46,20 @@ const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-now
47
46
  }
48
47
  },
49
48
  store: {
50
- read: (e) => $.read(e)
49
+ read: (e) => w.read(e)
51
50
  },
52
51
  options: {
53
52
  limit: 15,
54
- organization: v(s).params._id
53
+ organization: v(n).params._id,
54
+ ...s.value !== "all" && { type: s.value }
55
55
  // user: user
56
56
  }
57
57
  }, {
58
58
  default: b(({
59
59
  items: e
60
60
  }) => [
61
- (a(!0), i(_, null, h(e, (n) => (a(), g(x, {
62
- leftover: n,
61
+ (a(!0), i(_, null, h(e, (l) => (a(), g(C, {
62
+ leftover: l,
63
63
  class: "bg-grey pd-small mn-b-thin radius-small"
64
64
  }, null, 8, ["leftover"]))), 256))
65
65
  ]),
@@ -69,5 +69,5 @@ const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-now
69
69
  }
70
70
  };
71
71
  export {
72
- D as default
72
+ O as default
73
73
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("vue-router"),q=require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const g=require("../sections/PopularProducts.vue.cjs"),y=require("../sections/SectionProduct.vue.cjs");require("../../store/categories.cjs");const h=require("../../../../../../node_modules/vue-meta/dist/vue-meta.esm-browser.min.cjs"),f=require("../../../auth/store/auth.cjs"),r=require("../../store/products.cjs");require("./Product.vue2.cjs");const k={class:"flex flex-column w-100 o-hidden gap-thin pd-thin"},B={key:0},S={__name:"Product",async setup(x){let o,n;const u=p.useRoute();p.useRouter(),[o,n]=e.withAsyncContext(()=>r.actions.fetchProduct(u.params.product)),await o,n(),u.meta.title.en=r.state.current.name,u.meta.title.ru=r.state.current.name;const t=e.computed(()=>r.state.current),m={messages:{en:{},ru:{}}},{t:_}=q.useI18n(m),v=e.computed(()=>({title:r.state.current.name,description:_("description")}));return h.useMeta(v),e.onMounted(()=>{}),(M,P)=>{var s,c,i,a,l,d;return e.openBlock(),e.createElementBlock("div",k,[e.createTextVNode(e.toDisplayString(t.value.quantity)+" ",1),t.value.ingredients?(e.openBlock(),e.createElementBlock("div",B,e.toDisplayString((c=(s=t.value)==null?void 0:s.ingredients[0])==null?void 0:c._id)+" "+e.toDisplayString((a=(i=t.value)==null?void 0:i.ingredients[0])==null?void 0:a.quantity)+" "+e.toDisplayString((d=(l=t.value)==null?void 0:l.ingredients[1])==null?void 0:d.quantity),1)):e.createCommentVNode("",!0),t.value?(e.openBlock(),e.createBlock(y.default,{key:1,product:t.value,user:f.state.user,class:"pos-relative"},null,8,["product","user"])):e.createCommentVNode("",!0),e.createVNode(g.default)])}}};exports.default=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router"),d=require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const l=require("../sections/PopularProducts.vue.cjs"),p=require("../sections/SectionProduct.vue.cjs");require("../../store/categories.cjs");const m=require("../../../../../../node_modules/vue-meta/dist/vue-meta.esm-browser.min.cjs"),_=require("../../../auth/store/auth.cjs"),t=require("../../store/products.cjs");require("./Product.vue2.cjs");const q={class:"flex flex-column w-100 o-hidden gap-thin pd-thin"},v={__name:"Product",async setup(f){let u,o;const r=s.useRoute();s.useRouter(),[u,o]=e.withAsyncContext(()=>t.actions.fetchProduct(r.params.product)),await u,o(),r.meta.title.en=t.state.current.name,r.meta.title.ru=t.state.current.name;const c=e.computed(()=>t.state.current),n={messages:{en:{},ru:{}}},{t:a}=d.useI18n(n),i=e.computed(()=>({title:t.state.current.name,description:a("description")}));return m.useMeta(i),e.onMounted(()=>{}),(h,M)=>(e.openBlock(),e.createElementBlock("div",q,[c.value?(e.openBlock(),e.createBlock(p.default,{key:0,product:c.value,user:_.state.user,class:"pos-relative"},null,8,["product","user"])):e.createCommentVNode("",!0),e.createVNode(l.default)]))}};exports.default=v;
@@ -1,47 +1,42 @@
1
- import { withAsyncContext as g, computed as l, onMounted as x, openBlock as n, createElementBlock as _, createTextVNode as k, toDisplayString as e, createCommentVNode as f, createBlock as B, createVNode as q } from "vue";
2
- import { useRoute as w, useRouter as M } from "vue-router";
3
- import { useI18n as N } from "vue-i18n";
1
+ import { withAsyncContext as i, computed as s, onMounted as p, openBlock as n, createElementBlock as d, createBlock as l, createCommentVNode as _, createVNode as f } from "vue";
2
+ import { useRoute as h, useRouter as x } from "vue-router";
3
+ import { useI18n as k } from "vue-i18n";
4
4
  import "../../../globals/localization/vue-i18n.js";
5
5
  import "../../../../components/Breadcrumbs/Breadcrumbs.vue.js";
6
- import V from "../sections/PopularProducts.vue.js";
7
- import $ from "../sections/SectionProduct.vue.js";
6
+ import v from "../sections/PopularProducts.vue.js";
7
+ import B from "../sections/SectionProduct.vue.js";
8
8
  import "../../store/categories.js";
9
- import { useMeta as C } from "../../../../../../node_modules/vue-meta/dist/vue-meta.esm-browser.min.js";
10
- import { state as P } from "../../../auth/store/auth.js";
11
- import { actions as R, state as r } from "../../store/products.js";
9
+ import { useMeta as w } from "../../../../../../node_modules/vue-meta/dist/vue-meta.esm-browser.min.js";
10
+ import { state as y } from "../../../auth/store/auth.js";
11
+ import { actions as M, state as t } from "../../store/products.js";
12
12
  import "./Product.vue2.js";
13
- const A = { class: "flex flex-column w-100 o-hidden gap-thin pd-thin" }, D = { key: 0 }, U = {
13
+ const $ = { class: "flex flex-column w-100 o-hidden gap-thin pd-thin" }, G = {
14
14
  __name: "Product",
15
- async setup(E) {
16
- let s, i;
17
- const o = w();
18
- M(), [s, i] = g(() => R.fetchProduct(o.params.product)), await s, i(), o.meta.title.en = r.current.name, o.meta.title.ru = r.current.name;
19
- const t = l(() => r.current), v = {
15
+ async setup(g) {
16
+ let o, r;
17
+ const e = h();
18
+ x(), [o, r] = i(() => M.fetchProduct(e.params.product)), await o, r(), e.meta.title.en = t.current.name, e.meta.title.ru = t.current.name;
19
+ const c = s(() => t.current), m = {
20
20
  messages: {
21
21
  en: {},
22
22
  ru: {}
23
23
  }
24
- }, { t: h } = N(v), y = l(() => ({
25
- title: r.current.name,
26
- description: h("description")
24
+ }, { t: a } = k(m), u = s(() => ({
25
+ title: t.current.name,
26
+ description: a("description")
27
27
  }));
28
- return C(y), x(() => {
29
- }), (I, S) => {
30
- var a, c, u, m, p, d;
31
- return n(), _("div", A, [
32
- k(e(t.value.quantity) + " ", 1),
33
- t.value.ingredients ? (n(), _("div", D, e((c = (a = t.value) == null ? void 0 : a.ingredients[0]) == null ? void 0 : c._id) + " " + e((m = (u = t.value) == null ? void 0 : u.ingredients[0]) == null ? void 0 : m.quantity) + " " + e((d = (p = t.value) == null ? void 0 : p.ingredients[1]) == null ? void 0 : d.quantity), 1)) : f("", !0),
34
- t.value ? (n(), B($, {
35
- key: 1,
36
- product: t.value,
37
- user: P.user,
38
- class: "pos-relative"
39
- }, null, 8, ["product", "user"])) : f("", !0),
40
- q(V)
41
- ]);
42
- };
28
+ return w(u), p(() => {
29
+ }), (C, N) => (n(), d("div", $, [
30
+ c.value ? (n(), l(B, {
31
+ key: 0,
32
+ product: c.value,
33
+ user: y.user,
34
+ class: "pos-relative"
35
+ }, null, 8, ["product", "user"])) : _("", !0),
36
+ f(v)
37
+ ]));
43
38
  }
44
39
  };
45
40
  export {
46
- U as default
41
+ G as default
47
42
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router");require("../../../../components/Tab/Tab.vue.cjs");const l=require("../../../../components/Feed/Feed.vue.cjs"),d=require("../sections/FilterProducts.vue.cjs"),p=require("../../../globals/components/blocks/BlockSearch.vue.cjs"),m=require("../blocks/CardProduct.vue.cjs"),u=require("../../store/products.cjs"),h={key:0,class:"mn-b-medium flex-v-center flex-nowrap flex"},f=e.createElementVNode("h2",{class:"mn-r-medium"},"Products",-1),g={class:"cols-2-1_3 bg-grey pd-thin radius-big gap-thin"},b={__name:"Products",setup(y){const t=s.useRoute(),c=s.useRouter();function i(r){let o={...t.query};o.search=r,c.push({query:o})}return(r,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(t).name!=="Organization"?(e.openBlock(),e.createElementBlock("header",h,[f,e.createElementVNode("button",{onClick:o[0]||(o[0]=a=>r.$router.push({name:"AddProduct"})),class:"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")])):e.createCommentVNode("",!0),e.createElementVNode("div",g,[e.createVNode(d.default),e.createElementVNode("div",null,[e.createVNode(p.default,{onSearch:i,placeholder:"Enter product name",class:"bg-white mn-b-thin"}),e.createTextVNode(" "+e.toDisplayString(r.tab)+" ",1),e.createVNode(l.default,{states:{empty:{title:"No Products Found",description:"Currently, there are no products available."}},store:{read:a=>u.actions.read(a),state:u.state},options:{limit:15,organization:e.unref(t).params._id,categories:e.unref(t).query.categories,prices:e.unref(t).query.prices,delivery:e.unref(t).query.delivery,search:e.unref(t).query.search,status:r.tab==="all"?"":r.tab?r.tab:""},class:"cols-3 gap-thin"},{default:e.withCtx(({items:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,n=>(e.openBlock(),e.createBlock(m.default,{key:n._id,product:n,class:"h-max",onClick:_=>r.$router.push({name:"Product Organization",params:{_id:e.unref(t).params._id,product:n._id}})},null,8,["product","onClick"]))),128))]),_:1},8,["states","store","options"])])])],64))}};exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("vue-router"),i=require("../../../../components/Tab/Tab.vue2.cjs"),m=require("../../../../components/Feed/Feed.vue.cjs"),p=require("../sections/FilterProducts.vue.cjs"),h=require("../../../globals/components/blocks/BlockSearch.vue.cjs"),b=require("../blocks/CardProduct.vue.cjs"),c=require("../../store/products.cjs"),v={class:"pd-thin"},f={key:0,class:"mn-b-medium flex-v-center flex-nowrap flex"},y=e.createElementVNode("h2",{class:"mn-r-medium"},"Products",-1),g={class:"cols-2-1_3 bg-grey pd-thin radius-big gap-thin"},q={__name:"Products",setup(_){const t=l.useRoute(),n=l.useRouter(),a=e.ref(t.query.tabProducts?t.query.tabProducts:"all");t.query.tabProducts=a.value,e.watch(a,o=>{n.replace({query:{...t.query,tabProducts:o}})});function d(o){let r={...t.query};r.search=o,n.push({query:r})}return(o,r)=>(e.openBlock(),e.createElementBlock("div",v,[e.unref(t).name!=="Organization"?(e.openBlock(),e.createElementBlock("header",f,[y,e.createElementVNode("button",{onClick:r[0]||(r[0]=u=>o.$router.push({name:"ProductAdd"})),class:"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")])):e.createCommentVNode("",!0),e.unref(t).name!=="Organization"?(e.openBlock(),e.createBlock(i.default,{key:1,selected:a.value,"onUpdate:selected":r[1]||(r[1]=u=>a.value=u),tabs:[{name:"All",value:"all"},{name:"Published",value:"published"},{name:"Unpublished",value:"unpublished"},{name:"Archivied",value:"archivied"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"])):e.createCommentVNode("",!0),e.createElementVNode("div",g,[e.createVNode(p.default),e.createElementVNode("div",null,[e.createVNode(h.default,{onSearch:d,placeholder:"Enter product name",class:"bg-white mn-b-thin"}),e.createVNode(m.default,{states:{empty:{title:"No Products Found",description:"Currently, there are no products available."}},store:{read:u=>c.actions.read(u),state:c.state},options:{limit:15,organization:e.unref(t).params._id,categories:e.unref(t).query.categories,prices:e.unref(t).query.prices,delivery:e.unref(t).query.delivery,search:e.unref(t).query.search,...a.value!=="all"&&{status:a.value}},class:"cols-3 gap-thin"},{default:e.withCtx(({items:u})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u,s=>(e.openBlock(),e.createBlock(b.default,{key:s._id,product:s,class:"h-max",onClick:k=>o.$router.push({name:"Product Organization",params:{_id:e.unref(t).params._id,product:s._id}})},null,8,["product","onClick"]))),128))]),_:1},8,["states","store","options"])])])]))}};exports.default=q;
@@ -1,42 +1,56 @@
1
- import { openBlock as s, createElementBlock as c, Fragment as l, unref as r, createElementVNode as i, createCommentVNode as p, createVNode as u, createTextVNode as h, toDisplayString as _, withCtx as f, renderList as g, createBlock as y } from "vue";
2
- import { useRoute as b, useRouter as v } from "vue-router";
3
- import "../../../../components/Tab/Tab.vue.js";
1
+ import { ref as _, watch as b, openBlock as i, createElementBlock as l, unref as t, createElementVNode as n, createCommentVNode as m, createBlock as p, createVNode as c, withCtx as f, Fragment as v, renderList as y } from "vue";
2
+ import { useRoute as g, useRouter as q } from "vue-router";
3
+ import P from "../../../../components/Tab/Tab.vue2.js";
4
4
  import k from "../../../../components/Feed/Feed.vue.js";
5
5
  import $ from "../sections/FilterProducts.vue.js";
6
- import q from "../../../globals/components/blocks/BlockSearch.vue.js";
7
- import C from "../blocks/CardProduct.vue.js";
8
- import { actions as N, state as P } from "../../store/products.js";
9
- const w = {
6
+ import C from "../../../globals/components/blocks/BlockSearch.vue.js";
7
+ import w from "../blocks/CardProduct.vue.js";
8
+ import { actions as x, state as z } from "../../store/products.js";
9
+ const N = { class: "pd-thin" }, A = {
10
10
  key: 0,
11
11
  class: "mn-b-medium flex-v-center flex-nowrap flex"
12
- }, V = /* @__PURE__ */ i("h2", { class: "mn-r-medium" }, "Products", -1), z = { class: "cols-2-1_3 bg-grey pd-thin radius-big gap-thin" }, T = {
12
+ }, B = /* @__PURE__ */ n("h2", { class: "mn-r-medium" }, "Products", -1), E = { class: "cols-2-1_3 bg-grey pd-thin radius-big gap-thin" }, H = {
13
13
  __name: "Products",
14
- setup(B) {
15
- const e = b(), m = v();
16
- function d(t) {
17
- let o = { ...e.query };
18
- o.search = t, m.push({ query: o });
14
+ setup(O) {
15
+ const e = g(), d = q(), a = _(e.query.tabProducts ? e.query.tabProducts : "all");
16
+ e.query.tabProducts = a.value, b(a, (s) => {
17
+ d.replace({ query: { ...e.query, tabProducts: s } });
18
+ });
19
+ function h(s) {
20
+ let r = { ...e.query };
21
+ r.search = s, d.push({ query: r });
19
22
  }
20
- return (t, o) => (s(), c(l, null, [
21
- r(e).name !== "Organization" ? (s(), c("header", w, [
22
- V,
23
- i("button", {
24
- onClick: o[0] || (o[0] = (a) => t.$router.push({
25
- name: "AddProduct"
23
+ return (s, r) => (i(), l("div", N, [
24
+ t(e).name !== "Organization" ? (i(), l("header", A, [
25
+ B,
26
+ n("button", {
27
+ onClick: r[0] || (r[0] = (o) => s.$router.push({
28
+ name: "ProductAdd"
26
29
  })),
27
30
  class: "radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"
28
31
  }, " + ")
29
- ])) : p("", !0),
30
- i("div", z, [
31
- u($),
32
- i("div", null, [
33
- u(q, {
34
- onSearch: d,
32
+ ])) : m("", !0),
33
+ t(e).name !== "Organization" ? (i(), p(P, {
34
+ key: 1,
35
+ selected: a.value,
36
+ "onUpdate:selected": r[1] || (r[1] = (o) => a.value = o),
37
+ tabs: [
38
+ { name: "All", value: "all" },
39
+ { name: "Published", value: "published" },
40
+ { name: "Unpublished", value: "unpublished" },
41
+ { name: "Archivied", value: "archivied" }
42
+ ],
43
+ class: "mn-b-small o-hidden h5 radius-big bg-grey"
44
+ }, null, 8, ["selected"])) : m("", !0),
45
+ n("div", E, [
46
+ c($),
47
+ n("div", null, [
48
+ c(C, {
49
+ onSearch: h,
35
50
  placeholder: "Enter product name",
36
51
  class: "bg-white mn-b-thin"
37
52
  }),
38
- h(" " + _(t.tab) + " ", 1),
39
- u(k, {
53
+ c(k, {
40
54
  states: {
41
55
  empty: {
42
56
  title: "No Products Found",
@@ -44,33 +58,33 @@ const w = {
44
58
  }
45
59
  },
46
60
  store: {
47
- read: (a) => N.read(a),
48
- state: P
61
+ read: (o) => x.read(o),
62
+ state: z
49
63
  },
50
64
  options: {
51
65
  limit: 15,
52
- organization: r(e).params._id,
53
- categories: r(e).query.categories,
54
- prices: r(e).query.prices,
55
- delivery: r(e).query.delivery,
56
- search: r(e).query.search,
57
- status: t.tab === "all" ? "" : t.tab ? t.tab : ""
66
+ organization: t(e).params._id,
67
+ categories: t(e).query.categories,
68
+ prices: t(e).query.prices,
69
+ delivery: t(e).query.delivery,
70
+ search: t(e).query.search,
71
+ ...a.value !== "all" && { status: a.value }
58
72
  // user: user
59
73
  },
60
74
  class: "cols-3 gap-thin"
61
75
  }, {
62
76
  default: f(({
63
- items: a
77
+ items: o
64
78
  }) => [
65
- (s(!0), c(l, null, g(a, (n) => (s(), y(C, {
66
- key: n._id,
67
- product: n,
79
+ (i(!0), l(v, null, y(o, (u) => (i(), p(w, {
80
+ key: u._id,
81
+ product: u,
68
82
  class: "h-max",
69
- onClick: (E) => t.$router.push({
83
+ onClick: (V) => s.$router.push({
70
84
  name: "Product Organization",
71
85
  params: {
72
- _id: r(e).params._id,
73
- product: n._id
86
+ _id: t(e).params._id,
87
+ product: u._id
74
88
  }
75
89
  })
76
90
  }, null, 8, ["product", "onClick"]))), 128))
@@ -79,9 +93,9 @@ const w = {
79
93
  }, 8, ["states", "store", "options"])
80
94
  ])
81
95
  ])
82
- ], 64));
96
+ ]));
83
97
  }
84
98
  };
85
99
  export {
86
- T as default
100
+ H as default
87
101
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue");require("../../../../components/Button/Button.vue2.cjs");const r=require("../../../../components/Field/Field.vue.cjs"),u=require("../../../../components/Select/Select.vue2.cjs"),i={__name:"EditProductInfo",props:{product:Object},setup(e){return(a,l)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(u.default,{select:e.product.status,"onUpdate:select":l[0]||(l[0]=t=>e.product.status=t),label:"Status",options:["unpublished","published","archivied"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),d.createVNode(r.default,{field:e.product.name,"onUpdate:field":l[1]||(l[1]=t=>e.product.name=t),label:"Name",placeholder:"Введите название",class:"w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["field"]),d.createVNode(r.default,{field:e.product.price,"onUpdate:field":l[3]||(l[3]=t=>e.product.price=t),label:"Price",placeholder:"Введите цену",class:"w-100 mn-b-small bg-white radius-small pd-medium",type:"number"},{default:d.withCtx(()=>[d.createVNode(u.default,{select:e.product.price.currency,"onUpdate:select":l[2]||(l[2]=t=>e.product.price.currency=t),placeholder:"฿",options:["฿"],class:"pos-relative bg-grey pd-thin radius-thin"},null,8,["select"])]),_:1},8,["field"]),d.createVNode(r.default,{field:e.product.description,"onUpdate:field":l[4]||(l[4]=t=>e.product.description=t),label:"Description",placeholder:"Введите описание",class:"w-100 bg-white radius-small pd-medium",type:"textarea"},null,8,["field"])],64))}};exports.default=i;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue");require("../../../../components/Button/Button.vue2.cjs");const r=require("../../../../components/Field/Field.vue.cjs"),u=require("../../../../components/Select/Select.vue.cjs"),i={__name:"EditProductInfo",props:{product:Object},setup(e){return(a,l)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(u.default,{select:e.product.status,"onUpdate:select":l[0]||(l[0]=t=>e.product.status=t),label:"Status",options:["unpublished","published","archivied"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),d.createVNode(r.default,{field:e.product.name,"onUpdate:field":l[1]||(l[1]=t=>e.product.name=t),label:"Name",placeholder:"Введите название",class:"w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["field"]),d.createVNode(r.default,{field:e.product.price,"onUpdate:field":l[3]||(l[3]=t=>e.product.price=t),label:"Price",placeholder:"Введите цену",class:"w-100 mn-b-small bg-white radius-small pd-medium",type:"number"},{default:d.withCtx(()=>[d.createVNode(u.default,{select:e.product.price.currency,"onUpdate:select":l[2]||(l[2]=t=>e.product.price.currency=t),placeholder:"฿",options:["฿"],class:"pos-relative bg-grey pd-thin radius-thin"},null,8,["select"])]),_:1},8,["field"]),d.createVNode(r.default,{field:e.product.description,"onUpdate:field":l[4]||(l[4]=t=>e.product.description=t),label:"Description",placeholder:"Введите описание",class:"w-100 bg-white radius-small pd-medium",type:"textarea"},null,8,["field"])],64))}};exports.default=i;
@@ -1,7 +1,7 @@
1
1
  import { openBlock as a, createElementBlock as u, Fragment as s, createVNode as d, withCtx as o } from "vue";
2
2
  import "../../../../components/Button/Button.vue2.js";
3
3
  import i from "../../../../components/Field/Field.vue.js";
4
- import r from "../../../../components/Select/Select.vue2.js";
4
+ import r from "../../../../components/Select/Select.vue.js";
5
5
  const f = {
6
6
  __name: "EditProductInfo",
7
7
  props: {
@@ -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}),e=c.reactive({all:[],current:{organization:"",type:"",order:"",positions:[]}}),d={async read(r){try{const t=await o.get("/leftovers",{params:r});return e.all=t.data,t.data}catch(t){throw s.setError(t),t}},async fetch(r){try{const t=await o.get("/leftovers/"+r);return e.current=t.data,t.data}catch(t){throw s.setError(t),t}},async create({organization:r,type:t,order:n,positions:i}){try{const a=await o.post("/leftovers",{organization:r,type:t,order:n,positions:i});return e.all.push(a.data),a.data}catch(a){throw s.setError(a),a}},async update(r){try{const t=await o.post("/leftovers/"+r._id,r);return e.current=t.data,t.data}catch(t){throw s.setError(t),t}},async delete(r){try{const t=await o.delete("/leftovers/"+r);return e.all.splice(e.all.findIndex(n=>n._id==r),1),t.data}catch(t){throw s.setError(t),t}}};c.watch(e,r=>{});exports.actions=d;exports.state=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),u=require("../../../../node_modules/axios/lib/axios.cjs"),s=require("../../globals/store/globals.cjs"),o=u.default.create({baseURL:process.env.API_URL,withCredentials:!0}),e=c.reactive({all:[],current:{organization:"",type:"",order:"",positions:[]}}),p={async read(r){try{const t=await o.get("/leftovers",{params:r});return e.all=t.data,t.data}catch(t){throw s.setError(t),t}},async fetch(r){try{const t=await o.get("/leftovers/"+r);return e.current=t.data,t.data}catch(t){throw s.setError(t),t}},async create({organization:r,type:t,order:n,positions:i,creator:l,owner:d}){try{const a=await o.post("/leftovers",{organization:r,type:t,order:n,positions:i,creator:l,owner:d});return e.all.push(a.data),a.data}catch(a){throw s.setError(a),a}},async update(r){try{const t=await o.post("/leftovers/"+r._id,r);return e.current=t.data,t.data}catch(t){throw s.setError(t),t}},async delete(r){try{const t=await o.delete("/leftovers/"+r);return e.all.splice(e.all.findIndex(n=>n._id==r),1),t.data}catch(t){throw s.setError(t),t}}};c.watch(e,r=>{});exports.actions=p;exports.state=e;
@@ -1,7 +1,7 @@
1
- import { reactive as i, watch as d } from "vue";
2
- import l from "../../../../node_modules/axios/lib/axios.js";
1
+ import { reactive as l, watch as p } from "vue";
2
+ import h from "../../../../node_modules/axios/lib/axios.js";
3
3
  import { setError as o } from "../../globals/store/globals.js";
4
- const s = l.create({ baseURL: process.env.API_URL, withCredentials: !0 }), e = i({
4
+ const s = h.create({ baseURL: process.env.API_URL, withCredentials: !0 }), e = l({
5
5
  all: [],
6
6
  current: {
7
7
  organization: "",
@@ -9,7 +9,7 @@ const s = l.create({ baseURL: process.env.API_URL, withCredentials: !0 }), e = i
9
9
  order: "",
10
10
  positions: []
11
11
  }
12
- }), u = {
12
+ }), f = {
13
13
  async read(r) {
14
14
  try {
15
15
  const t = await s.get("/leftovers", { params: r });
@@ -26,9 +26,9 @@ const s = l.create({ baseURL: process.env.API_URL, withCredentials: !0 }), e = i
26
26
  throw o(t), t;
27
27
  }
28
28
  },
29
- async create({ organization: r, type: t, order: n, positions: c }) {
29
+ async create({ organization: r, type: t, order: n, positions: c, creator: i, owner: d }) {
30
30
  try {
31
- const a = await s.post("/leftovers", { organization: r, type: t, order: n, positions: c });
31
+ const a = await s.post("/leftovers", { organization: r, type: t, order: n, positions: c, creator: i, owner: d });
32
32
  return e.all.push(a.data), a.data;
33
33
  } catch (a) {
34
34
  throw o(a), a;
@@ -51,9 +51,9 @@ const s = l.create({ baseURL: process.env.API_URL, withCredentials: !0 }), e = i
51
51
  }
52
52
  }
53
53
  };
54
- d(e, (r) => {
54
+ p(e, (r) => {
55
55
  });
56
56
  export {
57
- u as actions,
57
+ f as actions,
58
58
  e as state
59
59
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../components/Popup/Popup.vue.cjs"),d=require("../../../../components/Button/Button.vue.cjs"),m=require("../../../../components/Select/Select.vue2.cjs"),f=require("../../store/reports.cjs"),b=e.createElementVNode("h3",{class:"mn-b-small"}," Report Content ",-1),g=e.createElementVNode("p",{class:"p-medium mn-b-small"}," We strive to maintain a safe and comfortable environment for all users. If you encounter content that you believe violates our guidelines, please report it: ",-1),v=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Our moderators will review your report within 24 hours and take action if it violates our policies.",-1),h={__name:"FormReport",props:{user:{type:String,required:!1},type:{type:String,required:!1},reason:{type:String,required:!1},target:{type:String,required:!0},text:{type:String,default:"!"},status:{type:String,default:"new"}},setup(l){const t=l,r=e.reactive({user:t.user,type:t.type,reason:t.reason,target:t.target,status:t.status});function i(){r.user===null&&delete r.user,f.actions.create(r)}const s=e.ref(!1);function u(){s.value=!0}function a(){s.value=!1}return(p,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{onClick:o[0]||(o[0]=n=>u())},[e.renderSlot(p.$slots,"default")]),e.createVNode(c.default,{onClosePopup:a,isPopupOpen:s.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[b,g,e.createVNode(m.default,{select:r.reason,"onUpdate:select":o[1]||(o[1]=n=>r.reason=n),options:["harassment","spam","inappropriate","misinformation","copyright","other"],placeholder:"Select reason",class:"mn-b-small bg-white br-solid br-black-transp br-1px uppercase pd-medium t-semi bg-white t-black radius-medium"},null,8,["select"]),v,e.createVNode(d.default,{submit:i,callback:a,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode(" Report ")]),_:1})]),_:1},8,["isPopupOpen"])],64))}};exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../components/Popup/Popup.vue.cjs"),d=require("../../../../components/Button/Button.vue.cjs"),m=require("../../../../components/Select/Select.vue.cjs"),f=require("../../store/reports.cjs"),b=e.createElementVNode("h3",{class:"mn-b-small"}," Report Content ",-1),g=e.createElementVNode("p",{class:"p-medium mn-b-small"}," We strive to maintain a safe and comfortable environment for all users. If you encounter content that you believe violates our guidelines, please report it: ",-1),v=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Our moderators will review your report within 24 hours and take action if it violates our policies.",-1),h={__name:"FormReport",props:{user:{type:String,required:!1},type:{type:String,required:!1},reason:{type:String,required:!1},target:{type:String,required:!0},text:{type:String,default:"!"},status:{type:String,default:"new"}},setup(l){const t=l,r=e.reactive({user:t.user,type:t.type,reason:t.reason,target:t.target,status:t.status});function i(){r.user===null&&delete r.user,f.actions.create(r)}const s=e.ref(!1);function u(){s.value=!0}function a(){s.value=!1}return(p,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{onClick:o[0]||(o[0]=n=>u())},[e.renderSlot(p.$slots,"default")]),e.createVNode(c.default,{onClosePopup:a,isPopupOpen:s.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[b,g,e.createVNode(m.default,{select:r.reason,"onUpdate:select":o[1]||(o[1]=n=>r.reason=n),options:["harassment","spam","inappropriate","misinformation","copyright","other"],placeholder:"Select reason",class:"mn-b-small bg-white br-solid br-black-transp br-1px uppercase pd-medium t-semi bg-white t-black radius-medium"},null,8,["select"]),v,e.createVNode(d.default,{submit:i,callback:a,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode(" Report ")]),_:1})]),_:1},8,["isPopupOpen"])],64))}};exports.default=h;