@ozdao/prometheus-framework 0.2.312 → 0.2.313

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. package/dist/main.css +1 -1
  2. package/dist/prometheus-framework/src/components/BottomSheet/BottomSheet.vue.cjs +4 -3
  3. package/dist/prometheus-framework/src/components/BottomSheet/BottomSheet.vue.cjs.map +1 -1
  4. package/dist/prometheus-framework/src/components/BottomSheet/BottomSheet.vue.js +5 -4
  5. package/dist/prometheus-framework/src/components/BottomSheet/BottomSheet.vue.js.map +1 -1
  6. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +3 -2
  7. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs.map +1 -1
  8. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +3 -2
  9. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js.map +1 -1
  10. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +21 -14
  11. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs.map +1 -1
  12. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +21 -14
  13. package/dist/prometheus-framework/src/components/Field/Field.vue2.js.map +1 -1
  14. package/dist/prometheus-framework/src/modules/auth/views/router/users.cjs +1 -1
  15. package/dist/prometheus-framework/src/modules/auth/views/router/users.cjs.map +1 -1
  16. package/dist/prometheus-framework/src/modules/auth/views/router/users.js +1 -1
  17. package/dist/prometheus-framework/src/modules/auth/views/router/users.js.map +1 -1
  18. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  19. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  20. package/dist/prometheus-framework/src/modules/backoffice/components/partials/Sidebar.vue.cjs +1 -1
  21. package/dist/prometheus-framework/src/modules/backoffice/components/partials/Sidebar.vue.js +1 -1
  22. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs.map +1 -1
  24. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js.map +1 -1
  26. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  28. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  30. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.cjs +6 -1
  31. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.cjs.map +1 -1
  32. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.js +6 -1
  33. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.js.map +1 -1
  34. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.cjs +6 -18
  35. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.cjs.map +1 -1
  36. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.js +10 -22
  37. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.js.map +1 -1
  38. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  40. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +34 -14
  41. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs.map +1 -1
  42. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +34 -14
  43. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js.map +1 -1
  44. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  46. package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +323 -312
  47. package/dist/prometheus-framework/src/modules/pages/pages.client.js +323 -312
  48. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.cjs +36 -23
  49. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.cjs.map +1 -1
  50. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.js +37 -24
  51. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.js.map +1 -1
  52. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  54. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +10 -17
  55. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs.map +1 -1
  56. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +11 -18
  57. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js.map +1 -1
  58. package/dist/prometheus-framework/src/modules/products/components/elements/Price.vue.cjs +12 -2
  59. package/dist/prometheus-framework/src/modules/products/components/elements/Price.vue.cjs.map +1 -1
  60. package/dist/prometheus-framework/src/modules/products/components/elements/Price.vue.js +13 -3
  61. package/dist/prometheus-framework/src/modules/products/components/elements/Price.vue.js.map +1 -1
  62. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.cjs +3 -1
  63. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.cjs.map +1 -1
  64. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.js +3 -1
  65. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.js.map +1 -1
  66. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  68. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +6 -73
  69. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs.map +1 -1
  70. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +6 -73
  71. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
  72. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +7 -7
  75. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
  76. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +8 -8
  77. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js.map +1 -1
  78. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +19 -24
  79. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs.map +1 -1
  80. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +19 -24
  81. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js.map +1 -1
  82. package/dist/prometheus-framework/src/modules/products/components/sections/CategoriesTree.vue.cjs +8 -8
  83. package/dist/prometheus-framework/src/modules/products/components/sections/CategoriesTree.vue.cjs.map +1 -1
  84. package/dist/prometheus-framework/src/modules/products/components/sections/CategoriesTree.vue.js +9 -9
  85. package/dist/prometheus-framework/src/modules/products/components/sections/CategoriesTree.vue.js.map +1 -1
  86. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.cjs.map +1 -1
  88. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.js +1 -1
  89. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.js.map +1 -1
  90. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +60 -28
  91. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs.map +1 -1
  92. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +63 -31
  93. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js.map +1 -1
  94. package/dist/prometheus-framework/src/modules/products/store/marketplace.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/products/store/marketplace.cjs.map +1 -1
  96. package/dist/prometheus-framework/src/modules/products/store/marketplace.js +1 -1
  97. package/dist/prometheus-framework/src/modules/products/store/marketplace.js.map +1 -1
  98. package/dist/prometheus-framework.cjs.js +15 -15
  99. package/dist/prometheus-framework.es.js +640 -629
  100. package/package.json +1 -1
  101. package/src/components/BottomSheet/BottomSheet.vue +4 -2
  102. package/src/components/Feed/Feed.vue +1 -0
  103. package/src/components/Field/Field.vue +11 -4
  104. package/src/modules/auth/views/router/users.js +1 -1
  105. package/src/modules/community/components/pages/CreateBlogPost.vue +1 -1
  106. package/src/modules/globals/views/components/blocks/BlockSearch.vue +5 -0
  107. package/src/modules/globals/views/components/layouts/Client.vue +2 -2
  108. package/src/modules/organizations/components/pages/OrganizationBackoffice.vue +15 -0
  109. package/src/modules/products/components/blocks/CardCategory.vue +56 -25
  110. package/src/modules/products/components/blocks/CardProduct.vue +17 -11
  111. package/src/modules/products/components/elements/Price.vue +8 -0
  112. package/src/modules/products/components/pages/Catalog.vue +3 -1
  113. package/src/modules/products/components/pages/CategoryEdit.vue +2 -32
  114. package/src/modules/products/components/pages/Product.vue +5 -21
  115. package/src/modules/products/components/pages/Products.vue +5 -8
  116. package/src/modules/products/components/sections/CategoriesTree.vue +3 -5
  117. package/src/modules/products/components/sections/PopularProducts.vue +1 -1
  118. package/src/modules/products/components/sections/SectionProduct.vue +48 -26
  119. package/src/modules/products/store/marketplace.js +1 -1
@@ -6,7 +6,11 @@ const IconDelete = require("../../../icons/navigation/IconDelete.vue.cjs");
6
6
  const Button = require("../../../../components/Button/Button.vue2.cjs");
7
7
  const Select = require("../../../../components/Select/Select.vue.cjs");
8
8
  const Field = require("../../../../components/Field/Field.vue2.cjs");
9
- const Feed = require("../../../../components/Feed/Feed.vue.cjs");
9
+ ;/* empty css */
10
+ ;/* empty css */
11
+ ;/* empty css */
12
+ ;/* empty css */
13
+ ;/* empty css */
10
14
  const Block = require("../../../../components/Block/Block.vue.cjs");
11
15
  const IconCheckmark = require("../../../icons/navigation/IconCheckmark.vue.cjs");
12
16
  const globals = require("../../../globals/views/store/globals.cjs");
@@ -19,8 +23,6 @@ const _hoisted_3 = { class: "mn-b-medium w-100 flex-nowrap gap-thin flex" };
19
23
  const _hoisted_4 = { class: "flex-v-center flex-nowrap flex" };
20
24
  const _hoisted_5 = ["onClick"];
21
25
  const _hoisted_6 = ["onClick"];
22
- const _hoisted_7 = ["onClick"];
23
- const _hoisted_8 = ["onClick"];
24
26
  const _sfc_main = {
25
27
  __name: "CategoryEdit",
26
28
  setup(__props) {
@@ -155,75 +157,6 @@ const _sfc_main = {
155
157
  ]),
156
158
  _: 1
157
159
  }),
158
- vue.createVNode(Block.default, {
159
- title: "Subcategories",
160
- placeholder: "No subcategories added yet",
161
- actions: [{
162
- label: "+",
163
- function: () => categories.state.current.children.push({ name: "", url: "" })
164
- }],
165
- class: "mn-b-thin"
166
- }, {
167
- default: vue.withCtx(() => [
168
- vue.createTextVNode(vue.toDisplayString(categories.state.current.children) + " ", 1),
169
- vue.createVNode(Feed.default, {
170
- states: {
171
- empty: {
172
- title: "No Events Found",
173
- description: "Currently, there are no events available."
174
- }
175
- },
176
- store: {
177
- read: (options) => categories.actions.read(options),
178
- state: categories.state
179
- },
180
- options: {
181
- user: auth.state.user._id,
182
- limit: 10
183
- }
184
- }, {
185
- default: vue.withCtx(({
186
- items
187
- }) => [
188
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items, (category, index) => {
189
- return vue.openBlock(), vue.createElementBlock("div", {
190
- onClick: () => {
191
- categories.state.current.children.push(category._id);
192
- },
193
- class: "bg-white pd-medium radius-small mn-b-medium"
194
- }, vue.toDisplayString(category.name), 9, _hoisted_6);
195
- }), 256))
196
- ]),
197
- _: 1
198
- }, 8, ["store", "options"]),
199
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(categories.state.current.children, (item, index) => {
200
- return vue.openBlock(), vue.createElementBlock("div", {
201
- class: "gap-thin mn-b-thin flex-nowrap flex",
202
- key: index
203
- }, [
204
- vue.createVNode(Field.default, {
205
- field: item.name,
206
- "onUpdate:field": ($event) => item.name = $event,
207
- placeholder: "Subcategory name",
208
- class: "w-100 bg-white radius-small pd-medium"
209
- }, null, 8, ["field", "onUpdate:field"]),
210
- vue.createVNode(Field.default, {
211
- field: item.url,
212
- "onUpdate:field": ($event) => item.url = $event,
213
- placeholder: "Subcategory",
214
- class: "w-100 bg-white radius-small pd-medium"
215
- }, null, 8, ["field", "onUpdate:field"]),
216
- vue.createElementVNode("div", {
217
- onClick: () => categories.state.current.children.splice(index, 1),
218
- class: "radius-small pd-small flex-center flex aspect-1x1 bg-red"
219
- }, [
220
- vue.createVNode(IconDelete.default, { class: "i-medium" })
221
- ], 8, _hoisted_7)
222
- ]);
223
- }), 128))
224
- ]),
225
- _: 1
226
- }, 8, ["actions"]),
227
160
  vue.createVNode(Block.default, {
228
161
  title: "Filters",
229
162
  placeholder: "No filters added yet",
@@ -255,7 +188,7 @@ const _sfc_main = {
255
188
  class: "radius-small pd-small flex-center flex aspect-1x1 bg-red"
256
189
  }, [
257
190
  vue.createVNode(IconDelete.default, { class: "i-medium" })
258
- ], 8, _hoisted_8)
191
+ ], 8, _hoisted_6)
259
192
  ]);
260
193
  }), 128))
261
194
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"CategoryEdit.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/CategoryEdit.vue"],"sourcesContent":["<template>\n <div class=\"pd-thin bg-white for-transition w-100\">\n <Block v-if=\"!MOBILE_APP\" class=\"radius-big mn-b-thin flex-nowrap flex-v-center flex\">\n <h1 class=\"mn-r-auto\">\n {{route.params.category ? 'Edit Category' : 'Add Category'}}\n </h1>\n\n <Button \n :submit=\"onSubmit\"\n :callback=\"redirectTo\"\n class=\"pd-small radius-big bg-main t-black uppercase t-medium\"\n >\n Save Category \n </Button>\n </Block>\n \n <Block \n title=\"Profile\"\n class=\"mn-b-thin\"\n >\n <div class=\"mn-b-medium w-100 flex-nowrap gap-thin flex\">\n <Field\n v-model:field=\"categories.state.current.order\"\n label=\"Order\"\n :disabled=\"true\"\n class=\"w-40 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"categories.state.current.url\"\n label=\"URL\"\n placeholder=\"Enter category URL\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n \n </div>\n <Field\n v-model:field=\"categories.state.current.name\"\n label=\"Name\"\n placeholder=\"Enter category name\"\n class=\"w-100 mn-b-small bg-white radius-small pd-medium\"\n /> \n\n <Select \n v-model:select=\"categories.state.current.status\"\n label=\"Status\"\n :options=\"[\n 'draft', \n 'internal',\n 'published',\n 'removed'\n ]\"\n placeholder=\"Display product\"\n class=\"pos-relative w-100 mn-b-small bg-white radius-small pd-medium\"\n />\n\n <div class=\"flex-v-center flex-nowrap flex\">\n <h4 class=\"mn-r-thin t-medium\">Localization</h4>\n \n <button \n @click=\"() => categories.state.current.localization.push({locale: '', text: ''})\" \n class=\"i-small pd-thin button-delete button\"\n >\n +\n </button>\n </div>\n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.localization\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.locale\"\n placeholder=\"Locale\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.text\"\n placeholder=\"Text\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.localization.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div>\n\n \n </Block>\n <!-- Subcategories -->\n <Block\n title=\"Subcategories\"\n placeholder=\"No subcategories added yet\"\n :actions=\"[{\n label: '+',\n function: () => categories.state.current.children.push({name: '', url: ''})\n }]\"\n class=\"mn-b-thin\"\n >\n\n {{categories.state.current.children}}\n <Feed\n :states=\"{\n empty: {\n title: 'No Events Found',\n description: 'Currently, there are no events available.'\n }\n }\"\n :store=\"{\n read: (options) => categories.actions.read(options),\n state: categories.state\n }\"\n :options=\"{\n user: auth.state.user._id,\n limit: 10\n }\"\n v-slot=\"{ \n items \n }\"\n >\n <div \n v-for=\"(category,index) in items\"\n @click=\"() => { categories.state.current.children.push(category._id) }\"\n class=\"bg-white pd-medium radius-small mn-b-medium\"\n >\n {{category.name}}\n </div>\n \n </Feed>\n \n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.children\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Subcategory name\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.url\"\n placeholder=\"Subcategory\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.children.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div> \n </Block>\n <!-- Filters -->\n <Block\n title=\"Filters\"\n placeholder=\"No filters added yet\"\n :actions=\"[{\n label: '+',\n function: () => categories.state.current.filters.push({name: '', url: ''})\n }]\"\n >\n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.filters\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Filter name\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.options\"\n placeholder=\"Filter options divided by ,\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.filters.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div> \n </Block>\n </div>\n \n</template>\n\n<script setup>\n // Import libs\n import { computed, onUnmounted } from 'vue'\n import { useRoute,useRouter } from 'vue-router'\n \n import IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';\n\n import Button from \"@pf/src/components/Button/Button.vue\";\n import Select from \"@pf/src/components/Select/Select.vue\";\n import Field from \"@pf/src/components/Field/Field.vue\";\n import Feed from '@pf/src/components/Feed/Feed.vue'\n\n import Block from '@pf/src/components/Block/Block.vue';\n\n import IconCheckmark from '@pf/src/modules/icons/navigation/IconCheckmark.vue'\n\n // Import the new store structure\n import * as globals from '@pf/src/modules/globals/views/store/globals';\n import * as auth from '@pf/src/modules/auth/views/store/auth'; \n import * as categories from '@pf/src/modules/products/store/categories';\n\n const route = useRoute()\n const router = useRouter()\n\n // Data prefetching\n if (route.params.category) {\n categories.actions.read({url: route.params.category})\n } else {\n categories.actions.clean() // Adjusted based on the new store's method to reset the category state\n }\n\n // Accessing state\n const category = computed(() => categories.state.current)\n const routePath = computed(() => route.name)\n\n // Navigation Bar\n globals.state.navigation_bar.actions = [{\n component: IconCheckmark,\n props: {\n fill: \"rgb(var(--main))\" \n },\n condition: () => auth.state.user && auth.state.user._id,\n action: () => onSubmit()\n }],\n\n onUnmounted(() => {\n globals.state.navigation_bar.actions = [];\n });\n\n\n\n // Functions\n function onSubmit() {\n if (route.params.category) {\n categories.actions.update(categories.state.current)\n } else {\n categories.actions.create(categories.state.current)\n }\n }\n\n function redirectTo () {\n router.push({\n name: 'Categories Organization', \n params: { \n _id: route.params._id\n } \n })\n }\n</script>\n\n<style lang=\"scss\">\n /* Your styles here */\n</style>\n"],"names":["useRoute","useRouter","categories.actions","computed","categories.state","globals.state","IconCheckmark","auth.state","onUnmounted"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyNE,UAAM,QAAQA,UAAAA,SAAU;AACxB,UAAM,SAASC,UAAAA,UAAW;AAG1B,QAAI,MAAM,OAAO,UAAU;AACzBC,iBAAkB,QAAC,KAAK,EAAC,KAAK,MAAM,OAAO,SAAQ,CAAC;AAAA,IACxD,OAAS;AACLA,iBAAAA,QAAmB,MAAO;AAAA,IAC3B;AAGgBC,iBAAS,MAAMC,WAAgB,MAAC,OAAO;AACtCD,iBAAS,MAAM,MAAM,IAAI;AAG3CE,kBAAc,eAAe,UAAU,CAAC;AAAA,MACtC,WAAWC,cAAa;AAAA,MACxB,OAAO;AAAA,QACL,MAAM;AAAA,MACP;AAAA,MACD,WAAW,MAAMC,KAAU,MAAC,QAAQA,KAAU,MAAC,KAAK;AAAA,MACpD,QAAQ,MAAM,SAAU;AAAA,IAC5B,CAAG,GAEFC,IAAAA,YAAY,MAAM;AACfH,oBAAc,eAAe,UAAU;IAC3C,CAAG;AAKD,aAAS,WAAW;AAClB,UAAI,MAAM,OAAO,UAAU;AACzBH,2BAAmB,OAAOE,WAAgB,MAAC,OAAO;AAAA,MACxD,OAAW;AACLF,2BAAmB,OAAOE,WAAgB,MAAC,OAAO;AAAA,MACnD;AAAA,IACF;AAED,aAAS,aAAc;AACrB,aAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,QAAQ;AAAA,UACN,KAAK,MAAM,OAAO;AAAA,QACnB;AAAA,MACP,CAAK;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CategoryEdit.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/CategoryEdit.vue"],"sourcesContent":["<template>\n <div class=\"pd-thin bg-white for-transition w-100\">\n <Block v-if=\"!MOBILE_APP\" class=\"radius-big mn-b-thin flex-nowrap flex-v-center flex\">\n <h1 class=\"mn-r-auto\">\n {{route.params.category ? 'Edit Category' : 'Add Category'}}\n </h1>\n\n <Button \n :submit=\"onSubmit\"\n :callback=\"redirectTo\"\n class=\"pd-small radius-big bg-main t-black uppercase t-medium\"\n >\n Save Category \n </Button>\n </Block>\n \n <Block \n title=\"Profile\"\n class=\"mn-b-thin\"\n >\n <div class=\"mn-b-medium w-100 flex-nowrap gap-thin flex\">\n <Field\n v-model:field=\"categories.state.current.order\"\n label=\"Order\"\n :disabled=\"true\"\n class=\"w-40 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"categories.state.current.url\"\n label=\"URL\"\n placeholder=\"Enter category URL\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n \n </div>\n <Field\n v-model:field=\"categories.state.current.name\"\n label=\"Name\"\n placeholder=\"Enter category name\"\n class=\"w-100 mn-b-small bg-white radius-small pd-medium\"\n /> \n\n <Select \n v-model:select=\"categories.state.current.status\"\n label=\"Status\"\n :options=\"[\n 'draft', \n 'internal',\n 'published',\n 'removed'\n ]\"\n placeholder=\"Display product\"\n class=\"pos-relative w-100 mn-b-small bg-white radius-small pd-medium\"\n />\n\n <div class=\"flex-v-center flex-nowrap flex\">\n <h4 class=\"mn-r-thin t-medium\">Localization</h4>\n \n <button \n @click=\"() => categories.state.current.localization.push({locale: '', text: ''})\" \n class=\"i-small pd-thin button-delete button\"\n >\n +\n </button>\n </div>\n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.localization\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.locale\"\n placeholder=\"Locale\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.text\"\n placeholder=\"Text\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.localization.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div>\n\n \n </Block>\n <!-- Subcategories -->\n <!-- <Block\n title=\"Subcategories\"\n placeholder=\"No subcategories added yet\"\n :actions=\"[{\n label: '+',\n function: () => categories.state.current.children.push({name: '', url: ''})\n }]\"\n class=\"mn-b-thin\"\n >\n \n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.children\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Subcategory name\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.url\"\n placeholder=\"Subcategory\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.children.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div> \n </Block> -->\n <!-- Filters -->\n <Block\n title=\"Filters\"\n placeholder=\"No filters added yet\"\n :actions=\"[{\n label: '+',\n function: () => categories.state.current.filters.push({name: '', url: ''})\n }]\"\n >\n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.filters\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Filter name\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.options\"\n placeholder=\"Filter options divided by ,\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.filters.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div> \n </Block>\n </div>\n \n</template>\n\n<script setup>\n // Import libs\n import { computed, onUnmounted } from 'vue'\n import { useRoute,useRouter } from 'vue-router'\n \n import IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';\n\n import Button from \"@pf/src/components/Button/Button.vue\";\n import Select from \"@pf/src/components/Select/Select.vue\";\n import Field from \"@pf/src/components/Field/Field.vue\";\n import Feed from '@pf/src/components/Feed/Feed.vue'\n\n import Block from '@pf/src/components/Block/Block.vue';\n\n import IconCheckmark from '@pf/src/modules/icons/navigation/IconCheckmark.vue'\n\n // Import the new store structure\n import * as globals from '@pf/src/modules/globals/views/store/globals';\n import * as auth from '@pf/src/modules/auth/views/store/auth'; \n import * as categories from '@pf/src/modules/products/store/categories';\n\n const route = useRoute()\n const router = useRouter()\n\n // Data prefetching\n if (route.params.category) {\n categories.actions.read({url: route.params.category})\n } else {\n categories.actions.clean() // Adjusted based on the new store's method to reset the category state\n }\n\n // Accessing state\n const category = computed(() => categories.state.current)\n const routePath = computed(() => route.name)\n\n // Navigation Bar\n globals.state.navigation_bar.actions = [{\n component: IconCheckmark,\n props: {\n fill: \"rgb(var(--main))\" \n },\n condition: () => auth.state.user && auth.state.user._id,\n action: () => onSubmit()\n }],\n\n onUnmounted(() => {\n globals.state.navigation_bar.actions = [];\n });\n\n\n\n // Functions\n function onSubmit() {\n if (route.params.category) {\n categories.actions.update(categories.state.current)\n } else {\n categories.actions.create(categories.state.current)\n }\n }\n\n function redirectTo () {\n router.push({\n name: 'Categories Organization', \n params: { \n _id: route.params._id\n } \n })\n }\n</script>\n\n<style lang=\"scss\">\n /* Your styles here */\n</style>\n"],"names":["useRoute","useRouter","categories.actions","computed","categories.state","globals.state","IconCheckmark","auth.state","onUnmounted"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2LE,UAAM,QAAQA,UAAAA,SAAU;AACxB,UAAM,SAASC,UAAAA,UAAW;AAG1B,QAAI,MAAM,OAAO,UAAU;AACzBC,iBAAkB,QAAC,KAAK,EAAC,KAAK,MAAM,OAAO,SAAQ,CAAC;AAAA,IACxD,OAAS;AACLA,iBAAAA,QAAmB,MAAO;AAAA,IAC3B;AAGgBC,iBAAS,MAAMC,WAAgB,MAAC,OAAO;AACtCD,iBAAS,MAAM,MAAM,IAAI;AAG3CE,kBAAc,eAAe,UAAU,CAAC;AAAA,MACtC,WAAWC,cAAa;AAAA,MACxB,OAAO;AAAA,QACL,MAAM;AAAA,MACP;AAAA,MACD,WAAW,MAAMC,KAAU,MAAC,QAAQA,KAAU,MAAC,KAAK;AAAA,MACpD,QAAQ,MAAM,SAAU;AAAA,IAC5B,CAAG,GAEFC,IAAAA,YAAY,MAAM;AACfH,oBAAc,eAAe,UAAU;IAC3C,CAAG;AAKD,aAAS,WAAW;AAClB,UAAI,MAAM,OAAO,UAAU;AACzBH,2BAAmB,OAAOE,WAAgB,MAAC,OAAO;AAAA,MACxD,OAAW;AACLF,2BAAmB,OAAOE,WAAgB,MAAC,OAAO;AAAA,MACnD;AAAA,IACF;AAED,aAAS,aAAc;AACrB,aAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,QAAQ;AAAA,UACN,KAAK,MAAM,OAAO;AAAA,QACnB;AAAA,MACP,CAAK;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,7 +4,11 @@ import _sfc_main$4 from "../../../icons/navigation/IconDelete.vue.js";
4
4
  import _sfc_main$3 from "../../../../components/Button/Button.vue2.js";
5
5
  import Select from "../../../../components/Select/Select.vue.js";
6
6
  import Field from "../../../../components/Field/Field.vue2.js";
7
- import _sfc_main$5 from "../../../../components/Feed/Feed.vue.js";
7
+ /* empty css */
8
+ /* empty css */
9
+ /* empty css */
10
+ /* empty css */
11
+ /* empty css */
8
12
  import _sfc_main$2 from "../../../../components/Block/Block.vue.js";
9
13
  import _sfc_main$1 from "../../../icons/navigation/IconCheckmark.vue.js";
10
14
  import { state as state$1 } from "../../../globals/views/store/globals.js";
@@ -17,8 +21,6 @@ const _hoisted_3 = { class: "mn-b-medium w-100 flex-nowrap gap-thin flex" };
17
21
  const _hoisted_4 = { class: "flex-v-center flex-nowrap flex" };
18
22
  const _hoisted_5 = ["onClick"];
19
23
  const _hoisted_6 = ["onClick"];
20
- const _hoisted_7 = ["onClick"];
21
- const _hoisted_8 = ["onClick"];
22
24
  const _sfc_main = {
23
25
  __name: "CategoryEdit",
24
26
  setup(__props) {
@@ -153,75 +155,6 @@ const _sfc_main = {
153
155
  ]),
154
156
  _: 1
155
157
  }),
156
- createVNode(_sfc_main$2, {
157
- title: "Subcategories",
158
- placeholder: "No subcategories added yet",
159
- actions: [{
160
- label: "+",
161
- function: () => state.current.children.push({ name: "", url: "" })
162
- }],
163
- class: "mn-b-thin"
164
- }, {
165
- default: withCtx(() => [
166
- createTextVNode(toDisplayString(state.current.children) + " ", 1),
167
- createVNode(_sfc_main$5, {
168
- states: {
169
- empty: {
170
- title: "No Events Found",
171
- description: "Currently, there are no events available."
172
- }
173
- },
174
- store: {
175
- read: (options) => actions.read(options),
176
- state
177
- },
178
- options: {
179
- user: state$2.user._id,
180
- limit: 10
181
- }
182
- }, {
183
- default: withCtx(({
184
- items
185
- }) => [
186
- (openBlock(true), createElementBlock(Fragment, null, renderList(items, (category, index) => {
187
- return openBlock(), createElementBlock("div", {
188
- onClick: () => {
189
- state.current.children.push(category._id);
190
- },
191
- class: "bg-white pd-medium radius-small mn-b-medium"
192
- }, toDisplayString(category.name), 9, _hoisted_6);
193
- }), 256))
194
- ]),
195
- _: 1
196
- }, 8, ["store", "options"]),
197
- (openBlock(true), createElementBlock(Fragment, null, renderList(state.current.children, (item, index) => {
198
- return openBlock(), createElementBlock("div", {
199
- class: "gap-thin mn-b-thin flex-nowrap flex",
200
- key: index
201
- }, [
202
- createVNode(Field, {
203
- field: item.name,
204
- "onUpdate:field": ($event) => item.name = $event,
205
- placeholder: "Subcategory name",
206
- class: "w-100 bg-white radius-small pd-medium"
207
- }, null, 8, ["field", "onUpdate:field"]),
208
- createVNode(Field, {
209
- field: item.url,
210
- "onUpdate:field": ($event) => item.url = $event,
211
- placeholder: "Subcategory",
212
- class: "w-100 bg-white radius-small pd-medium"
213
- }, null, 8, ["field", "onUpdate:field"]),
214
- createElementVNode("div", {
215
- onClick: () => state.current.children.splice(index, 1),
216
- class: "radius-small pd-small flex-center flex aspect-1x1 bg-red"
217
- }, [
218
- createVNode(_sfc_main$4, { class: "i-medium" })
219
- ], 8, _hoisted_7)
220
- ]);
221
- }), 128))
222
- ]),
223
- _: 1
224
- }, 8, ["actions"]),
225
158
  createVNode(_sfc_main$2, {
226
159
  title: "Filters",
227
160
  placeholder: "No filters added yet",
@@ -253,7 +186,7 @@ const _sfc_main = {
253
186
  class: "radius-small pd-small flex-center flex aspect-1x1 bg-red"
254
187
  }, [
255
188
  createVNode(_sfc_main$4, { class: "i-medium" })
256
- ], 8, _hoisted_8)
189
+ ], 8, _hoisted_6)
257
190
  ]);
258
191
  }), 128))
259
192
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"CategoryEdit.vue.js","sources":["../../../../../../../src/modules/products/components/pages/CategoryEdit.vue"],"sourcesContent":["<template>\n <div class=\"pd-thin bg-white for-transition w-100\">\n <Block v-if=\"!MOBILE_APP\" class=\"radius-big mn-b-thin flex-nowrap flex-v-center flex\">\n <h1 class=\"mn-r-auto\">\n {{route.params.category ? 'Edit Category' : 'Add Category'}}\n </h1>\n\n <Button \n :submit=\"onSubmit\"\n :callback=\"redirectTo\"\n class=\"pd-small radius-big bg-main t-black uppercase t-medium\"\n >\n Save Category \n </Button>\n </Block>\n \n <Block \n title=\"Profile\"\n class=\"mn-b-thin\"\n >\n <div class=\"mn-b-medium w-100 flex-nowrap gap-thin flex\">\n <Field\n v-model:field=\"categories.state.current.order\"\n label=\"Order\"\n :disabled=\"true\"\n class=\"w-40 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"categories.state.current.url\"\n label=\"URL\"\n placeholder=\"Enter category URL\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n \n </div>\n <Field\n v-model:field=\"categories.state.current.name\"\n label=\"Name\"\n placeholder=\"Enter category name\"\n class=\"w-100 mn-b-small bg-white radius-small pd-medium\"\n /> \n\n <Select \n v-model:select=\"categories.state.current.status\"\n label=\"Status\"\n :options=\"[\n 'draft', \n 'internal',\n 'published',\n 'removed'\n ]\"\n placeholder=\"Display product\"\n class=\"pos-relative w-100 mn-b-small bg-white radius-small pd-medium\"\n />\n\n <div class=\"flex-v-center flex-nowrap flex\">\n <h4 class=\"mn-r-thin t-medium\">Localization</h4>\n \n <button \n @click=\"() => categories.state.current.localization.push({locale: '', text: ''})\" \n class=\"i-small pd-thin button-delete button\"\n >\n +\n </button>\n </div>\n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.localization\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.locale\"\n placeholder=\"Locale\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.text\"\n placeholder=\"Text\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.localization.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div>\n\n \n </Block>\n <!-- Subcategories -->\n <Block\n title=\"Subcategories\"\n placeholder=\"No subcategories added yet\"\n :actions=\"[{\n label: '+',\n function: () => categories.state.current.children.push({name: '', url: ''})\n }]\"\n class=\"mn-b-thin\"\n >\n\n {{categories.state.current.children}}\n <Feed\n :states=\"{\n empty: {\n title: 'No Events Found',\n description: 'Currently, there are no events available.'\n }\n }\"\n :store=\"{\n read: (options) => categories.actions.read(options),\n state: categories.state\n }\"\n :options=\"{\n user: auth.state.user._id,\n limit: 10\n }\"\n v-slot=\"{ \n items \n }\"\n >\n <div \n v-for=\"(category,index) in items\"\n @click=\"() => { categories.state.current.children.push(category._id) }\"\n class=\"bg-white pd-medium radius-small mn-b-medium\"\n >\n {{category.name}}\n </div>\n \n </Feed>\n \n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.children\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Subcategory name\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.url\"\n placeholder=\"Subcategory\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.children.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div> \n </Block>\n <!-- Filters -->\n <Block\n title=\"Filters\"\n placeholder=\"No filters added yet\"\n :actions=\"[{\n label: '+',\n function: () => categories.state.current.filters.push({name: '', url: ''})\n }]\"\n >\n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.filters\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Filter name\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.options\"\n placeholder=\"Filter options divided by ,\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.filters.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div> \n </Block>\n </div>\n \n</template>\n\n<script setup>\n // Import libs\n import { computed, onUnmounted } from 'vue'\n import { useRoute,useRouter } from 'vue-router'\n \n import IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';\n\n import Button from \"@pf/src/components/Button/Button.vue\";\n import Select from \"@pf/src/components/Select/Select.vue\";\n import Field from \"@pf/src/components/Field/Field.vue\";\n import Feed from '@pf/src/components/Feed/Feed.vue'\n\n import Block from '@pf/src/components/Block/Block.vue';\n\n import IconCheckmark from '@pf/src/modules/icons/navigation/IconCheckmark.vue'\n\n // Import the new store structure\n import * as globals from '@pf/src/modules/globals/views/store/globals';\n import * as auth from '@pf/src/modules/auth/views/store/auth'; \n import * as categories from '@pf/src/modules/products/store/categories';\n\n const route = useRoute()\n const router = useRouter()\n\n // Data prefetching\n if (route.params.category) {\n categories.actions.read({url: route.params.category})\n } else {\n categories.actions.clean() // Adjusted based on the new store's method to reset the category state\n }\n\n // Accessing state\n const category = computed(() => categories.state.current)\n const routePath = computed(() => route.name)\n\n // Navigation Bar\n globals.state.navigation_bar.actions = [{\n component: IconCheckmark,\n props: {\n fill: \"rgb(var(--main))\" \n },\n condition: () => auth.state.user && auth.state.user._id,\n action: () => onSubmit()\n }],\n\n onUnmounted(() => {\n globals.state.navigation_bar.actions = [];\n });\n\n\n\n // Functions\n function onSubmit() {\n if (route.params.category) {\n categories.actions.update(categories.state.current)\n } else {\n categories.actions.create(categories.state.current)\n }\n }\n\n function redirectTo () {\n router.push({\n name: 'Categories Organization', \n params: { \n _id: route.params._id\n } \n })\n }\n</script>\n\n<style lang=\"scss\">\n /* Your styles here */\n</style>\n"],"names":["categories.actions","categories.state","globals.state","IconCheckmark","auth.state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyNE,UAAM,QAAQ,SAAU;AACxB,UAAM,SAAS,UAAW;AAG1B,QAAI,MAAM,OAAO,UAAU;AACzBA,cAAmB,KAAK,EAAC,KAAK,MAAM,OAAO,SAAQ,CAAC;AAAA,IACxD,OAAS;AACLA,cAAmB,MAAO;AAAA,IAC3B;AAGgB,aAAS,MAAMC,MAAiB,OAAO;AACtC,aAAS,MAAM,MAAM,IAAI;AAG3CC,YAAc,eAAe,UAAU,CAAC;AAAA,MACtC,WAAWC;AAAAA,MACX,OAAO;AAAA,QACL,MAAM;AAAA,MACP;AAAA,MACD,WAAW,MAAMC,QAAW,QAAQA,QAAW,KAAK;AAAA,MACpD,QAAQ,MAAM,SAAU;AAAA,IAC5B,CAAG,GAEF,YAAY,MAAM;AACfF,cAAc,eAAe,UAAU;IAC3C,CAAG;AAKD,aAAS,WAAW;AAClB,UAAI,MAAM,OAAO,UAAU;AACzBF,gBAAmB,OAAOC,MAAiB,OAAO;AAAA,MACxD,OAAW;AACLD,gBAAmB,OAAOC,MAAiB,OAAO;AAAA,MACnD;AAAA,IACF;AAED,aAAS,aAAc;AACrB,aAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,QAAQ;AAAA,UACN,KAAK,MAAM,OAAO;AAAA,QACnB;AAAA,MACP,CAAK;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CategoryEdit.vue.js","sources":["../../../../../../../src/modules/products/components/pages/CategoryEdit.vue"],"sourcesContent":["<template>\n <div class=\"pd-thin bg-white for-transition w-100\">\n <Block v-if=\"!MOBILE_APP\" class=\"radius-big mn-b-thin flex-nowrap flex-v-center flex\">\n <h1 class=\"mn-r-auto\">\n {{route.params.category ? 'Edit Category' : 'Add Category'}}\n </h1>\n\n <Button \n :submit=\"onSubmit\"\n :callback=\"redirectTo\"\n class=\"pd-small radius-big bg-main t-black uppercase t-medium\"\n >\n Save Category \n </Button>\n </Block>\n \n <Block \n title=\"Profile\"\n class=\"mn-b-thin\"\n >\n <div class=\"mn-b-medium w-100 flex-nowrap gap-thin flex\">\n <Field\n v-model:field=\"categories.state.current.order\"\n label=\"Order\"\n :disabled=\"true\"\n class=\"w-40 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"categories.state.current.url\"\n label=\"URL\"\n placeholder=\"Enter category URL\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n \n </div>\n <Field\n v-model:field=\"categories.state.current.name\"\n label=\"Name\"\n placeholder=\"Enter category name\"\n class=\"w-100 mn-b-small bg-white radius-small pd-medium\"\n /> \n\n <Select \n v-model:select=\"categories.state.current.status\"\n label=\"Status\"\n :options=\"[\n 'draft', \n 'internal',\n 'published',\n 'removed'\n ]\"\n placeholder=\"Display product\"\n class=\"pos-relative w-100 mn-b-small bg-white radius-small pd-medium\"\n />\n\n <div class=\"flex-v-center flex-nowrap flex\">\n <h4 class=\"mn-r-thin t-medium\">Localization</h4>\n \n <button \n @click=\"() => categories.state.current.localization.push({locale: '', text: ''})\" \n class=\"i-small pd-thin button-delete button\"\n >\n +\n </button>\n </div>\n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.localization\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.locale\"\n placeholder=\"Locale\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.text\"\n placeholder=\"Text\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.localization.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div>\n\n \n </Block>\n <!-- Subcategories -->\n <!-- <Block\n title=\"Subcategories\"\n placeholder=\"No subcategories added yet\"\n :actions=\"[{\n label: '+',\n function: () => categories.state.current.children.push({name: '', url: ''})\n }]\"\n class=\"mn-b-thin\"\n >\n \n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.children\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Subcategory name\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.url\"\n placeholder=\"Subcategory\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.children.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div> \n </Block> -->\n <!-- Filters -->\n <Block\n title=\"Filters\"\n placeholder=\"No filters added yet\"\n :actions=\"[{\n label: '+',\n function: () => categories.state.current.filters.push({name: '', url: ''})\n }]\"\n >\n <div \n class=\"gap-thin mn-b-thin flex-nowrap flex\" \n v-for=\"(item, index) in categories.state.current.filters\" \n :key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Filter name\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.options\"\n placeholder=\"Filter options divided by ,\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div\n @click=\"() => categories.state.current.filters.splice(index, 1)\" \n class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\"\n >\n <IconDelete \n class=\"i-medium\"\n />\n </div>\n </div> \n </Block>\n </div>\n \n</template>\n\n<script setup>\n // Import libs\n import { computed, onUnmounted } from 'vue'\n import { useRoute,useRouter } from 'vue-router'\n \n import IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';\n\n import Button from \"@pf/src/components/Button/Button.vue\";\n import Select from \"@pf/src/components/Select/Select.vue\";\n import Field from \"@pf/src/components/Field/Field.vue\";\n import Feed from '@pf/src/components/Feed/Feed.vue'\n\n import Block from '@pf/src/components/Block/Block.vue';\n\n import IconCheckmark from '@pf/src/modules/icons/navigation/IconCheckmark.vue'\n\n // Import the new store structure\n import * as globals from '@pf/src/modules/globals/views/store/globals';\n import * as auth from '@pf/src/modules/auth/views/store/auth'; \n import * as categories from '@pf/src/modules/products/store/categories';\n\n const route = useRoute()\n const router = useRouter()\n\n // Data prefetching\n if (route.params.category) {\n categories.actions.read({url: route.params.category})\n } else {\n categories.actions.clean() // Adjusted based on the new store's method to reset the category state\n }\n\n // Accessing state\n const category = computed(() => categories.state.current)\n const routePath = computed(() => route.name)\n\n // Navigation Bar\n globals.state.navigation_bar.actions = [{\n component: IconCheckmark,\n props: {\n fill: \"rgb(var(--main))\" \n },\n condition: () => auth.state.user && auth.state.user._id,\n action: () => onSubmit()\n }],\n\n onUnmounted(() => {\n globals.state.navigation_bar.actions = [];\n });\n\n\n\n // Functions\n function onSubmit() {\n if (route.params.category) {\n categories.actions.update(categories.state.current)\n } else {\n categories.actions.create(categories.state.current)\n }\n }\n\n function redirectTo () {\n router.push({\n name: 'Categories Organization', \n params: { \n _id: route.params._id\n } \n })\n }\n</script>\n\n<style lang=\"scss\">\n /* Your styles here */\n</style>\n"],"names":["categories.actions","categories.state","globals.state","IconCheckmark","auth.state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2LE,UAAM,QAAQ,SAAU;AACxB,UAAM,SAAS,UAAW;AAG1B,QAAI,MAAM,OAAO,UAAU;AACzBA,cAAmB,KAAK,EAAC,KAAK,MAAM,OAAO,SAAQ,CAAC;AAAA,IACxD,OAAS;AACLA,cAAmB,MAAO;AAAA,IAC3B;AAGgB,aAAS,MAAMC,MAAiB,OAAO;AACtC,aAAS,MAAM,MAAM,IAAI;AAG3CC,YAAc,eAAe,UAAU,CAAC;AAAA,MACtC,WAAWC;AAAAA,MACX,OAAO;AAAA,QACL,MAAM;AAAA,MACP;AAAA,MACD,WAAW,MAAMC,QAAW,QAAQA,QAAW,KAAK;AAAA,MACpD,QAAQ,MAAM,SAAU;AAAA,IAC5B,CAAG,GAEF,YAAY,MAAM;AACfF,cAAc,eAAe,UAAU;IAC3C,CAAG;AAKD,aAAS,WAAW;AAClB,UAAI,MAAM,OAAO,UAAU;AACzBF,gBAAmB,OAAOC,MAAiB,OAAO;AAAA,MACxD,OAAW;AACLD,gBAAmB,OAAOC,MAAiB,OAAO;AAAA,MACnD;AAAA,IACF;AAED,aAAS,aAAc;AACrB,aAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,QAAQ;AAAA,UACN,KAAK,MAAM,OAAO;AAAA,QACnB;AAAA,MACP,CAAK;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6,7 +6,7 @@ const Field = require("../../../../components/Field/Field.vue2.cjs");
6
6
  const Feed = require("../../../../components/Feed/Feed.vue.cjs");
7
7
  const Select = require("../../../../components/Select/Select.vue.cjs");
8
8
  const Popup = require("../../../../components/Popup/Popup.vue.cjs");
9
- ;/* empty css */
9
+ ;/* empty css */
10
10
  const CardPosition = require("../blocks/CardPosition.vue.cjs");
11
11
  const CardOrderItem = require("../../../orders/components/blocks/CardOrderItem.vue.cjs");
12
12
  const vueRouter = require("vue-router");
@@ -4,7 +4,7 @@ import Field from "../../../../components/Field/Field.vue2.js";
4
4
  import _sfc_main$2 from "../../../../components/Feed/Feed.vue.js";
5
5
  import Select from "../../../../components/Select/Select.vue.js";
6
6
  import _sfc_main$1 from "../../../../components/Popup/Popup.vue.js";
7
- /* empty css */
7
+ /* empty css */
8
8
  import _sfc_main$5 from "../blocks/CardPosition.vue.js";
9
9
  import _sfc_main$3 from "../../../orders/components/blocks/CardOrderItem.vue.js";
10
10
  import { useRoute, useRouter } from "vue-router";
@@ -8,8 +8,8 @@ const vueI18n = require("vue-i18n");
8
8
  const auth = require("../../../auth/views/store/auth.cjs");
9
9
  const products = require("../../store/products.cjs");
10
10
  require("../../store/categories.cjs");
11
- ;/* empty css */
12
- const _hoisted_1 = { class: "flex flex-column w-100 o-hidden gap-thin pd-thin" };
11
+ const _hoisted_1 = { class: "h-100 w-100 bg-white" };
12
+ const _hoisted_2 = { class: "h-max pos-relative" };
13
13
  const _sfc_main = {
14
14
  __name: "Product",
15
15
  setup(__props) {
@@ -19,10 +19,7 @@ const _sfc_main = {
19
19
  route.meta.title.ru = products.state.current.name;
20
20
  const product = vue.computed(() => products.state.current);
21
21
  const text = {
22
- messages: {
23
- en: {},
24
- ru: {}
25
- }
22
+ messages: {}
26
23
  };
27
24
  vue.onMounted(async () => {
28
25
  await products.actions.read({ _id: route.params.product });
@@ -36,7 +33,10 @@ const _sfc_main = {
36
33
  user: auth.state.user,
37
34
  class: "pos-relative"
38
35
  }, null, 8, ["product", "user"])) : vue.createCommentVNode("", true),
39
- vue.createVNode(PopularProducts.default)
36
+ vue.createElementVNode("div", _hoisted_2, [
37
+ _cache[0] || (_cache[0] = vue.createElementVNode("h3", { class: "pd-medium pd-b-small" }, "Most Popular", -1)),
38
+ vue.createVNode(PopularProducts.default)
39
+ ])
40
40
  ]);
41
41
  };
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Product.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/Product.vue"],"sourcesContent":["<template>\n\t<div class=\"flex flex-column w-100 o-hidden gap-thin pd-thin\">\n\t\t<!-- <Breadcrumbs class=\"bg-light radius-big pd-small\"/> -->\n\t\t<!-- {{product.quantity}}\n\t\t<div v-if=\"product.ingredients\">\n\t\t\t{{product?.ingredients[0]?._id}}\n\t\t\t{{product?.ingredients[0]?.quantity}}\n\t\t\t{{product?.ingredients[1]?.quantity}}\n\t\t</div> -->\n\t\t<SectionProduct v-if=\"product\" :product=\"product\" :user=\"auth.state.user\" class=\"pos-relative\"/>\n\n\t\t<PopularProducts />\n\t</div>\n</template>\n\n<script setup=\"props\">\n\t// Import components\n\t// import Breadcrumbs from '@pf/src/components/Breadcrumbs/Breadcrumbs.vue'\n\timport PopularProducts \tfrom '@pf/src/modules/products/components/sections/PopularProducts.vue'\n\timport SectionProduct from '@pf/src/modules/products/components/sections/SectionProduct.vue'\n\t// Import libs\n\timport { computed, onMounted } from 'vue'\n\timport { useRoute,useRouter } from 'vue-router'\n\timport { useI18n } from 'vue-i18n'\n\t\n import * as auth from '@pf/src/modules/auth/views/store/auth';\n \timport * as products from '@pf/src/modules/products/store/products';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\t// Accessing router and store\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n\t\n\troute.meta.title.en = products.state.current.name\n\troute.meta.title.ru = products.state.current.name\n\n\t// Accessing state\n\tconst product = computed(() => products.state.current)\n\n\tconst text = {\n\t\tmessages: {\n\t\t\ten: {\n\n\t\t\t},\n\t\t\tru: {\n\n\t\t\t}\n\t\t}\n\t};\n\n\tonMounted(async ()=> {\n\t\tawait products.actions.read({_id: route.params.product});\n\n\t})\n\t\n\t// products.state.current.localization.forEach(localization => {\n \t// if (localization) text.messages[localization.locale].description = localization.text\n\t// })\n\n const { t } = useI18n(text)\n</script>\n\n<style lang=\"scss\">\n.h1-product {\n\tfont-size: 3rem;\n}\n.produc-data { \n\tpadding-top: 2rem;\n\tpadding-bottom: 0;\n}\n</style>\n"],"names":["useRoute","useRouter","products.state","computed","onMounted","products.actions","useI18n"],"mappings":";;;;;;;;;;;;;;;AA8BC,UAAM,QAAQA,UAAAA,SAAU;AACTC,wBAAW;AAG1B,UAAM,KAAK,MAAM,KAAKC,SAAc,MAAC,QAAQ;AAC7C,UAAM,KAAK,MAAM,KAAKA,SAAc,MAAC,QAAQ;AAG7C,UAAM,UAAUC,IAAAA,SAAS,MAAMD,SAAAA,MAAe,OAAO;AAErD,UAAM,OAAO;AAAA,MACZ,UAAU;AAAA,QACT,IAAI,CAEH;AAAA,QACD,IAAI,CAEH;AAAA,MACD;AAAA,IACH;AAECE,QAAAA,UAAU,YAAW;AACpB,YAAMC,SAAAA,QAAiB,KAAK,EAAC,KAAK,MAAM,OAAO,QAAO,CAAC;AAAA,IAEzD,CAAE;AAMcC,YAAAA,QAAQ,IAAI;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Product.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/Product.vue"],"sourcesContent":["<template>\n\t<div class=\"h-100 w-100 bg-white \">\n\t\t<!-- <Breadcrumbs class=\"bg-light radius-big pd-small\"/> -->\n\t\t<SectionProduct v-if=\"product\" :product=\"product\" :user=\"auth.state.user\" class=\"pos-relative\"/>\n\n\t\t<div class=\"h-max pos-relative\">\n\t\t <h3 class=\"pd-medium pd-b-small\">Most Popular</h3>\n\t\t\t<PopularProducts />\n\t\t</div>\n\t</div>\n</template>\n\n<script setup=\"props\">\n\t// Import components\n\t// import Breadcrumbs from '@pf/src/components/Breadcrumbs/Breadcrumbs.vue'\n\timport PopularProducts \tfrom '@pf/src/modules/products/components/sections/PopularProducts.vue'\n\timport SectionProduct from '@pf/src/modules/products/components/sections/SectionProduct.vue'\n\t// Import libs\n\timport { computed, onMounted } from 'vue'\n\timport { useRoute,useRouter } from 'vue-router'\n\timport { useI18n } from 'vue-i18n'\n\t\n import * as auth from '@pf/src/modules/auth/views/store/auth';\n \timport * as products from '@pf/src/modules/products/store/products';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\t// Accessing router and store\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n\t\n\troute.meta.title.en = products.state.current.name\n\troute.meta.title.ru = products.state.current.name\n\n\t// Accessing state\n\tconst product = computed(() => products.state.current)\n\n\tconst text = {\n\t\tmessages: {\n\t\t}\n\t};\n\n\tonMounted(async ()=> {\n\t\tawait products.actions.read({_id: route.params.product});\n\n\t})\n\t\n\t// products.state.current.localization.forEach(localization => {\n \t// if (localization) text.messages[localization.locale].description = localization.text\n\t// })\n\n const { t } = useI18n(text)\n</script>\n\n<style lang=\"scss\">\n</style>\n"],"names":["useRoute","useRouter","products.state","computed","onMounted","products.actions","useI18n"],"mappings":";;;;;;;;;;;;;;;AA2BC,UAAM,QAAQA,UAAAA,SAAU;AACTC,wBAAW;AAG1B,UAAM,KAAK,MAAM,KAAKC,SAAc,MAAC,QAAQ;AAC7C,UAAM,KAAK,MAAM,KAAKA,SAAc,MAAC,QAAQ;AAG7C,UAAM,UAAUC,IAAAA,SAAS,MAAMD,SAAAA,MAAe,OAAO;AAErD,UAAM,OAAO;AAAA,MACZ,UAAU,CACT;AAAA,IACH;AAECE,QAAAA,UAAU,YAAW;AACpB,YAAMC,SAAAA,QAAiB,KAAK,EAAC,KAAK,MAAM,OAAO,QAAO,CAAC;AAAA,IAEzD,CAAE;AAMcC,YAAAA,QAAQ,IAAI;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { computed, onMounted, openBlock, createElementBlock, createBlock, createCommentVNode, createVNode } from "vue";
1
+ import { computed, onMounted, openBlock, createElementBlock, createBlock, createCommentVNode, createElementVNode, createVNode } from "vue";
2
2
  import _sfc_main$2 from "../sections/PopularProducts.vue.js";
3
3
  import _sfc_main$1 from "../sections/SectionProduct.vue.js";
4
4
  import { useRoute, useRouter } from "vue-router";
@@ -6,8 +6,8 @@ import { useI18n } from "vue-i18n";
6
6
  import { state as state$1 } from "../../../auth/views/store/auth.js";
7
7
  import { state, actions } from "../../store/products.js";
8
8
  import "../../store/categories.js";
9
- /* empty css */
10
- const _hoisted_1 = { class: "flex flex-column w-100 o-hidden gap-thin pd-thin" };
9
+ const _hoisted_1 = { class: "h-100 w-100 bg-white" };
10
+ const _hoisted_2 = { class: "h-max pos-relative" };
11
11
  const _sfc_main = {
12
12
  __name: "Product",
13
13
  setup(__props) {
@@ -17,10 +17,7 @@ const _sfc_main = {
17
17
  route.meta.title.ru = state.current.name;
18
18
  const product = computed(() => state.current);
19
19
  const text = {
20
- messages: {
21
- en: {},
22
- ru: {}
23
- }
20
+ messages: {}
24
21
  };
25
22
  onMounted(async () => {
26
23
  await actions.read({ _id: route.params.product });
@@ -34,7 +31,10 @@ const _sfc_main = {
34
31
  user: state$1.user,
35
32
  class: "pos-relative"
36
33
  }, null, 8, ["product", "user"])) : createCommentVNode("", true),
37
- createVNode(_sfc_main$2)
34
+ createElementVNode("div", _hoisted_2, [
35
+ _cache[0] || (_cache[0] = createElementVNode("h3", { class: "pd-medium pd-b-small" }, "Most Popular", -1)),
36
+ createVNode(_sfc_main$2)
37
+ ])
38
38
  ]);
39
39
  };
40
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Product.vue.js","sources":["../../../../../../../src/modules/products/components/pages/Product.vue"],"sourcesContent":["<template>\n\t<div class=\"flex flex-column w-100 o-hidden gap-thin pd-thin\">\n\t\t<!-- <Breadcrumbs class=\"bg-light radius-big pd-small\"/> -->\n\t\t<!-- {{product.quantity}}\n\t\t<div v-if=\"product.ingredients\">\n\t\t\t{{product?.ingredients[0]?._id}}\n\t\t\t{{product?.ingredients[0]?.quantity}}\n\t\t\t{{product?.ingredients[1]?.quantity}}\n\t\t</div> -->\n\t\t<SectionProduct v-if=\"product\" :product=\"product\" :user=\"auth.state.user\" class=\"pos-relative\"/>\n\n\t\t<PopularProducts />\n\t</div>\n</template>\n\n<script setup=\"props\">\n\t// Import components\n\t// import Breadcrumbs from '@pf/src/components/Breadcrumbs/Breadcrumbs.vue'\n\timport PopularProducts \tfrom '@pf/src/modules/products/components/sections/PopularProducts.vue'\n\timport SectionProduct from '@pf/src/modules/products/components/sections/SectionProduct.vue'\n\t// Import libs\n\timport { computed, onMounted } from 'vue'\n\timport { useRoute,useRouter } from 'vue-router'\n\timport { useI18n } from 'vue-i18n'\n\t\n import * as auth from '@pf/src/modules/auth/views/store/auth';\n \timport * as products from '@pf/src/modules/products/store/products';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\t// Accessing router and store\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n\t\n\troute.meta.title.en = products.state.current.name\n\troute.meta.title.ru = products.state.current.name\n\n\t// Accessing state\n\tconst product = computed(() => products.state.current)\n\n\tconst text = {\n\t\tmessages: {\n\t\t\ten: {\n\n\t\t\t},\n\t\t\tru: {\n\n\t\t\t}\n\t\t}\n\t};\n\n\tonMounted(async ()=> {\n\t\tawait products.actions.read({_id: route.params.product});\n\n\t})\n\t\n\t// products.state.current.localization.forEach(localization => {\n \t// if (localization) text.messages[localization.locale].description = localization.text\n\t// })\n\n const { t } = useI18n(text)\n</script>\n\n<style lang=\"scss\">\n.h1-product {\n\tfont-size: 3rem;\n}\n.produc-data { \n\tpadding-top: 2rem;\n\tpadding-bottom: 0;\n}\n</style>\n"],"names":["products.state","products.actions"],"mappings":";;;;;;;;;;;;;AA8BC,UAAM,QAAQ,SAAU;AACT,cAAW;AAG1B,UAAM,KAAK,MAAM,KAAKA,MAAe,QAAQ;AAC7C,UAAM,KAAK,MAAM,KAAKA,MAAe,QAAQ;AAG7C,UAAM,UAAU,SAAS,MAAMA,MAAe,OAAO;AAErD,UAAM,OAAO;AAAA,MACZ,UAAU;AAAA,QACT,IAAI,CAEH;AAAA,QACD,IAAI,CAEH;AAAA,MACD;AAAA,IACH;AAEC,cAAU,YAAW;AACpB,YAAMC,QAAiB,KAAK,EAAC,KAAK,MAAM,OAAO,QAAO,CAAC;AAAA,IAEzD,CAAE;AAMc,YAAQ,IAAI;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Product.vue.js","sources":["../../../../../../../src/modules/products/components/pages/Product.vue"],"sourcesContent":["<template>\n\t<div class=\"h-100 w-100 bg-white \">\n\t\t<!-- <Breadcrumbs class=\"bg-light radius-big pd-small\"/> -->\n\t\t<SectionProduct v-if=\"product\" :product=\"product\" :user=\"auth.state.user\" class=\"pos-relative\"/>\n\n\t\t<div class=\"h-max pos-relative\">\n\t\t <h3 class=\"pd-medium pd-b-small\">Most Popular</h3>\n\t\t\t<PopularProducts />\n\t\t</div>\n\t</div>\n</template>\n\n<script setup=\"props\">\n\t// Import components\n\t// import Breadcrumbs from '@pf/src/components/Breadcrumbs/Breadcrumbs.vue'\n\timport PopularProducts \tfrom '@pf/src/modules/products/components/sections/PopularProducts.vue'\n\timport SectionProduct from '@pf/src/modules/products/components/sections/SectionProduct.vue'\n\t// Import libs\n\timport { computed, onMounted } from 'vue'\n\timport { useRoute,useRouter } from 'vue-router'\n\timport { useI18n } from 'vue-i18n'\n\t\n import * as auth from '@pf/src/modules/auth/views/store/auth';\n \timport * as products from '@pf/src/modules/products/store/products';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\t// Accessing router and store\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n\t\n\troute.meta.title.en = products.state.current.name\n\troute.meta.title.ru = products.state.current.name\n\n\t// Accessing state\n\tconst product = computed(() => products.state.current)\n\n\tconst text = {\n\t\tmessages: {\n\t\t}\n\t};\n\n\tonMounted(async ()=> {\n\t\tawait products.actions.read({_id: route.params.product});\n\n\t})\n\t\n\t// products.state.current.localization.forEach(localization => {\n \t// if (localization) text.messages[localization.locale].description = localization.text\n\t// })\n\n const { t } = useI18n(text)\n</script>\n\n<style lang=\"scss\">\n</style>\n"],"names":["products.state","products.actions"],"mappings":";;;;;;;;;;;;;AA2BC,UAAM,QAAQ,SAAU;AACT,cAAW;AAG1B,UAAM,KAAK,MAAM,KAAKA,MAAe,QAAQ;AAC7C,UAAM,KAAK,MAAM,KAAKA,MAAe,QAAQ;AAG7C,UAAM,UAAU,SAAS,MAAMA,MAAe,OAAO;AAErD,UAAM,OAAO;AAAA,MACZ,UAAU,CACT;AAAA,IACH;AAEC,cAAU,YAAW;AACpB,YAAMC,QAAiB,KAAK,EAAC,KAAK,MAAM,OAAO,QAAO,CAAC;AAAA,IAEzD,CAAE;AAMc,YAAQ,IAAI;;;;;;;;;;;;;;;;;"}
@@ -24,10 +24,6 @@ const _hoisted_2 = {
24
24
  const _hoisted_3 = { class: "cols-2-1_3 h-100 z-index-3 pos-relative radius-big gap-thin" };
25
25
  const _hoisted_4 = { class: "z-index-3 bg-white radius-tl-big radius-tr-big" };
26
26
  const _hoisted_5 = { class: "pd-thin z-index-3 radius-tl-big radius-tr-big pos-t-0 pos-sticky" };
27
- const _hoisted_6 = {
28
- class: "gap-thin cols-4",
29
- style: { "display": "grid", "grid-auto-rows": "1fr" }
30
- };
31
27
  const _sfc_main = {
32
28
  __name: "Products",
33
29
  setup(__props) {
@@ -164,30 +160,29 @@ const _sfc_main = {
164
160
  ...tabProducts.value !== "all" && { status: tabProducts.value }
165
161
  // user: user
166
162
  },
167
- class: "pd-t-zero pd-thin gap-thin"
163
+ class: "cols-4 rows-1 pd-t-zero pd-thin gap-thin"
168
164
  }, {
169
165
  default: vue.withCtx(({
170
166
  items
171
167
  }) => [
172
- vue.createElementVNode("div", _hoisted_6, [
173
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items, (product) => {
174
- return vue.openBlock(), vue.createBlock(_component_router_link, {
175
- to: vue.unref(route).params._id ? { name: "Organization_Product", params: { _id: vue.unref(route).params._id, product: product._id } } : { name: "Product", params: { product: product._id } }
176
- }, {
177
- default: vue.withCtx(() => [
178
- (vue.openBlock(), vue.createBlock(CardProduct.default, {
179
- key: product._id,
180
- product,
181
- user: auth.state.access,
182
- organization: vue.unref(route).params._id,
183
- access: _ctx.hasAccess(vue.unref(route).params._id, "products", "edit", auth.state.accesses),
184
- class: "h-100 bg-light"
185
- }, null, 8, ["product", "user", "organization", "access"]))
186
- ]),
187
- _: 2
188
- }, 1032, ["to"]);
189
- }), 256))
190
- ])
168
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items, (product) => {
169
+ return vue.openBlock(), vue.createBlock(_component_router_link, {
170
+ to: vue.unref(route).params._id ? { name: "Organization_Product", params: { _id: vue.unref(route).params._id, product: product._id } } : { name: "Product", params: { product: product._id } },
171
+ class: "pos-relative h-100 w-100"
172
+ }, {
173
+ default: vue.withCtx(() => [
174
+ (vue.openBlock(), vue.createBlock(CardProduct.default, {
175
+ key: product._id,
176
+ product,
177
+ user: auth.state.access,
178
+ organization: vue.unref(route).params._id,
179
+ access: _ctx.hasAccess(vue.unref(route).params._id, "products", "edit", auth.state.accesses),
180
+ class: "pos-relative h-100 w-100 bg-light"
181
+ }, null, 8, ["product", "user", "organization", "access"]))
182
+ ]),
183
+ _: 2
184
+ }, 1032, ["to"]);
185
+ }), 256))
191
186
  ]),
192
187
  _: 1
193
188
  }, 8, ["filter", "store", "options"])
@@ -1 +1 @@
1
- {"version":3,"file":"Products.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/Products.vue"],"sourcesContent":["<template>\n <div class=\"h-100\">\n <header \n v-if=\"route.name !== 'Organization' && !MOBILE_APP\"\n class=\"mn-b-medium flex-v-center flex-nowrap flex\"\n >\n <h2 class=\"mn-r-medium\">Products</h2>\n <button \n @click=\"$router.push({\n name: route.params?._id ? 'Organization_ProductAdd' : 'ProductAdd'\n })\" \n class=\"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second\">\n +\n </button>\n </header>\n\n <Tab \n v-if=\"route.name !== 'Organization'\"\n v-model:selected=\"tabProducts\"\n :tabs=\"[\n { name: 'All', value: 'all' },\n { name: 'Published', value: 'published' },\n { name: 'Unpublished', value: 'unpublished' }, \n { name: 'Archivied', value: 'archivied' } \n ]\"\n style=\"flex: 0 0 auto\"\n class=\"\n o-hidden \n h5 \n bg-light\n gap-micro pd-small pd-t-thin pd-b-thin\n pos-sticky pos-t-0\n z-index-1\n\n \"\n tabClass=\"bg-white uppercase pd-small radius-small w-100\"\n />\n\n <div class=\"cols-2-1_3 h-100 z-index-3 pos-relative radius-big gap-thin\">\n\n <BlockFilter\n v-model:filter=\"marketplace.state.filter\"\n :options=\"marketplace.state.filter.options\"\n class=\"h-100 w-100 z-index-2 desktop-only\"\n />\n\n\n <div class=\"z-index-3 bg-white radius-tl-big radius-tr-big\">\n <div class=\"pd-thin z-index-3 radius-tl-big radius-tr-big pos-t-0 pos-sticky\">\n <BlockSearch \n @search=\"updateSearch\"\n placeholder=\"Enter product name\"\n class=\"bg-light h-4r\"\n />\n </div>\n <Feed\n v-model:filter=\"marketplace.state.filter\"\n :states=\"{\n empty: {\n title: 'No Products Found',\n description: 'Currently, there are no products available.'\n }\n }\"\n :store=\"{\n read: (options) => products.actions.read(options),\n state: products.state\n }\"\n :options=\"{\n limit: 15,\n owner: route.params._id,\n categories: route.query.categories,\n prices: route.query.prices,\n delivery: route.query.delivery,\n // search: route.query.search,\n ...(tabProducts !== 'all' && { status: tabProducts })\n // user: user\n }\"\n v-slot=\"{ \n items \n }\"\n class=\" pd-t-zero pd-thin gap-thin\"\n \n >\n <div class=\"gap-thin cols-4\" style=\"\n display:grid;\n grid-auto-rows: 1fr;\n \">\n <router-link \n v-for=\"product in items\" \n :to=\"route.params._id ? { name: 'Organization_Product', params: { _id: route.params._id, product: product._id } } : { name: 'Product', params: { product: product._id } }\">\n <CardProduct\n :key=\"product._id\"\n :product=\"product\"\n :user=\"auth.state.access\"\n :organization=\"route.params._id\"\n :access=\"hasAccess(route.params._id, 'products', 'edit', auth.state.accesses)\"\n class=\"h-100 bg-light\"\n />\n </router-link>\n </div>\n </Feed>\n\n </div>\n </div>\n</div>\n</template>\n\n\n<script setup=\"props\">\n // Import libs\n import { ref, computed, watch, onMounted, onUnmounted } from 'vue'\n import { useRoute, useRouter } from 'vue-router'\n\n // Import components\n import Tab from '@pf/src/components/Tab/Tab.vue'\n import Feed from '@pf/src/components/Feed/Feed.vue'\n\n import FilterProducts from '@pf/src/modules/products/components/sections/FilterProducts.vue'\n import BlockSearch from '@pf/src/modules/globals/views/components/blocks/BlockSearch.vue'\n import BlockFilter from '@pf/src/modules/globals/views/components/blocks/BlockFilter.vue'\n\n import CardProduct from '@pf/src/modules/products/components/blocks/CardProduct.vue'\n\n import IconPlus from '@pf/src/modules/icons/navigation/IconPlus.vue'\n\n // Accessing router and store\n import * as auth from '@pf/src/modules/auth/views/store/auth';\n import * as globals from '@pf/src/modules/globals/views/store/globals';\n import * as products from '@pf/src/modules/products/store/products';\n import * as marketplace from '@pf/src/modules/products/store/marketplace';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n const route = useRoute()\n const router = useRouter()\n\n // Tab logic\n const tabProducts = ref(route.query.tabProducts ? route.query.tabProducts : 'all')\n\n if (route.name !== 'Organization') route.query.tabProducts = tabProducts.value\n \n if (route.query) {\n const query = route.query;\n\n marketplace.state.filter.selected.categories = query.categories ? query.categories.split(',') : [];\n marketplace.state.filter.selected.prices = query.prices ? query.prices.split(',') : [];\n marketplace.state.filter.selected.delivery = query.delivery ? query.delivery.split(',') : [];\n }\n\n watch(tabProducts, (newValue) => {\n if (route.name !== 'Organization') router.replace({ query: { ...route.query, tabProducts: newValue } });\n });\n\n globals.state.navigation_bar.actions = [{\n component: IconPlus,\n props: {\n fill: \"rgb(var(--main))\" \n },\n condition: () => auth.state.user && auth.state.user._id,\n action: () => route.params._id ? router.push({ name: 'Organization_ProductAdd', params: { _id: route.params._id} }) : router.push({ name: 'ProductAdd' })\n }],\n\n onMounted(async () => {\n let categoriesFilter = await categories.actions.fetchCategories();\n\n categoriesFilter = categoriesFilter.map(category => ({\n value: category.url,\n label: category.name\n }));\n\n const index = marketplace.state.filter.options.findIndex(option => option.value === 'categories');\n\n const categoryOption = {\n title: 'Categories',\n value: 'categories',\n options: categoriesFilter\n };\n\n if (index !== -1) {\n marketplace.state.filter.options[index] = categoryOption;\n } else {\n marketplace.state.filter.options.unshift(categoryOption);\n }\n })\n\n onUnmounted(() => {\n globals.state.navigation_bar.actions = [];\n });\n\n watch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {\n let query = { ...route.query}\n \n query.sortParam = newSortValue.param\n query.sortOrder = newSortValue.order\n \n // replace the current route\n router.replace({ query });\n }, { deep: true });\n\n\n watch(() => marketplace.state.filter.selected, (newFilterValue, oldFilterValue) => {\n // Переводим фильтр в формат query\n const query = { ...route.query };\n\n // Удаляем старые значения фильтра из query\n Object.keys(oldFilterValue).forEach(key => {\n if (query[key]) {\n delete query[key];\n }\n });\n\n // Добавляем новые значения фильтра в query\n const newQueryValues = Object.fromEntries(\n Object.entries(newFilterValue)\n .filter(([key, value]) => Array.isArray(value) && value.length > 0)\n .map(([key, value]) => [key, value.join(',')])\n );\n\n delete query.options;\n Object.assign(query, newQueryValues);\n\n // Обновляем маршрут с новым query\n router.replace({ query });\n }, { deep: true })\n\n\n\n \n function updateSearch(search) {\n let query = { ...route.query}\n \n query.search = search\n \n router.replace({ query });\n }\n</script>\n\n<style lang=\"scss\">\n\n\n</style>\n"],"names":["useRoute","useRouter","ref","marketplace.state","watch","globals.state","IconPlus","auth.state","onMounted","categories.actions","onUnmounted"],"mappings":"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"}
1
+ {"version":3,"file":"Products.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/Products.vue"],"sourcesContent":["<template>\n <div class=\"h-100\">\n <header \n v-if=\"route.name !== 'Organization' && !MOBILE_APP\"\n class=\"mn-b-medium flex-v-center flex-nowrap flex\"\n >\n <h2 class=\"mn-r-medium\">Products</h2>\n <button \n @click=\"$router.push({\n name: route.params?._id ? 'Organization_ProductAdd' : 'ProductAdd'\n })\" \n class=\"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second\">\n +\n </button>\n </header>\n\n <Tab \n v-if=\"route.name !== 'Organization'\"\n v-model:selected=\"tabProducts\"\n :tabs=\"[\n { name: 'All', value: 'all' },\n { name: 'Published', value: 'published' },\n { name: 'Unpublished', value: 'unpublished' }, \n { name: 'Archivied', value: 'archivied' } \n ]\"\n style=\"flex: 0 0 auto\"\n class=\"\n o-hidden \n h5 \n bg-light\n gap-micro pd-small pd-t-thin pd-b-thin\n pos-sticky pos-t-0\n z-index-1\n\n \"\n tabClass=\"bg-white uppercase pd-small radius-small w-100\"\n />\n\n <div class=\"cols-2-1_3 h-100 z-index-3 pos-relative radius-big gap-thin\">\n\n <BlockFilter\n v-model:filter=\"marketplace.state.filter\"\n :options=\"marketplace.state.filter.options\"\n class=\"h-100 w-100 z-index-2 desktop-only\"\n />\n\n\n <div class=\"z-index-3 bg-white radius-tl-big radius-tr-big\">\n <div class=\"pd-thin z-index-3 radius-tl-big radius-tr-big pos-t-0 pos-sticky\">\n <BlockSearch \n @search=\"updateSearch\"\n placeholder=\"Enter product name\"\n class=\"bg-light h-4r\"\n />\n </div>\n <Feed\n v-model:filter=\"marketplace.state.filter\"\n :states=\"{\n empty: {\n title: 'No Products Found',\n description: 'Currently, there are no products available.'\n }\n }\"\n :store=\"{\n read: (options) => products.actions.read(options),\n state: products.state\n }\"\n :options=\"{\n limit: 15,\n owner: route.params._id,\n categories: route.query.categories,\n prices: route.query.prices,\n delivery: route.query.delivery,\n // search: route.query.search,\n ...(tabProducts !== 'all' && { status: tabProducts })\n // user: user\n }\"\n v-slot=\"{ \n items \n }\"\n class=\"cols-4 rows-1 pd-t-zero pd-thin gap-thin\"\n \n >\n <router-link \n v-for=\"product in items\" \n :to=\"route.params._id ? { name: 'Organization_Product', params: { _id: route.params._id, product: product._id } } : { name: 'Product', params: { product: product._id } }\"\n class=\"pos-relative h-100 w-100\"\n >\n <CardProduct\n :key=\"product._id\"\n :product=\"product\"\n :user=\"auth.state.access\"\n :organization=\"route.params._id\"\n :access=\"hasAccess(route.params._id, 'products', 'edit', auth.state.accesses)\"\n class=\"pos-relative h-100 w-100 bg-light\"\n />\n </router-link>\n </Feed>\n\n </div>\n </div>\n</div>\n</template>\n\n\n<script setup=\"props\">\n // Import libs\n import { ref, computed, watch, onMounted, onUnmounted } from 'vue'\n import { useRoute, useRouter } from 'vue-router'\n\n // Import components\n import Tab from '@pf/src/components/Tab/Tab.vue'\n import Feed from '@pf/src/components/Feed/Feed.vue'\n\n import FilterProducts from '@pf/src/modules/products/components/sections/FilterProducts.vue'\n import BlockSearch from '@pf/src/modules/globals/views/components/blocks/BlockSearch.vue'\n import BlockFilter from '@pf/src/modules/globals/views/components/blocks/BlockFilter.vue'\n\n import CardProduct from '@pf/src/modules/products/components/blocks/CardProduct.vue'\n\n import IconPlus from '@pf/src/modules/icons/navigation/IconPlus.vue'\n\n // Accessing router and store\n import * as auth from '@pf/src/modules/auth/views/store/auth';\n import * as globals from '@pf/src/modules/globals/views/store/globals';\n import * as products from '@pf/src/modules/products/store/products';\n import * as marketplace from '@pf/src/modules/products/store/marketplace';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n const route = useRoute()\n const router = useRouter()\n\n // Tab logic\n const tabProducts = ref(route.query.tabProducts ? route.query.tabProducts : 'all')\n\n if (route.name !== 'Organization') route.query.tabProducts = tabProducts.value\n \n if (route.query) {\n const query = route.query;\n\n marketplace.state.filter.selected.categories = query.categories ? query.categories.split(',') : [];\n marketplace.state.filter.selected.prices = query.prices ? query.prices.split(',') : [];\n marketplace.state.filter.selected.delivery = query.delivery ? query.delivery.split(',') : [];\n }\n\n watch(tabProducts, (newValue) => {\n if (route.name !== 'Organization') router.replace({ query: { ...route.query, tabProducts: newValue } });\n });\n\n globals.state.navigation_bar.actions = [{\n component: IconPlus,\n props: {\n fill: \"rgb(var(--main))\" \n },\n condition: () => auth.state.user && auth.state.user._id,\n action: () => route.params._id ? router.push({ name: 'Organization_ProductAdd', params: { _id: route.params._id} }) : router.push({ name: 'ProductAdd' })\n }],\n\n onMounted(async () => {\n let categoriesFilter = await categories.actions.fetchCategories();\n\n categoriesFilter = categoriesFilter.map(category => ({\n value: category.url,\n label: category.name\n }));\n\n const index = marketplace.state.filter.options.findIndex(option => option.value === 'categories');\n\n const categoryOption = {\n title: 'Categories',\n value: 'categories',\n options: categoriesFilter\n };\n\n if (index !== -1) {\n marketplace.state.filter.options[index] = categoryOption;\n } else {\n marketplace.state.filter.options.unshift(categoryOption);\n }\n })\n\n onUnmounted(() => {\n globals.state.navigation_bar.actions = [];\n });\n\n watch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {\n let query = { ...route.query}\n \n query.sortParam = newSortValue.param\n query.sortOrder = newSortValue.order\n \n // replace the current route\n router.replace({ query });\n }, { deep: true });\n\n\n watch(() => marketplace.state.filter.selected, (newFilterValue, oldFilterValue) => {\n // Переводим фильтр в формат query\n const query = { ...route.query };\n\n // Удаляем старые значения фильтра из query\n Object.keys(oldFilterValue).forEach(key => {\n if (query[key]) {\n delete query[key];\n }\n });\n\n // Добавляем новые значения фильтра в query\n const newQueryValues = Object.fromEntries(\n Object.entries(newFilterValue)\n .filter(([key, value]) => Array.isArray(value) && value.length > 0)\n .map(([key, value]) => [key, value.join(',')])\n );\n\n delete query.options;\n Object.assign(query, newQueryValues);\n\n // Обновляем маршрут с новым query\n router.replace({ query });\n }, { deep: true })\n\n\n\n \n function updateSearch(search) {\n let query = { ...route.query}\n \n query.search = search\n \n router.replace({ query });\n }\n</script>\n\n<style lang=\"scss\">\n\n\n</style>\n"],"names":["useRoute","useRouter","ref","marketplace.state","watch","globals.state","IconPlus","auth.state","onMounted","categories.actions","onUnmounted"],"mappings":"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"}