@ozdao/prometheus-framework 0.2.51 → 0.2.53

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. package/dist/main-0a2437f4.js +91 -0
  2. package/dist/main-482dc398.mjs +13626 -0
  3. package/dist/main-4fnApBsF.js +91 -0
  4. package/dist/main-b2JI9sFg.js +91 -0
  5. package/dist/main-c56d4c09.js +91 -0
  6. package/dist/main-cdd0be68.mjs +13628 -0
  7. package/dist/main-kjbLXQEa.mjs +13606 -0
  8. package/dist/main-x-9D8zvb.mjs +13604 -0
  9. package/dist/main.css +1 -1
  10. package/dist/organizations.server.js +2 -2
  11. package/dist/organizations.server.mjs +2 -2
  12. package/dist/products.server.js +81 -56
  13. package/dist/products.server.mjs +81 -56
  14. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +18 -20
  16. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +19 -19
  18. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +28 -26
  20. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +2 -2
  22. package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Map/Map.vue.js +35 -2
  24. package/dist/prometheus-framework/src/components/Map/Map.vue2.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Map/Map.vue2.js +2 -35
  26. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  28. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -0
  29. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +37 -0
  30. package/dist/prometheus-framework/src/modules/icons/entities/IconShopcart.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/icons/entities/IconShopcart.vue.js +21 -14
  32. package/dist/prometheus-framework/src/modules/icons/navigation/IconSearch.vue.cjs +1 -0
  33. package/dist/prometheus-framework/src/modules/icons/navigation/IconSearch.vue.js +24 -0
  34. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  36. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +2 -11
  38. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +11 -2
  40. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +49 -101
  42. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +25 -25
  43. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +68 -39
  45. package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.js +38 -48
  47. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +69 -62
  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 +131 -126
  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 +117 -146
  55. package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.js +13 -13
  57. package/dist/prometheus-framework/src/modules/organizations/router/products.router.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/organizations/router/products.router.js +22 -0
  59. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.cjs +1 -0
  60. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.js +45 -0
  61. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue2.cjs +1 -0
  62. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue2.js +4 -0
  63. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -0
  64. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +79 -0
  65. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -0
  66. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +193 -0
  67. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue2.cjs +1 -0
  68. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue2.js +4 -0
  69. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +43 -43
  71. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +65 -55
  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 +64 -51
  75. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +35 -33
  77. package/dist/prometheus-framework/src/modules/products/products.client.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/products/products.client.js +2 -2
  79. package/dist/prometheus-framework/src/modules/products/store/categories.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/products/store/categories.js +39 -27
  81. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/products/store/products.js +23 -23
  83. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
  85. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  87. package/dist/prometheus-framework.cjs.js +1 -1
  88. package/dist/prometheus-framework.es.js +1 -1
  89. package/dist/style.css +1 -1
  90. package/dist/web-0066fd51.mjs +55 -0
  91. package/dist/web-6b9fa713.js +1 -0
  92. package/dist/web-6dcbb74b.mjs +55 -0
  93. package/dist/web-caJAdsxy.js +1 -0
  94. package/dist/web-ee302c1d.js +1 -0
  95. package/dist/web-i08OVMw9.mjs +55 -0
  96. package/dist/web-ngl7bNhF.js +1 -0
  97. package/dist/web-t91TrxXa.mjs +55 -0
  98. package/package.json +1 -1
  99. package/src/components/Button/Button.vue +4 -6
  100. package/src/components/Feed/Feed.vue +2 -1
  101. package/src/components/Field/Field.vue +3 -1
  102. package/src/components/LocationMarker/LocationMarker.vue +1 -0
  103. package/src/modules/applications/applications.client.js +0 -1
  104. package/src/modules/globals/components/blocks/BlockSearch.vue +42 -0
  105. package/src/modules/icons/entities/IconProfile.vue +10 -1
  106. package/src/modules/icons/entities/IconShopcart.vue +12 -2
  107. package/src/modules/marketplace/components/layouts/Marketplace.vue +7 -14
  108. package/src/modules/marketplace/components/sections/Filters.vue +7 -1
  109. package/src/modules/mobile/components/NavigationBar/NavigationBar.vue +27 -7
  110. package/src/modules/orders/components/partials/ShopCart.vue +4 -1
  111. package/src/modules/organizations/components/blocks/CardDepartment.vue +34 -66
  112. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +50 -13
  113. package/src/modules/organizations/components/blocks/User.vue +18 -9
  114. package/src/modules/organizations/components/pages/Department.vue +19 -3
  115. package/src/modules/organizations/components/pages/DepartmentEdit.vue +14 -10
  116. package/src/modules/organizations/components/pages/Organization.vue +38 -71
  117. package/src/modules/organizations/components/sections/Feed.vue +1 -1
  118. package/src/modules/organizations/controllers/memberships.controller.js +2 -2
  119. package/src/modules/organizations/controllers/organizations.controller.js +0 -1
  120. package/src/modules/organizations/router/products.router.js +24 -4
  121. package/src/modules/products/components/blocks/CardCategory.vue +53 -0
  122. package/src/modules/products/components/pages/Categories.vue +90 -0
  123. package/src/modules/products/components/pages/CategoryEdit.vue +214 -0
  124. package/src/modules/products/components/pages/EditLeftover.vue +6 -4
  125. package/src/modules/products/components/pages/ProductEdit.vue +9 -1
  126. package/src/modules/products/components/pages/Products.vue +58 -38
  127. package/src/modules/products/components/sections/FilterProducts.vue +9 -6
  128. package/src/modules/products/controllers/categories.controller.js +30 -13
  129. package/src/modules/products/controllers/leftovers.controller.js +12 -5
  130. package/src/modules/products/controllers/products.controller.js +18 -0
  131. package/src/modules/products/models/category.model.js +42 -32
  132. package/src/modules/products/products.client.js +4 -2
  133. package/src/modules/products/store/categories.js +17 -3
  134. package/src/modules/products/store/products.js +4 -0
  135. package/src/modules/backoffice/components/admin/Categories.vue +0 -53
  136. package/src/modules/backoffice/components/admin/CategoryEdit.vue +0 -98
  137. package/src/modules/products/components/blocks/CategoryCard.vue +0 -42
  138. package/src/modules/products/router/products.router.js +0 -48
  139. /package/src/modules/{products → organizations}/components/pages/OrganizationCreate.vue +0 -0
  140. /package/src/modules/{products → organizations}/components/pages/OrganizationDetails.vue +0 -0
  141. /package/src/modules/{products → organizations}/components/pages/OrganizationDocuments.vue +0 -0
  142. /package/src/modules/{products → organizations}/components/pages/OrganizationPeople.vue +0 -0
@@ -0,0 +1,45 @@
1
+ import { resolveComponent as i, openBlock as m, createElementBlock as d, createElementVNode as r, toDisplayString as u, createVNode as _, unref as g, withCtx as p, createTextVNode as y } from "vue";
2
+ import { useRoute as f, useRouter as k } from "vue-router";
3
+ import "./CardCategory.vue2.js";
4
+ const C = { class: "flex-v-center flex" }, v = { class: "mn-r-auto" }, V = {
5
+ __name: "CardCategory",
6
+ props: {
7
+ category: Object
8
+ },
9
+ emits: ["delete"],
10
+ setup(e, { emit: n }) {
11
+ const a = n, s = f();
12
+ k();
13
+ const c = (t) => {
14
+ a("delete", t);
15
+ };
16
+ return (t, o) => {
17
+ const l = i("router-link");
18
+ return m(), d("div", C, [
19
+ r("h4", v, u(e.category.name), 1),
20
+ _(l, {
21
+ to: {
22
+ name: "CategoryEdit",
23
+ params: {
24
+ _id: g(s).params._id,
25
+ category: e.category.url
26
+ }
27
+ },
28
+ class: "mn-r-medium nav-link"
29
+ }, {
30
+ default: p(() => [
31
+ y(" Edit ")
32
+ ]),
33
+ _: 1
34
+ }, 8, ["to"]),
35
+ r("a", {
36
+ class: "nav-link",
37
+ onClick: o[0] || (o[0] = (x) => c(e.category))
38
+ }, " Delete ")
39
+ ]);
40
+ };
41
+ }
42
+ };
43
+ export {
44
+ V as default
45
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
@@ -0,0 +1,4 @@
1
+ const e = "";
2
+ export {
3
+ e as default
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.cjs"),l=require("vue-router"),t=require("../../store/categories.cjs"),d=require("../../../../components/Button/Button.vue2.cjs"),m=require("../../../../components/Block/Block.vue.cjs"),g=require("../blocks/CardCategory.vue.cjs"),f={class:"pd-thin"},p=e.createElementVNode("h1",{class:"mn-r-auto"}," Product Categories ",-1),_={__name:"Categories",setup(C){l.useRoute(),l.useRouter(),e.onMounted(async()=>{await t.actions.fetchCategories()});function s(){t.state.all.forEach((r,a)=>{r.order=a}),o()}async function o(){await t.actions.updateCategories(t.state.all)}async function i(r){confirm(`Are you sure you want to delete the category "${r.name}"?`)?await t.actions.deleteCategory(r.url):alert("Category deletion cancelled")}return(r,a)=>{const u=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",f,[e.createVNode(m.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[p,e.createVNode(u,{to:{name:"CategoryAdd",params:{_id:r.$route.params._id}},class:"mn-r-medium uppercase t-medium pd-small radius-big bg-white nav-link"},{default:e.withCtx(()=>[e.createTextVNode(" Add category ")]),_:1},8,["to"]),e.createVNode(d.default,{onClick:o,class:"pd-small radius-big bg-black t-white uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Change Order ")]),_:1})]),_:1}),e.createVNode(e.unref(c.VueDraggableNext),{class:"dragArea list-group w-full",list:t.state.all,"item-key":"order",onEnd:s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.all,(n,h)=>(e.openBlock(),e.createBlock(g.default,{key:n.id,category:n,onDelete:i,class:"pd-medium bg-grey radius-medium mn-b-thin"},null,8,["category"]))),128))]),_:1},8,["list"])])}}};exports.default=_;
@@ -0,0 +1,79 @@
1
+ import { onMounted as p, resolveComponent as _, openBlock as i, createElementBlock as d, createVNode as t, withCtx as r, createTextVNode as m, unref as g, Fragment as C, renderList as h, createBlock as y, createElementVNode as b } from "vue";
2
+ import { VueDraggableNext as k } from "../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.js";
3
+ import { useRoute as w, useRouter as x } from "vue-router";
4
+ import { actions as n, state as a } from "../../store/categories.js";
5
+ import $ from "../../../../components/Button/Button.vue2.js";
6
+ import v from "../../../../components/Block/Block.vue.js";
7
+ import A from "../blocks/CardCategory.vue.js";
8
+ const E = { class: "pd-thin" }, N = /* @__PURE__ */ b("h1", { class: "mn-r-auto" }, " Product Categories ", -1), T = {
9
+ __name: "Categories",
10
+ setup(V) {
11
+ w(), x(), p(async () => {
12
+ await n.fetchCategories();
13
+ });
14
+ function c() {
15
+ a.all.forEach((e, o) => {
16
+ e.order = o;
17
+ }), s();
18
+ }
19
+ async function s() {
20
+ await n.updateCategories(a.all);
21
+ }
22
+ async function u(e) {
23
+ confirm(`Are you sure you want to delete the category "${e.name}"?`) ? await n.deleteCategory(e.url) : alert("Category deletion cancelled");
24
+ }
25
+ return (e, o) => {
26
+ const f = _("router-link");
27
+ return i(), d("div", E, [
28
+ t(v, { class: "radius-big mn-b-thin flex-nowrap flex-v-center flex" }, {
29
+ default: r(() => [
30
+ N,
31
+ t(f, {
32
+ to: {
33
+ name: "CategoryAdd",
34
+ params: {
35
+ _id: e.$route.params._id
36
+ }
37
+ },
38
+ class: "mn-r-medium uppercase t-medium pd-small radius-big bg-white nav-link"
39
+ }, {
40
+ default: r(() => [
41
+ m(" Add category ")
42
+ ]),
43
+ _: 1
44
+ }, 8, ["to"]),
45
+ t($, {
46
+ onClick: s,
47
+ class: "pd-small radius-big bg-black t-white uppercase t-medium"
48
+ }, {
49
+ default: r(() => [
50
+ m(" Change Order ")
51
+ ]),
52
+ _: 1
53
+ })
54
+ ]),
55
+ _: 1
56
+ }),
57
+ t(g(k), {
58
+ class: "dragArea list-group w-full",
59
+ list: a.all,
60
+ "item-key": "order",
61
+ onEnd: c
62
+ }, {
63
+ default: r(() => [
64
+ (i(!0), d(C, null, h(a.all, (l, B) => (i(), y(A, {
65
+ key: l.id,
66
+ category: l,
67
+ onDelete: u,
68
+ class: "pd-medium bg-grey radius-medium mn-b-thin"
69
+ }, null, 8, ["category"]))), 128))
70
+ ]),
71
+ _: 1
72
+ }, 8, ["list"])
73
+ ]);
74
+ };
75
+ }
76
+ };
77
+ export {
78
+ T as default
79
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router"),i=require("../../../icons/navigation/IconDelete.vue.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),g=require("../../../../components/Select/Select.vue2.cjs"),d=require("../../../../components/Field/Field.vue2.cjs"),n=require("../../../../components/Block/Block.vue.cjs"),l=require("../../store/categories.cjs");require("./CategoryEdit.vue2.cjs");const b={class:"mn-r-auto"},h={class:"mn-b-medium w-100 flex-nowrap gap-thin flex"},w={class:"flex-v-center flex-nowrap flex"},x=e.createElementVNode("h4",{class:"mn-r-thin t-medium"},"Localization",-1),N=["onClick"],k=["onClick"],V=["onClick"],y={__name:"CategoryEdit",setup(C){const o=c.useRoute(),u=c.useRouter();o.params.category?l.actions.fetchCategory(o.params.category):l.actions.resetCategory(),e.computed(()=>l.state.current),e.computed(()=>o.name);function m(){o.params.category?l.actions.updateCategory(o.params.category):l.actions.addCategory()}function p(){u.push({name:"Categories Organization",params:{_id:o.params._id}})}return(_,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(n.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",b,e.toDisplayString(e.unref(o).params.category?"Edit Category":"Add Category"),1),e.createVNode(f.default,{submit:m,callback:p,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Save Category ")]),_:1})]),_:1}),e.createVNode(n.default,{title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",h,[e.createVNode(d.default,{field:l.state.current.order,"onUpdate:field":r[0]||(r[0]=t=>l.state.current.order=t),label:"Order",disabled:!0,class:"w-25 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.url,"onUpdate:field":r[1]||(r[1]=t=>l.state.current.url=t),label:"URL",placeholder:"Enter category URL",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.name,"onUpdate:field":r[2]||(r[2]=t=>l.state.current.name=t),label:"Name",placeholder:"Enter category name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),e.createVNode(g.default,{select:l.state.current.status,"onUpdate:select":r[3]||(r[3]=t=>l.state.current.status=t),label:"Status",options:["draft","internal","published","removed"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),e.createElementVNode("div",w,[x,e.createElementVNode("button",{onClick:r[4]||(r[4]=()=>l.state.current.localization.push({locale:"",text:""})),class:"i-small pd-thin button-delete button"}," + ")]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.localization,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.locale,"onUpdate:field":a=>t.locale=a,placeholder:"Locale",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.text,"onUpdate:field":a=>t.text=a,placeholder:"Text",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.localization.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,N)]))),128))]),_:1}),e.createVNode(n.default,{title:"Subcategories",placeholder:"No subcategories added yet",actions:[{label:"+",function:()=>l.state.current.subcategories.push({name:"",url:""})}],class:"mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.subcategories,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Subcategory name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.url,"onUpdate:field":a=>t.url=a,placeholder:"Subcategory",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.subcategories.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,k)]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Filters",placeholder:"No filters added yet",actions:[{label:"+",function:()=>l.state.current.filters.push({name:"",url:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.filters,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Filter name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.options,"onUpdate:field":a=>t.options=a,placeholder:"Filter options divided by ,",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.filters.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,V)]))),128))]),_:1},8,["actions"])],64))}};exports.default=y;
@@ -0,0 +1,193 @@
1
+ import { computed as h, openBlock as o, createElementBlock as c, Fragment as m, createVNode as l, withCtx as u, createElementVNode as d, toDisplayString as _, unref as U, createTextVNode as C, renderList as b } from "vue";
2
+ import { useRoute as k, useRouter as v } from "vue-router";
3
+ import g from "../../../icons/navigation/IconDelete.vue.js";
4
+ import S from "../../../../components/Button/Button.vue2.js";
5
+ import E from "../../../../components/Select/Select.vue2.js";
6
+ import i from "../../../../components/Field/Field.vue2.js";
7
+ import p from "../../../../components/Block/Block.vue.js";
8
+ import { actions as f, state as t } from "../../store/categories.js";
9
+ import "./CategoryEdit.vue2.js";
10
+ const N = { class: "mn-r-auto" }, z = { class: "mn-b-medium w-100 flex-nowrap gap-thin flex" }, F = { class: "flex-v-center flex-nowrap flex" }, L = /* @__PURE__ */ d("h4", { class: "mn-r-thin t-medium" }, "Localization", -1), R = ["onClick"], T = ["onClick"], V = ["onClick"], J = {
11
+ __name: "CategoryEdit",
12
+ setup($) {
13
+ const n = k(), w = v();
14
+ n.params.category ? f.fetchCategory(n.params.category) : f.resetCategory(), h(() => t.current), h(() => n.name);
15
+ function x() {
16
+ n.params.category ? f.updateCategory(n.params.category) : f.addCategory();
17
+ }
18
+ function y() {
19
+ w.push({
20
+ name: "Categories Organization",
21
+ params: {
22
+ _id: n.params._id
23
+ }
24
+ });
25
+ }
26
+ return (B, r) => (o(), c(m, null, [
27
+ l(p, { class: "radius-big mn-b-thin flex-nowrap flex-v-center flex" }, {
28
+ default: u(() => [
29
+ d("h1", N, _(U(n).params.category ? "Edit Category" : "Add Category"), 1),
30
+ l(S, {
31
+ submit: x,
32
+ callback: y,
33
+ class: "pd-small radius-big bg-main t-black uppercase t-medium"
34
+ }, {
35
+ default: u(() => [
36
+ C(" Save Category ")
37
+ ]),
38
+ _: 1
39
+ })
40
+ ]),
41
+ _: 1
42
+ }),
43
+ l(p, {
44
+ title: "Profile",
45
+ class: "mn-b-thin"
46
+ }, {
47
+ default: u(() => [
48
+ d("div", z, [
49
+ l(i, {
50
+ field: t.current.order,
51
+ "onUpdate:field": r[0] || (r[0] = (e) => t.current.order = e),
52
+ label: "Order",
53
+ disabled: !0,
54
+ class: "w-25 bg-white radius-small pd-medium"
55
+ }, null, 8, ["field"]),
56
+ l(i, {
57
+ field: t.current.url,
58
+ "onUpdate:field": r[1] || (r[1] = (e) => t.current.url = e),
59
+ label: "URL",
60
+ placeholder: "Enter category URL",
61
+ class: "w-100 bg-white radius-small pd-medium"
62
+ }, null, 8, ["field"]),
63
+ l(i, {
64
+ field: t.current.name,
65
+ "onUpdate:field": r[2] || (r[2] = (e) => t.current.name = e),
66
+ label: "Name",
67
+ placeholder: "Enter category name",
68
+ class: "w-100 bg-white radius-small pd-medium"
69
+ }, null, 8, ["field"])
70
+ ]),
71
+ l(E, {
72
+ select: t.current.status,
73
+ "onUpdate:select": r[3] || (r[3] = (e) => t.current.status = e),
74
+ label: "Status",
75
+ options: [
76
+ "draft",
77
+ "internal",
78
+ "published",
79
+ "removed"
80
+ ],
81
+ placeholder: "Display product",
82
+ class: "pos-relative w-100 mn-b-small bg-white radius-small pd-medium"
83
+ }, null, 8, ["select"]),
84
+ d("div", F, [
85
+ L,
86
+ d("button", {
87
+ onClick: r[4] || (r[4] = () => t.current.localization.push({ locale: "", text: "" })),
88
+ class: "i-small pd-thin button-delete button"
89
+ }, " + ")
90
+ ]),
91
+ (o(!0), c(m, null, b(t.current.localization, (e, s) => (o(), c("div", {
92
+ class: "gap-thin mn-b-thin flex-nowrap flex",
93
+ key: s
94
+ }, [
95
+ l(i, {
96
+ field: e.locale,
97
+ "onUpdate:field": (a) => e.locale = a,
98
+ placeholder: "Locale",
99
+ class: "w-100 bg-white radius-small pd-medium"
100
+ }, null, 8, ["field", "onUpdate:field"]),
101
+ l(i, {
102
+ field: e.text,
103
+ "onUpdate:field": (a) => e.text = a,
104
+ placeholder: "Text",
105
+ class: "w-100 bg-white radius-small pd-medium"
106
+ }, null, 8, ["field", "onUpdate:field"]),
107
+ d("div", {
108
+ onClick: () => t.current.localization.splice(s, 1),
109
+ class: "radius-small pd-small flex-center flex aspect-1x1 bg-red"
110
+ }, [
111
+ l(g, { class: "i-medium" })
112
+ ], 8, R)
113
+ ]))), 128))
114
+ ]),
115
+ _: 1
116
+ }),
117
+ l(p, {
118
+ title: "Subcategories",
119
+ placeholder: "No subcategories added yet",
120
+ actions: [{
121
+ label: "+",
122
+ function: () => t.current.subcategories.push({ name: "", url: "" })
123
+ }],
124
+ class: "mn-b-thin"
125
+ }, {
126
+ default: u(() => [
127
+ (o(!0), c(m, null, b(t.current.subcategories, (e, s) => (o(), c("div", {
128
+ class: "gap-thin mn-b-thin flex-nowrap flex",
129
+ key: s
130
+ }, [
131
+ l(i, {
132
+ field: e.name,
133
+ "onUpdate:field": (a) => e.name = a,
134
+ placeholder: "Subcategory name",
135
+ class: "w-100 bg-white radius-small pd-medium"
136
+ }, null, 8, ["field", "onUpdate:field"]),
137
+ l(i, {
138
+ field: e.url,
139
+ "onUpdate:field": (a) => e.url = a,
140
+ placeholder: "Subcategory",
141
+ class: "w-100 bg-white radius-small pd-medium"
142
+ }, null, 8, ["field", "onUpdate:field"]),
143
+ d("div", {
144
+ onClick: () => t.current.subcategories.splice(s, 1),
145
+ class: "radius-small pd-small flex-center flex aspect-1x1 bg-red"
146
+ }, [
147
+ l(g, { class: "i-medium" })
148
+ ], 8, T)
149
+ ]))), 128))
150
+ ]),
151
+ _: 1
152
+ }, 8, ["actions"]),
153
+ l(p, {
154
+ title: "Filters",
155
+ placeholder: "No filters added yet",
156
+ actions: [{
157
+ label: "+",
158
+ function: () => t.current.filters.push({ name: "", url: "" })
159
+ }]
160
+ }, {
161
+ default: u(() => [
162
+ (o(!0), c(m, null, b(t.current.filters, (e, s) => (o(), c("div", {
163
+ class: "gap-thin mn-b-thin flex-nowrap flex",
164
+ key: s
165
+ }, [
166
+ l(i, {
167
+ field: e.name,
168
+ "onUpdate:field": (a) => e.name = a,
169
+ placeholder: "Filter name",
170
+ class: "w-100 bg-white radius-small pd-medium"
171
+ }, null, 8, ["field", "onUpdate:field"]),
172
+ l(i, {
173
+ field: e.options,
174
+ "onUpdate:field": (a) => e.options = a,
175
+ placeholder: "Filter options divided by ,",
176
+ class: "w-100 bg-white radius-small pd-medium"
177
+ }, null, 8, ["field", "onUpdate:field"]),
178
+ d("div", {
179
+ onClick: () => t.current.filters.splice(s, 1),
180
+ class: "radius-small pd-small flex-center flex aspect-1x1 bg-red"
181
+ }, [
182
+ l(g, { class: "i-medium" })
183
+ ], 8, V)
184
+ ]))), 128))
185
+ ]),
186
+ _: 1
187
+ }, 8, ["actions"])
188
+ ], 64));
189
+ }
190
+ };
191
+ export {
192
+ J as default
193
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
@@ -0,0 +1,4 @@
1
+ const e = "";
2
+ export {
3
+ e as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Field/Field.vue.cjs");const g=require("../../../../components/Select/Select.vue2.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const p=require("../blocks/CardPosition.vue.cjs"),f=require("vue-router"),l=require("../../../globals/store/globals.cjs"),t=require("../../store/leftovers.cjs"),m=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const h={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},N={class:""},q={class:"gap-thin flex-v-center flex-nojustify flex"},B={class:"mn-r-auto"},V={__name:"EditLeftover",setup(E){const s=f.useRoute(),c=f.useRouter(),i=e.ref(m.state.all);e.ref(null);const v=e.computed(()=>t.state.current.positions.reduce((o,r)=>o+r.price*(r.quantity||1),0));e.onMounted(async()=>{if(s.params.leftover)try{await t.actions.fetch(s.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const o=await m.actions.read({organization:s.params._id,limit:100});i.value=o}catch{console.error("error")}});function k(){s.params.leftover?t.actions.fetch(s.params.leftover):t.state.current={type:"",order:"",positions:[]}}function y(){s.params.leftover?t.actions.update(t.state.current).then(()=>c.push({name:"Backoffice Leftovers"}),o=>console.error("error")):t.actions.create(t.state.current).then(()=>c.push({name:"Backoffice Leftovers"}),o=>console.error("error"))}function b(){t.actions.delete(s.params.leftover).then(()=>c.push({name:"Backoffice Leftovers"}),o=>console.error("error"))}return(o,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("header",h,[e.createElementVNode("h2",N,e.toDisplayString(e.unref(s).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(g.default,{select:t.state.current.type,"onUpdate:select":r[0]||(r[0]=n=>t.state.current.type=n),options:["stock-in","stock-out","write-off"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(u.default,{title:"Add Position",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(p.default,{onAdd:r[1]||(r[1]=n=>l.actions.add(t.state.current.positions,n)),products:i.value},null,8,["products"])]),_:1}),e.createVNode(u.default,{title:"Invetory Sheet",placeholder:"No positions added yet",class:"mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(n,d)=>(e.openBlock(),e.createBlock(p.default,{key:n._id,product:n,array:t.state.current.positions,products:i.value,onAdd:r[2]||(r[2]=a=>l.actions.add(t.state.current.positions,a)),onUpdate:a=>l.actions.update(t.state.current.positions,a,d),onDelete:a=>l.actions.delete(t.state.current.positions,a,d)},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1}),e.createVNode(u.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",q,[e.createElementVNode("h3",B," In total: "+e.toDisplayString(o.formatPrice(v.value)),1),e.createElementVNode("a",{onClick:r[3]||(r[3]=n=>y()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:r[4]||(r[4]=n=>k())}," Reset "),e.unref(s).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:r[5]||(r[5]=n=>b()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})],64))}};exports.default=V;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Field/Field.vue.cjs");const b=require("../../../../components/Select/Select.vue2.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const p=require("../blocks/CardPosition.vue.cjs"),m=require("vue-router"),l=require("../../../globals/store/globals.cjs"),t=require("../../store/leftovers.cjs"),f=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const g={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},h={class:""},N={class:"gap-thin flex-v-center flex-nojustify flex"},V={class:"mn-r-auto"},q={__name:"EditLeftover",setup(E){const o=m.useRoute(),i=m.useRouter(),c=e.ref(f.state.all);e.ref(null);const v=e.computed(()=>t.state.current.positions.reduce((s,r)=>s+r.price,0));e.onMounted(async()=>{if(o.params.leftover)try{await t.actions.fetch(o.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const s=await f.actions.read({organization:o.params._id,limit:100});c.value=s}catch{console.error("error")}});function y(){o.params.leftover?t.actions.fetch(o.params.leftover):t.state.current={type:"",order:"",positions:[]}}function k(){t.state.current.organization=o.params._id,o.params.leftover?t.actions.update(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error")):t.actions.create(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error"))}function _(){t.actions.delete(o.params.leftover).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error"))}return(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("header",g,[e.createElementVNode("h2",h,e.toDisplayString(e.unref(o).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(b.default,{select:t.state.current.type,"onUpdate:select":r[0]||(r[0]=n=>t.state.current.type=n),options:["stock-in","stock-out","write-off"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(u.default,{title:"Add Position",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(p.default,{onAdd:r[1]||(r[1]=n=>l.actions.add(t.state.current.positions,n)),products:c.value},null,8,["products"])]),_:1}),e.createVNode(u.default,{title:"Invetory Sheet",placeholder:"No positions added yet",class:"mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(n,d)=>(e.openBlock(),e.createBlock(p.default,{key:n._id,product:n,array:t.state.current.positions,products:c.value,onAdd:r[2]||(r[2]=a=>l.actions.add(t.state.current.positions,a)),onUpdate:a=>l.actions.update(t.state.current.positions,a,d),onDelete:a=>l.actions.delete(t.state.current.positions,a,d)},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1}),e.createVNode(u.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",N,[e.createElementVNode("h3",V," In total: "+e.toDisplayString(s.formatPrice(v.value)),1),e.createElementVNode("a",{onClick:r[3]||(r[3]=n=>k()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:r[4]||(r[4]=n=>y())}," Reset "),e.unref(o).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:r[5]||(r[5]=n=>_()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})],64))}};exports.default=q;
@@ -1,61 +1,61 @@
1
- import { ref as k, computed as S, onMounted as C, openBlock as c, createElementBlock as d, Fragment as b, createElementVNode as n, toDisplayString as h, unref as _, createVNode as i, withCtx as f, renderList as D, createBlock as L, createCommentVNode as R } from "vue";
1
+ import { ref as y, computed as C, onMounted as D, 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 L, createBlock as R, createCommentVNode as A } from "vue";
2
2
  import v from "../../../../components/Block/Block.vue.js";
3
3
  import "../../../../components/Field/Field.vue.js";
4
- import A from "../../../../components/Select/Select.vue2.js";
4
+ import E from "../../../../components/Select/Select.vue2.js";
5
5
  import "../../../../components/SelectMulti/SelectMulti.vue2.js";
6
- import g from "../blocks/CardPosition.vue.js";
7
- import { useRoute as E, useRouter as N } from "vue-router";
8
- import { actions as u } from "../../../globals/store/globals.js";
6
+ import k from "../blocks/CardPosition.vue.js";
7
+ import { useRoute as N, useRouter as P } from "vue-router";
8
+ import { actions as p } from "../../../globals/store/globals.js";
9
9
  import { state as t, actions as l } from "../../store/leftovers.js";
10
- import { state as P, actions as I } from "../../store/products.js";
10
+ import { state as B, actions as I } from "../../store/products.js";
11
11
  import "./EditLeftover.vue2.js";
12
- const U = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, V = { class: "" }, j = { class: "gap-thin flex-v-center flex-nojustify flex" }, q = { class: "mn-r-auto" }, Y = {
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
13
  __name: "EditLeftover",
14
- setup(z) {
15
- const o = E(), p = N(), m = k(P.all);
16
- k(null);
17
- const w = S(() => t.current.positions.reduce((r, e) => r + e.price * (e.quantity || 1), 0));
18
- C(async () => {
19
- if (o.params.leftover)
14
+ setup(F) {
15
+ const r = N(), u = P(), m = y(B.all);
16
+ y(null);
17
+ const w = C(() => t.current.positions.reduce((o, e) => o + e.price, 0));
18
+ D(async () => {
19
+ if (r.params.leftover)
20
20
  try {
21
- await l.fetch(o.params.leftover);
21
+ await l.fetch(r.params.leftover);
22
22
  } catch {
23
23
  console.error("error");
24
24
  }
25
25
  else
26
26
  t.current = { type: "", order: "", positions: [] };
27
27
  try {
28
- const r = await I.read({
29
- organization: o.params._id,
28
+ const o = await I.read({
29
+ organization: r.params._id,
30
30
  limit: 100
31
31
  });
32
- m.value = r;
32
+ m.value = o;
33
33
  } catch {
34
34
  console.error("error");
35
35
  }
36
36
  });
37
37
  function x() {
38
- o.params.leftover ? l.fetch(o.params.leftover) : t.current = { type: "", order: "", positions: [] };
38
+ r.params.leftover ? l.fetch(r.params.leftover) : t.current = { type: "", order: "", positions: [] };
39
39
  }
40
40
  function $() {
41
- o.params.leftover ? l.update(t.current).then(
42
- () => p.push({ name: "Backoffice Leftovers" }),
43
- (r) => console.error("error")
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 } }),
43
+ (o) => console.error("error")
44
44
  ) : l.create(t.current).then(
45
- () => p.push({ name: "Backoffice Leftovers" }),
46
- (r) => console.error("error")
45
+ () => u.push({ name: "Leftovers", params: { _id: r.params._id } }),
46
+ (o) => console.error("error")
47
47
  );
48
48
  }
49
- function B() {
50
- l.delete(o.params.leftover).then(
51
- () => p.push({ name: "Backoffice Leftovers" }),
52
- (r) => console.error("error")
49
+ function S() {
50
+ l.delete(r.params.leftover).then(
51
+ () => u.push({ name: "Leftovers", params: { _id: r.params._id } }),
52
+ (o) => console.error("error")
53
53
  );
54
54
  }
55
- return (r, e) => (c(), d(b, null, [
55
+ return (o, e) => (c(), d(b, null, [
56
56
  n("header", U, [
57
- n("h2", V, h(_(o).params.leftover ? "Edit " : "Add ") + " Inventory", 1),
58
- i(A, {
57
+ n("h2", V, h(g(r).params.leftover ? "Edit " : "Add ") + " Inventory", 1),
58
+ i(E, {
59
59
  select: t.current.type,
60
60
  "onUpdate:select": e[0] || (e[0] = (s) => t.current.type = s),
61
61
  options: [
@@ -72,8 +72,8 @@ const U = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, V =
72
72
  class: "mn-b-semi"
73
73
  }, {
74
74
  default: f(() => [
75
- i(g, {
76
- onAdd: e[1] || (e[1] = (s) => u.add(
75
+ i(k, {
76
+ onAdd: e[1] || (e[1] = (s) => p.add(
77
77
  t.current.positions,
78
78
  s
79
79
  )),
@@ -88,24 +88,24 @@ const U = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, V =
88
88
  class: "mn-b-semi"
89
89
  }, {
90
90
  default: f(() => [
91
- (c(!0), d(b, null, D(t.current.positions, (s, y) => (c(), L(g, {
91
+ (c(!0), d(b, null, L(t.current.positions, (s, _) => (c(), R(k, {
92
92
  key: s._id,
93
93
  product: s,
94
94
  array: t.current.positions,
95
95
  products: m.value,
96
- onAdd: e[2] || (e[2] = (a) => u.add(
96
+ onAdd: e[2] || (e[2] = (a) => p.add(
97
97
  t.current.positions,
98
98
  a
99
99
  )),
100
- onUpdate: (a) => u.update(
100
+ onUpdate: (a) => p.update(
101
101
  t.current.positions,
102
102
  a,
103
- y
103
+ _
104
104
  ),
105
- onDelete: (a) => u.delete(
105
+ onDelete: (a) => p.delete(
106
106
  t.current.positions,
107
107
  a,
108
- y
108
+ _
109
109
  )
110
110
  }, null, 8, ["product", "array", "products", "onUpdate", "onDelete"]))), 128))
111
111
  ]),
@@ -113,8 +113,8 @@ const U = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, V =
113
113
  }),
114
114
  i(v, { class: "" }, {
115
115
  default: f(() => [
116
- n("section", j, [
117
- n("h3", q, " In total: " + h(r.formatPrice(w.value)), 1),
116
+ n("section", z, [
117
+ n("h3", j, " In total: " + h(o.formatPrice(w.value)), 1),
118
118
  n("a", {
119
119
  onClick: e[3] || (e[3] = (s) => $()),
120
120
  class: "bg-main button"
@@ -123,11 +123,11 @@ const U = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, V =
123
123
  class: "t-white bg-second button",
124
124
  onClick: e[4] || (e[4] = (s) => x())
125
125
  }, " Reset "),
126
- _(o).params.leftover ? (c(), d("a", {
126
+ g(r).params.leftover ? (c(), d("a", {
127
127
  key: 0,
128
- onClick: e[5] || (e[5] = (s) => B()),
128
+ onClick: e[5] || (e[5] = (s) => S()),
129
129
  class: "t-white bg-red button"
130
- }, " Delete ")) : R("", !0)
130
+ }, " Delete ")) : A("", !0)
131
131
  ])
132
132
  ]),
133
133
  _: 1
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const o=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const s=require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.vue.cjs");const V=require("../../../../components/Checkbox/Checkbox.vue.cjs"),k=require("../../../../components/Button/Button.vue2.cjs"),B=require("../../../../components/Popup/Popup.vue2.cjs"),C=require("../../../../components/EditImages/EditImages.vue.cjs"),m=require("../../../icons/navigation/IconDelete.vue.cjs"),_=require("../blocks/CardPosition.vue.cjs"),q=require("../sections/EditProductInfo.vue.cjs"),u=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),b=require("../../store/categories.cjs");require("./ProductEdit.vue2.cjs");const y={class:"for-transition w-100 cols-1 pd-thin gap-thin"},E={class:"mn-r-auto"},P={class:"cols-2 gap-thin"},U={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},D={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},z={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},I={class:"cols-1 gap-thin"},F={__name:"ProductEdit",setup(L){const n=h.useRoute(),w=h.useRouter(),p=e.ref(t.state.all),f=e.ref(!1);function N(c){f.value=!0}function d(){f.value=!1}e.onMounted(async()=>{await b.actions.fetchCategories();try{const c=await t.actions.read({organization:n.params._id,limit:100});p.value=c}catch{console.error("error")}n.params.product&&await t.actions.read({_id:n.params.product}),t.state.current.ingredients||(t.state.current.ingredients=[])});function v(){n.params.product?t.actions.update(n.params.product,t.state.current):t.actions.create(n.params._id,t.state.current)}function x(){t.actions.deleteProduct(t.state.current._id)}function g(){w.push({name:"Organization",params:{_id:n.params._id}})}return(c,i)=>(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(o.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",E,e.toDisplayString(e.unref(n).params.product?t.state.current.name:"Create Product"),1),e.unref(n).params.product?(e.openBlock(),e.createBlock(k.default,{key:0,submit:x,callback:g,class:"bg-red mn-r-thin"},{default:e.withCtx(()=>[e.createTextVNode(" Delete ")]),_:1})):e.createCommentVNode("",!0),e.createVNode(k.default,{submit:v,callback:g,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1})]),_:1}),e.createVNode(o.default,{placeholder:"The product doesn't have any images yet.",class:"h-min"},{default:e.withCtx(()=>[e.createVNode(C.default,{images:t.state.current.images,uploadPath:"photos","onUpdate:images":i[0]||(i[0]=a=>{t.state.current.images=a})},null,8,["images"])]),_:1}),e.createElementVNode("div",P,[e.createVNode(o.default,{title:"Profile"},{default:e.withCtx(()=>[e.createVNode(q.default,{product:t.state.current},null,8,["product"])]),_:1}),e.createVNode(o.default,{title:"Categories"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.state.all,(a,r)=>(e.openBlock(),e.createBlock(V.default,{label:a.name,name:"categories",value:a.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:t.state.current.category,"onUpdate:radio":l=>t.state.current.category=l},null,8,["label","value","radio","onUpdate:radio"]))),256))]),_:1}),e.createVNode(o.default,{title:"Parameters",placeholder:"No parameters added yet",actions:[{label:"+",function:()=>t.state.current.information.push({name:"",value:""})}],class:"cols-1 gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.information,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",U,[e.createVNode(m.default,{onClick:()=>t.state.current.information.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(o.default,{title:"Localization",placeholder:"No localizations added yet",actions:[{label:"+",function:()=>t.state.current.localization.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.localization,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",D,[e.createVNode(m.default,{onClick:()=>t.state.current.localization.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"])]),e.createVNode(o.default,{title:"Quantity Discount",class:"mn-b-semi",actions:[{label:"+",function:()=>t.state.current.quantityDiscount.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.quantityDiscount,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Quantity",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Discount",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",z,[e.createVNode(m.default,{onClick:()=>t.state.current.quantityDiscount.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(B.default,{title:"Add ingredient",onClosePopup:d,isPopupOpen:f.value,class:"bg-white pd-big radius-big"},{default:e.withCtx(()=>[e.createVNode(_.default,{onAdd:i[1]||(i[1]=a=>u.actions.add(t.state.current.ingredients,a)),products:p.value,class:"flex-column"},null,8,["products"])]),_:1},8,["isPopupOpen"]),e.createVNode(o.default,{title:"Ingredients",placeholder:"No positions added yet",actions:[{label:"+",function:()=>N()}]},{default:e.withCtx(()=>[e.createElementVNode("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingredients,(a,r)=>(e.openBlock(),e.createBlock(_.default,{key:a._id,product:a,array:t.state.current.ingredients,products:p.value,onAdd:i[2]||(i[2]=l=>{u.actions.add(t.state.current.ingredients,l),d()}),onUpdate:l=>{u.actions.update(t.state.current.ingredients,l,r),d()},onDelete:l=>{u.actions.delete(t.state.current.ingredients,l,r),d()}},null,8,["product","array","products","onUpdate","onDelete"]))),128))])]),_:1},8,["actions"])]))}};exports.default=F;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const o=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const s=require("../../../../components/Field/Field.vue2.cjs"),V=require("../../../../components/Checkbox/Checkbox.vue.cjs"),_=require("../../../../components/Button/Button.vue2.cjs"),B=require("../../../../components/Popup/Popup.vue2.cjs"),C=require("../../../../components/EditImages/EditImages.vue.cjs"),m=require("../../../icons/navigation/IconDelete.vue.cjs"),b=require("../blocks/CardPosition.vue.cjs"),q=require("../sections/EditProductInfo.vue.cjs"),u=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),w=require("../../store/categories.cjs");require("./ProductEdit.vue2.cjs");const y={class:"for-transition w-100 cols-1 pd-thin gap-thin"},E={class:"mn-r-auto"},P={class:"cols-2 gap-thin"},U={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},D={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},z={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},I={class:"cols-1 gap-thin"},F={__name:"ProductEdit",setup(L){const n=k.useRoute(),g=k.useRouter(),p=e.ref(t.state.all),f=e.ref(!1);function N(c){f.value=!0}function d(){f.value=!1}e.onMounted(async()=>{await w.actions.fetchCategories();try{const c=await t.actions.read({organization:n.params._id,limit:100});p.value=c}catch{console.error("error")}n.params.product&&await t.actions.read({_id:n.params.product}),t.state.current.ingredients||(t.state.current.ingredients=[])});function v(){n.params.product?t.actions.update(n.params.product,t.state.current):t.actions.create(n.params._id,t.state.current)}function x(){t.actions.deleteProduct(t.state.current._id)}function h(){g.push({name:"Organization",params:{_id:n.params._id}})}return(c,i)=>(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(o.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",E,e.toDisplayString(e.unref(n).params.product?t.state.current.name:"Create Product"),1),e.unref(n).params.product?(e.openBlock(),e.createBlock(_.default,{key:0,submit:x,callback:h,class:"bg-red mn-r-thin"},{default:e.withCtx(()=>[e.createTextVNode(" Delete ")]),_:1})):e.createCommentVNode("",!0),e.createVNode(_.default,{submit:v,callback:h,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1})]),_:1}),e.createVNode(o.default,{placeholder:"The product doesn't have any images yet.",class:"h-min"},{default:e.withCtx(()=>[e.createVNode(C.default,{images:t.state.current.images,uploadPath:"photos","onUpdate:images":i[0]||(i[0]=a=>{t.state.current.images=a})},null,8,["images"])]),_:1}),e.createElementVNode("div",P,[e.createVNode(o.default,{title:"Profile"},{default:e.withCtx(()=>[e.createVNode(q.default,{product:t.state.current},null,8,["product"])]),_:1}),e.createVNode(o.default,{title:"Categories",actions:[{label:"+",function:()=>e.unref(g).push({name:"Categories Organization",params:{_id:e.unref(n).params._id}})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.state.all,(a,r)=>(e.openBlock(),e.createBlock(V.default,{label:a.name,name:"categories",value:a.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:t.state.current.category,"onUpdate:radio":l=>t.state.current.category=l},null,8,["label","value","radio","onUpdate:radio"]))),256))]),_:1},8,["actions"]),e.createVNode(o.default,{title:"Parameters",placeholder:"No parameters added yet",actions:[{label:"+",function:()=>t.state.current.information.push({name:"",value:""})}],class:"cols-1 gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.information,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",U,[e.createVNode(m.default,{onClick:()=>t.state.current.information.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(o.default,{title:"Localization",placeholder:"No localizations added yet",actions:[{label:"+",function:()=>t.state.current.localization.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.localization,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",D,[e.createVNode(m.default,{onClick:()=>t.state.current.localization.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"])]),e.createVNode(o.default,{title:"Quantity Discount",class:"mn-b-semi",actions:[{label:"+",function:()=>t.state.current.quantityDiscount.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.quantityDiscount,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Quantity",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Discount",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",z,[e.createVNode(m.default,{onClick:()=>t.state.current.quantityDiscount.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(B.default,{title:"Add ingredient",onClosePopup:d,isPopupOpen:f.value,class:"bg-white pd-big radius-big"},{default:e.withCtx(()=>[e.createVNode(b.default,{onAdd:i[1]||(i[1]=a=>u.actions.add(t.state.current.ingredients,a)),products:p.value,class:"flex-column"},null,8,["products"])]),_:1},8,["isPopupOpen"]),e.createVNode(o.default,{title:"Ingredients",placeholder:"No positions added yet",actions:[{label:"+",function:()=>N()}]},{default:e.withCtx(()=>[e.createElementVNode("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingredients,(a,r)=>(e.openBlock(),e.createBlock(b.default,{key:a._id,product:a,array:t.state.current.ingredients,products:p.value,onAdd:i[2]||(i[2]=l=>{u.actions.add(t.state.current.ingredients,l),d()}),onUpdate:l=>{u.actions.update(t.state.current.ingredients,l,r),d()},onDelete:l=>{u.actions.delete(t.state.current.ingredients,l,r),d()}},null,8,["product","array","products","onUpdate","onDelete"]))),128))])]),_:1},8,["actions"])]))}};exports.default=F;