@ozdao/martyrs 0.2.561 → 0.2.562

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/dist/{main-DQtUY5ma.js → main-TV4u6Jux.js} +2915 -2626
  2. package/dist/martyrs/src/components/Button/Button.vue.js +2 -2
  3. package/dist/martyrs/src/components/Button/Button.vue.js.map +1 -1
  4. package/dist/martyrs/src/components/Checkbox/Checkbox.vue.js +1 -1
  5. package/dist/martyrs/src/components/Checkbox/Checkbox.vue.js.map +1 -1
  6. package/dist/martyrs/src/components/EditImages/{EditImages.vue.js → EditImages.vue2.js} +2 -2
  7. package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +1 -0
  8. package/dist/martyrs/src/components/Feed/Carousel.vue.js +1 -1
  9. package/dist/martyrs/src/components/Feed/Feed.vue.js +2 -2
  10. package/dist/martyrs/src/components/Field/{Field.vue.js → Field.vue2.js} +2 -2
  11. package/dist/martyrs/src/components/Field/Field.vue2.js.map +1 -0
  12. package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
  13. package/dist/martyrs/src/components/Loader/{Loader.vue.js → Loader.vue2.js} +2 -2
  14. package/dist/martyrs/src/components/Loader/Loader.vue2.js.map +1 -0
  15. package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue.js +1 -1
  16. package/dist/martyrs/src/components/Media/Media.vue.js +1 -1
  17. package/dist/martyrs/src/components/Menu/{Menu.vue2.js → Menu.vue.js} +2 -2
  18. package/dist/martyrs/src/components/Menu/Menu.vue.js.map +1 -0
  19. package/dist/martyrs/src/components/SelectMulti/{SelectMulti.vue2.js → SelectMulti.vue.js} +2 -2
  20. package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue.js.map +1 -0
  21. package/dist/martyrs/src/components/Spoiler/{Spoiler.vue.js → Spoiler.vue2.js} +2 -2
  22. package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +1 -0
  23. package/dist/martyrs/src/components/Tab/{Tab.vue.js → Tab.vue2.js} +2 -2
  24. package/dist/martyrs/src/components/Tab/Tab.vue2.js.map +1 -0
  25. package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js +1 -1
  26. package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
  27. package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js +1 -1
  28. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +2 -2
  29. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +2 -2
  30. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +3 -3
  31. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +1 -1
  32. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +1 -1
  33. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
  34. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +2 -2
  35. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +2 -2
  36. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +2 -2
  37. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +1 -1
  38. package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js +1 -1
  39. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
  40. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  41. package/dist/martyrs/src/modules/constructor/components/elements/Card.vue.js +1 -1
  42. package/dist/martyrs/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  43. package/dist/martyrs/src/modules/core/views/components/blocks/BlockSearch.vue.js +1 -1
  44. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +1 -1
  45. package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +1 -1
  46. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +3 -6
  47. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js.map +1 -1
  48. package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +1 -1
  49. package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js.map +1 -1
  50. package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +1 -1
  51. package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue.js → Filters.vue2.js} +60 -172
  52. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +1 -0
  53. package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js +1 -1
  54. package/dist/martyrs/src/modules/core/views/components/sections/filters/FilterCheckbox.vue2.js +64 -0
  55. package/dist/martyrs/src/modules/core/views/components/sections/filters/FilterCheckbox.vue2.js.map +1 -0
  56. package/dist/martyrs/src/modules/core/views/components/sections/filters/FilterDateRange.vue2.js +160 -0
  57. package/dist/martyrs/src/modules/core/views/components/sections/filters/FilterDateRange.vue2.js.map +1 -0
  58. package/dist/martyrs/src/modules/core/views/components/sections/filters/FilterOptions.vue.js +46 -0
  59. package/dist/martyrs/src/modules/core/views/components/sections/filters/FilterOptions.vue.js.map +1 -0
  60. package/dist/martyrs/src/modules/core/views/components/sections/filters/FilterRange.vue.js +105 -0
  61. package/dist/martyrs/src/modules/core/views/components/sections/filters/FilterRange.vue.js.map +1 -0
  62. package/dist/martyrs/src/modules/core/views/components/sections/filters/FiltersGroup.vue.js +168 -0
  63. package/dist/martyrs/src/modules/core/views/components/sections/filters/FiltersGroup.vue.js.map +1 -0
  64. package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js +4 -0
  65. package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js.map +1 -1
  66. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +4 -4
  67. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  68. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +5 -3
  69. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js.map +1 -1
  70. package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
  71. package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
  72. package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
  73. package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
  74. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
  75. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +1 -1
  76. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +1 -1
  77. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
  78. package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
  79. package/dist/martyrs/src/modules/marketplace/views/components/layouts/Marketplace.vue.js +159 -239
  80. package/dist/martyrs/src/modules/marketplace/views/components/layouts/Marketplace.vue.js.map +1 -1
  81. package/dist/martyrs/src/modules/marketplace/views/components/pages/Catalog.vue.js +5 -6
  82. package/dist/martyrs/src/modules/marketplace/views/components/pages/Catalog.vue.js.map +1 -1
  83. package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
  84. package/dist/martyrs/src/modules/marketplace/views/store/marketplace.js +65 -2
  85. package/dist/martyrs/src/modules/marketplace/views/store/marketplace.js.map +1 -1
  86. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +1 -1
  87. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +2 -2
  88. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
  89. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +1 -1
  90. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
  91. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
  92. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
  93. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
  94. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
  95. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
  96. package/dist/martyrs/src/modules/notifications/components/pages/Notifications.vue.js +1 -1
  97. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
  98. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +1 -1
  99. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -1
  100. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  101. package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +1 -1
  102. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +5 -3
  103. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js.map +1 -1
  104. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  105. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +4 -4
  106. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js.map +1 -1
  107. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +2 -2
  108. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
  109. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
  110. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  111. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +2 -2
  112. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  113. package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  114. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  115. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  116. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  117. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +2 -2
  118. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  119. package/dist/martyrs/src/modules/products/components/elements/Image360.vue.js +1 -1
  120. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
  121. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +5 -3
  122. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
  123. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +2 -2
  124. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +4 -4
  125. package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.js +1 -1
  126. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +4 -4
  127. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
  128. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +1 -1
  129. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +2 -2
  130. package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  131. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  132. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
  133. package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +1 -1
  134. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
  135. package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
  136. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +2 -2
  137. package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
  138. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
  139. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +1 -1
  140. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +1 -1
  141. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +1 -1
  142. package/dist/martyrs.css +1 -1
  143. package/dist/martyrs.es.js +1 -1
  144. package/dist/organizations.server.js +7 -2
  145. package/dist/style.css +10 -1
  146. package/dist/{web-Cyc6i_pv.js → web-Cq5tyhkl.js} +1 -1
  147. package/package.json +1 -1
  148. package/src/components/Button/Button.vue +1 -1
  149. package/src/components/Checkbox/Checkbox.vue +1 -1
  150. package/src/modules/core/views/components/layouts/Client.vue +7 -11
  151. package/src/modules/core/views/components/partials/Header.vue +1 -1
  152. package/src/modules/core/views/components/sections/Filters.vue +47 -161
  153. package/src/modules/core/views/components/sections/filters/FilterCheckbox.vue +12 -31
  154. package/src/modules/core/views/components/sections/filters/FilterDateRange.vue +15 -15
  155. package/src/modules/core/views/components/sections/filters/FilterOptions.vue +12 -43
  156. package/src/modules/core/views/components/sections/filters/FilterRange.vue +59 -36
  157. package/src/modules/core/views/components/sections/filters/FiltersGroup.vue +178 -0
  158. package/src/modules/core/views/utils/vue-app-renderer.js +12 -0
  159. package/src/modules/marketplace/controllers/marketplace.controller.js +123 -0
  160. package/src/modules/marketplace/controllers/utils/lookupConfigs.js +130 -0
  161. package/src/modules/marketplace/controllers/utils/queryProcessorMarketplace.js +211 -0
  162. package/src/modules/marketplace/marketplace.server.js +22 -0
  163. package/src/modules/marketplace/routes/marketplace.routes.js +34 -0
  164. package/src/modules/marketplace/views/components/layouts/Marketplace.vue +194 -275
  165. package/src/modules/marketplace/views/components/pages/Catalog.vue +6 -5
  166. package/src/modules/marketplace/views/router/marketplace.router.js +43 -28
  167. package/src/modules/marketplace/views/store/marketplace.js +74 -3
  168. package/src/modules/organizations/components/blocks/CardOrganization.vue +8 -8
  169. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  170. package/src/modules/organizations/controllers/utils/queryProcessorOrganizations.js +8 -1
  171. package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +0 -1
  172. package/dist/martyrs/src/components/Field/Field.vue.js.map +0 -1
  173. package/dist/martyrs/src/components/Loader/Loader.vue.js.map +0 -1
  174. package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +0 -1
  175. package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue2.js.map +0 -1
  176. package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +0 -1
  177. package/dist/martyrs/src/components/Tab/Tab.vue.js.map +0 -1
  178. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +0 -1
  179. package/src/modules/core/views/components/sections/filters/FilterPrice.vue +0 -81
@@ -0,0 +1,64 @@
1
+ import { mergeModels, useModel, computed, createElementBlock, openBlock, Fragment, renderList, createBlock } from "vue";
2
+ import _sfc_main$1 from "../../../../../../components/Checkbox/Checkbox.vue.js";
3
+ /* empty css */
4
+ import _export_sfc from "../../../../../../../../_virtual/_plugin-vue_export-helper.js";
5
+ const _hoisted_1 = { class: "filter-checkbox" };
6
+ const _sfc_main = {
7
+ __name: "FilterCheckbox",
8
+ props: /* @__PURE__ */ mergeModels({
9
+ options: {
10
+ type: Array,
11
+ required: true
12
+ }
13
+ }, {
14
+ "modelValue": {
15
+ type: Array,
16
+ default: () => []
17
+ },
18
+ "modelModifiers": {}
19
+ }),
20
+ emits: /* @__PURE__ */ mergeModels(["apply"], ["update:modelValue"]),
21
+ setup(__props, { emit: __emit }) {
22
+ const props = __props;
23
+ const model = useModel(__props, "modelValue");
24
+ const emit = __emit;
25
+ const normalizedOptions = computed(() => {
26
+ if (!props.options || !Array.isArray(props.options)) return [];
27
+ return props.options.map((option, index) => {
28
+ if (typeof option === "string") {
29
+ return { label: option, value: option };
30
+ }
31
+ if (typeof option === "object" && option !== null) {
32
+ return {
33
+ label: option.label || option.text || option.name || String(option.value || option),
34
+ value: option.value || option.text || option.label || option._id || option.id || `option-${index}`
35
+ };
36
+ }
37
+ return { label: String(option), value: `option-${index}` };
38
+ });
39
+ });
40
+ return (_ctx, _cache) => {
41
+ return openBlock(), createElementBlock("div", _hoisted_1, [
42
+ (openBlock(true), createElementBlock(Fragment, null, renderList(normalizedOptions.value, (option, index) => {
43
+ return openBlock(), createBlock(_sfc_main$1, {
44
+ key: option.value,
45
+ radio: model.value,
46
+ "onUpdate:radio": [
47
+ _cache[0] || (_cache[0] = ($event) => model.value = $event),
48
+ _cache[1] || (_cache[1] = ($event) => emit("apply"))
49
+ ],
50
+ label: option.label,
51
+ value: option.value,
52
+ mode: "checkbox",
53
+ class: "br-solid br-1px br-light pd-small radius-small mn-b-micro"
54
+ }, null, 8, ["radio", "label", "value"]);
55
+ }), 128))
56
+ ]);
57
+ };
58
+ }
59
+ };
60
+ const FilterCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d3175613"]]);
61
+ export {
62
+ FilterCheckbox as default
63
+ };
64
+ //# sourceMappingURL=FilterCheckbox.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterCheckbox.vue2.js","sources":["../../../../../../../../../src/modules/core/views/components/sections/filters/FilterCheckbox.vue"],"sourcesContent":["<!-- FilterCheckbox.vue -->\n<template>\n <div class=\"filter-checkbox\">\n <Checkbox\n v-for=\"(option, index) in normalizedOptions\"\n :key=\"option.value\"\n v-model:radio=\"model\"\n :label=\"option.label\"\n :value=\"option.value\"\n mode=\"checkbox\"\n class=\"br-solid br-1px br-light pd-small radius-small mn-b-micro\"\n @update:radio=\"emit('apply')\"\n />\n </div>\n</template>\n\n<script setup>\nimport { computed } from 'vue'\nimport Checkbox from '@martyrs/src/components/Checkbox/Checkbox.vue'\n\nconst props = defineProps({\n options: {\n type: Array,\n required: true\n }\n})\n\nconst model = defineModel({\n type: Array,\n default: () => []\n})\n\nconst emit = defineEmits(['apply'])\n\n// Normalize options to always have label and value\nconst normalizedOptions = computed(() => {\n if (!props.options || !Array.isArray(props.options)) return []\n\n return props.options.map((option, index) => {\n if (typeof option === 'string') {\n return { label: option, value: option }\n }\n if (typeof option === 'object' && option !== null) {\n return {\n label: option.label || option.text || option.name || String(option.value || option),\n value: option.value || option.text || option.label || option._id || option.id || `option-${index}`\n }\n }\n return { label: String(option), value: `option-${index}` }\n })\n})\n</script>\n\n<style scoped>\n.filter-checkbox {\n max-height: 300px;\n overflow-y: auto;\n}\n</style>"],"names":["_useModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,UAAM,QAAQ;AAOd,UAAM,QAAQA,SAAW,SAAA,YAGxB;AAED,UAAM,OAAO;AAGb,UAAM,oBAAoB,SAAS,MAAM;AACvC,UAAI,CAAC,MAAM,WAAW,CAAC,MAAM,QAAQ,MAAM,OAAO,EAAG,QAAO,CAAA;AAE5D,aAAO,MAAM,QAAQ,IAAI,CAAC,QAAQ,UAAU;AAC1C,YAAI,OAAO,WAAW,UAAU;AAC9B,iBAAO,EAAE,OAAO,QAAQ,OAAO,OAAM;AAAA,QACvC;AACA,YAAI,OAAO,WAAW,YAAY,WAAW,MAAM;AACjD,iBAAO;AAAA,YACL,OAAO,OAAO,SAAS,OAAO,QAAQ,OAAO,QAAQ,OAAO,OAAO,SAAS,MAAM;AAAA,YAClF,OAAO,OAAO,SAAS,OAAO,QAAQ,OAAO,SAAS,OAAO,OAAO,OAAO,MAAM,UAAU,KAAK;AAAA,UACxG;AAAA,QACI;AACA,eAAO,EAAE,OAAO,OAAO,MAAM,GAAG,OAAO,UAAU,KAAK,GAAE;AAAA,MAC1D,CAAC;AAAA,IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,160 @@
1
+ import { mergeModels, useModel, ref, computed, watch, createElementBlock, openBlock, createCommentVNode, createElementVNode, createVNode, Fragment, renderList, normalizeClass, toDisplayString, withCtx } from "vue";
2
+ import Calendar from "../../../../../../components/Calendar/Calendar.vue2.js";
3
+ import _sfc_main$2 from "../../../../../../components/Popup/Popup.vue.js";
4
+ import _sfc_main$1 from "../../../../../icons/entities/IconCalendar.vue.js";
5
+ import { useGlobalMixins } from "../../../mixins/mixins.js";
6
+ /* empty css */
7
+ import _export_sfc from "../../../../../../../../_virtual/_plugin-vue_export-helper.js";
8
+ const _hoisted_1 = { class: "filter-date-range" };
9
+ const _hoisted_2 = ["onClick"];
10
+ const _hoisted_3 = { class: "flex gap-small" };
11
+ const _sfc_main = {
12
+ __name: "FilterDateRange",
13
+ props: /* @__PURE__ */ mergeModels({
14
+ dateOptions: {
15
+ type: Array,
16
+ default: () => []
17
+ }
18
+ }, {
19
+ "modelValue": {
20
+ type: Object,
21
+ default: () => null
22
+ },
23
+ "modelModifiers": {}
24
+ }),
25
+ emits: /* @__PURE__ */ mergeModels(["update:modelValue", "apply"], ["update:modelValue"]),
26
+ setup(__props, { emit: __emit }) {
27
+ const { formatDate } = useGlobalMixins();
28
+ const model = useModel(__props, "modelValue");
29
+ const emit = __emit;
30
+ const showCalendar = ref(false);
31
+ const selectedOption = ref(null);
32
+ const tempDates = ref(null);
33
+ const dateRangeLabel = computed(() => {
34
+ if (!model.value || !model.value.start || !model.value.end) {
35
+ return "Select dates";
36
+ }
37
+ const start = formatDate(model.value.start, { dayMonth: true, language: "en" });
38
+ const end = formatDate(model.value.end, { dayMonth: true, language: "en" });
39
+ return `${start} - ${end}`;
40
+ });
41
+ const selectOption = (value) => {
42
+ selectedOption.value = value;
43
+ const today = /* @__PURE__ */ new Date();
44
+ today.setHours(0, 0, 0, 0);
45
+ let dateRange = null;
46
+ switch (value) {
47
+ case "today":
48
+ dateRange = {
49
+ start: today,
50
+ end: today
51
+ };
52
+ break;
53
+ case "week":
54
+ const weekEnd = new Date(today);
55
+ weekEnd.setDate(today.getDate() + 7);
56
+ dateRange = {
57
+ start: today,
58
+ end: weekEnd
59
+ };
60
+ break;
61
+ case "month":
62
+ const monthEnd = new Date(today);
63
+ monthEnd.setMonth(today.getMonth() + 1);
64
+ dateRange = {
65
+ start: today,
66
+ end: monthEnd
67
+ };
68
+ break;
69
+ }
70
+ if (dateRange) {
71
+ model.value = dateRange;
72
+ emit("apply");
73
+ }
74
+ };
75
+ const applyDates = () => {
76
+ if (tempDates.value) {
77
+ model.value = tempDates.value;
78
+ selectedOption.value = "custom";
79
+ emit("apply");
80
+ }
81
+ showCalendar.value = false;
82
+ };
83
+ watch(() => model.value, (newVal) => {
84
+ if (newVal && newVal.start && newVal.end) {
85
+ tempDates.value = { ...newVal };
86
+ const today = /* @__PURE__ */ new Date();
87
+ today.setHours(0, 0, 0, 0);
88
+ const start = new Date(newVal.start);
89
+ start.setHours(0, 0, 0, 0);
90
+ const end = new Date(newVal.end);
91
+ end.setHours(0, 0, 0, 0);
92
+ const diffDays = Math.round((end - start) / (1e3 * 60 * 60 * 24));
93
+ if (start.getTime() === today.getTime() && end.getTime() === today.getTime()) {
94
+ selectedOption.value = "today";
95
+ } else if (start.getTime() === today.getTime() && diffDays === 7) {
96
+ selectedOption.value = "week";
97
+ } else if (start.getTime() === today.getTime() && diffDays >= 28 && diffDays <= 31) {
98
+ selectedOption.value = "month";
99
+ } else {
100
+ selectedOption.value = "custom";
101
+ }
102
+ } else {
103
+ selectedOption.value = null;
104
+ }
105
+ }, { immediate: true, deep: true });
106
+ return (_ctx, _cache) => {
107
+ return openBlock(), createElementBlock("div", _hoisted_1, [
108
+ __props.dateOptions.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.dateOptions, (option) => {
109
+ return openBlock(), createElementBlock("div", {
110
+ key: option.value,
111
+ onClick: ($event) => selectOption(option.value),
112
+ class: normalizeClass([{ "bg-light": selectedOption.value === option.value }, "pd-small radius-small cursor-pointer hover-bg-light transition-all mn-b-micro"])
113
+ }, toDisplayString(option.label), 11, _hoisted_2);
114
+ }), 128)) : createCommentVNode("", true),
115
+ createElementVNode("div", {
116
+ onClick: _cache[0] || (_cache[0] = () => {
117
+ showCalendar.value = true;
118
+ }),
119
+ class: normalizeClass([{ "bg-light": model.value }, "pd-small field-wrapper radius-small bg-light cursor-pointer hover-bg-light transition-all flex-v-center flex gap-thin"])
120
+ }, [
121
+ createVNode(_sfc_main$1, { class: "i-medium" }),
122
+ createElementVNode("span", null, toDisplayString(dateRangeLabel.value), 1)
123
+ ], 2),
124
+ createVNode(_sfc_main$2, {
125
+ isPopupOpen: showCalendar.value,
126
+ onClosePopup: _cache[3] || (_cache[3] = ($event) => showCalendar.value = false),
127
+ class: "pd-medium bg-white radius-medium",
128
+ style: { "min-width": "350px" }
129
+ }, {
130
+ default: withCtx(() => [
131
+ _cache[4] || (_cache[4] = createElementVNode("h3", { class: "mn-b-medium" }, "Select Date Range", -1)),
132
+ createVNode(Calendar, {
133
+ date: tempDates.value,
134
+ "onUpdate:date": _cache[1] || (_cache[1] = ($event) => tempDates.value = $event),
135
+ allowRange: true,
136
+ disablePastDates: true,
137
+ class: "mn-b-medium"
138
+ }, null, 8, ["date"]),
139
+ createElementVNode("div", _hoisted_3, [
140
+ createElementVNode("button", {
141
+ onClick: applyDates,
142
+ class: "button bg-main t-white flex-child-full pd-small radius-small"
143
+ }, " Apply "),
144
+ createElementVNode("button", {
145
+ onClick: _cache[2] || (_cache[2] = ($event) => showCalendar.value = false),
146
+ class: "button bg-light flex-child-full pd-small radius-small"
147
+ }, " Cancel ")
148
+ ])
149
+ ]),
150
+ _: 1
151
+ }, 8, ["isPopupOpen"])
152
+ ]);
153
+ };
154
+ }
155
+ };
156
+ const FilterDateRange = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dbe77cee"]]);
157
+ export {
158
+ FilterDateRange as default
159
+ };
160
+ //# sourceMappingURL=FilterDateRange.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterDateRange.vue2.js","sources":["../../../../../../../../../src/modules/core/views/components/sections/filters/FilterDateRange.vue"],"sourcesContent":["<!-- FilterDateRange.vue -->\n<template>\n <div class=\"filter-date-range\">\n <!-- Quick options (only if provided) -->\n <div\n v-if=\"dateOptions.length > 0\"\n v-for=\"option in dateOptions\"\n :key=\"option.value\"\n @click=\"selectOption(option.value)\"\n :class=\"{ 'bg-light': selectedOption === option.value }\"\n class=\"pd-small radius-small cursor-pointer hover-bg-light transition-all mn-b-micro\"\n >\n {{ option.label }}\n </div>\n\n <!-- Custom dates with icon (like in Products) -->\n <div\n @click=\"() => { showCalendar = true }\"\n :class=\"{ 'bg-light': model }\"\n class=\"pd-small field-wrapper radius-small bg-light cursor-pointer hover-bg-light transition-all flex-v-center flex gap-thin\"\n >\n <IconCalendar class=\"i-medium\" />\n <span>{{ dateRangeLabel }}</span>\n </div>\n\n <!-- Calendar Popup -->\n <Popup\n :isPopupOpen=\"showCalendar\"\n @close-popup=\"showCalendar = false\"\n class=\"pd-medium bg-white radius-medium\"\n style=\"min-width: 350px;\"\n >\n <h3 class=\"mn-b-medium\">Select Date Range</h3>\n \n <Calendar\n v-model:date=\"tempDates\"\n :allowRange=\"true\"\n :disablePastDates=\"true\"\n class=\"mn-b-medium\"\n />\n \n <div class=\"flex gap-small\">\n <button \n @click=\"applyDates\"\n class=\"button bg-main t-white flex-child-full pd-small radius-small\"\n >\n Apply\n </button>\n <button \n @click=\"showCalendar = false\"\n class=\"button bg-light flex-child-full pd-small radius-small\"\n >\n Cancel\n </button>\n </div>\n </Popup>\n </div>\n</template>\n\n<script setup>\nimport { ref, computed, watch } from 'vue'\nimport Calendar from '@martyrs/src/components/Calendar/Calendar.vue'\nimport Popup from '@martyrs/src/components/Popup/Popup.vue'\nimport IconCalendar from '@martyrs/src/modules/icons/entities/IconCalendar.vue'\nimport { useGlobalMixins } from '@martyrs/src/modules/core/views/mixins/mixins.js'\n\nconst { formatDate } = useGlobalMixins()\n\nconst props = defineProps({\n dateOptions: {\n type: Array,\n default: () => []\n }\n})\n\nconst model = defineModel({\n type: Object,\n default: () => null\n})\n\nconst emit = defineEmits(['update:modelValue', 'apply'])\n\nconst showCalendar = ref(false)\nconst selectedOption = ref(null)\nconst tempDates = ref(null)\n\nconst dateRangeLabel = computed(() => {\n if (!model.value || !model.value.start || !model.value.end) {\n return 'Select dates'\n }\n const start = formatDate(model.value.start, { dayMonth: true, language: 'en' })\n const end = formatDate(model.value.end, { dayMonth: true, language: 'en' })\n return `${start} - ${end}`\n})\n\nconst selectOption = (value) => {\n selectedOption.value = value\n const today = new Date()\n today.setHours(0, 0, 0, 0)\n \n let dateRange = null\n \n switch(value) {\n case 'today':\n dateRange = {\n start: today,\n end: today\n }\n break\n case 'week':\n const weekEnd = new Date(today)\n weekEnd.setDate(today.getDate() + 7)\n dateRange = {\n start: today,\n end: weekEnd\n }\n break\n case 'month':\n const monthEnd = new Date(today)\n monthEnd.setMonth(today.getMonth() + 1)\n dateRange = {\n start: today,\n end: monthEnd\n }\n break\n }\n \n if (dateRange) {\n model.value = dateRange\n emit('apply')\n }\n}\n\nconst applyDates = () => {\n if (tempDates.value) {\n model.value = tempDates.value\n selectedOption.value = 'custom'\n emit('apply')\n }\n showCalendar.value = false\n}\n\n// Watch for model changes to update selected option\nwatch(() => model.value, (newVal) => {\n if (newVal && newVal.start && newVal.end) {\n tempDates.value = { ...newVal }\n \n // Determine which option is selected based on dates\n const today = new Date()\n today.setHours(0, 0, 0, 0)\n const start = new Date(newVal.start)\n start.setHours(0, 0, 0, 0)\n const end = new Date(newVal.end)\n end.setHours(0, 0, 0, 0)\n \n const diffDays = Math.round((end - start) / (1000 * 60 * 60 * 24))\n \n if (start.getTime() === today.getTime() && end.getTime() === today.getTime()) {\n selectedOption.value = 'today'\n } else if (start.getTime() === today.getTime() && diffDays === 7) {\n selectedOption.value = 'week'\n } else if (start.getTime() === today.getTime() && diffDays >= 28 && diffDays <= 31) {\n selectedOption.value = 'month'\n } else {\n selectedOption.value = 'custom'\n }\n } else {\n selectedOption.value = null\n }\n}, { immediate: true, deep: true })\n</script>\n\n<style scoped>\n.filter-date-range {\n width: 100%;\n}\n</style>"],"names":["_useModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,UAAM,EAAE,WAAU,IAAK,gBAAe;AAStC,UAAM,QAAQA,SAAW,SAAA,YAGxB;AAED,UAAM,OAAO;AAEb,UAAM,eAAe,IAAI,KAAK;AAC9B,UAAM,iBAAiB,IAAI,IAAI;AAC/B,UAAM,YAAY,IAAI,IAAI;AAE1B,UAAM,iBAAiB,SAAS,MAAM;AACpC,UAAI,CAAC,MAAM,SAAS,CAAC,MAAM,MAAM,SAAS,CAAC,MAAM,MAAM,KAAK;AAC1D,eAAO;AAAA,MACT;AACA,YAAM,QAAQ,WAAW,MAAM,MAAM,OAAO,EAAE,UAAU,MAAM,UAAU,KAAI,CAAE;AAC9E,YAAM,MAAM,WAAW,MAAM,MAAM,KAAK,EAAE,UAAU,MAAM,UAAU,KAAI,CAAE;AAC1E,aAAO,GAAG,KAAK,MAAM,GAAG;AAAA,IAC1B,CAAC;AAED,UAAM,eAAe,CAAC,UAAU;AAC9B,qBAAe,QAAQ;AACvB,YAAM,QAAQ,oBAAI,KAAI;AACtB,YAAM,SAAS,GAAG,GAAG,GAAG,CAAC;AAEzB,UAAI,YAAY;AAEhB,cAAO,OAAK;AAAA,QACV,KAAK;AACH,sBAAY;AAAA,YACV,OAAO;AAAA,YACP,KAAK;AAAA,UACb;AACM;AAAA,QACF,KAAK;AACH,gBAAM,UAAU,IAAI,KAAK,KAAK;AAC9B,kBAAQ,QAAQ,MAAM,QAAO,IAAK,CAAC;AACnC,sBAAY;AAAA,YACV,OAAO;AAAA,YACP,KAAK;AAAA,UACb;AACM;AAAA,QACF,KAAK;AACH,gBAAM,WAAW,IAAI,KAAK,KAAK;AAC/B,mBAAS,SAAS,MAAM,SAAQ,IAAK,CAAC;AACtC,sBAAY;AAAA,YACV,OAAO;AAAA,YACP,KAAK;AAAA,UACb;AACM;AAAA,MACN;AAEE,UAAI,WAAW;AACb,cAAM,QAAQ;AACd,aAAK,OAAO;AAAA,MACd;AAAA,IACF;AAEA,UAAM,aAAa,MAAM;AACvB,UAAI,UAAU,OAAO;AACnB,cAAM,QAAQ,UAAU;AACxB,uBAAe,QAAQ;AACvB,aAAK,OAAO;AAAA,MACd;AACA,mBAAa,QAAQ;AAAA,IACvB;AAGA,UAAM,MAAM,MAAM,OAAO,CAAC,WAAW;AACnC,UAAI,UAAU,OAAO,SAAS,OAAO,KAAK;AACxC,kBAAU,QAAQ,EAAE,GAAG,OAAM;AAG7B,cAAM,QAAQ,oBAAI,KAAI;AACtB,cAAM,SAAS,GAAG,GAAG,GAAG,CAAC;AACzB,cAAM,QAAQ,IAAI,KAAK,OAAO,KAAK;AACnC,cAAM,SAAS,GAAG,GAAG,GAAG,CAAC;AACzB,cAAM,MAAM,IAAI,KAAK,OAAO,GAAG;AAC/B,YAAI,SAAS,GAAG,GAAG,GAAG,CAAC;AAEvB,cAAM,WAAW,KAAK,OAAO,MAAM,UAAU,MAAO,KAAK,KAAK,GAAG;AAEjE,YAAI,MAAM,cAAc,MAAM,QAAO,KAAM,IAAI,QAAO,MAAO,MAAM,WAAW;AAC5E,yBAAe,QAAQ;AAAA,QACzB,WAAW,MAAM,QAAO,MAAO,MAAM,QAAO,KAAM,aAAa,GAAG;AAChE,yBAAe,QAAQ;AAAA,QACzB,WAAW,MAAM,QAAO,MAAO,MAAM,QAAO,KAAM,YAAY,MAAM,YAAY,IAAI;AAClF,yBAAe,QAAQ;AAAA,QACzB,OAAO;AACL,yBAAe,QAAQ;AAAA,QACzB;AAAA,MACF,OAAO;AACL,uBAAe,QAAQ;AAAA,MACzB;AAAA,IACF,GAAG,EAAE,WAAW,MAAM,MAAM,KAAI,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,46 @@
1
+ import { mergeModels, useModel, createElementBlock, openBlock, Fragment, renderList, createBlock } from "vue";
2
+ import _sfc_main$1 from "../../../../../../components/Checkbox/Checkbox.vue.js";
3
+ const _hoisted_1 = { class: "filter-options" };
4
+ const _sfc_main = {
5
+ __name: "FilterOptions",
6
+ props: /* @__PURE__ */ mergeModels({
7
+ options: {
8
+ type: Array,
9
+ required: true,
10
+ default: () => []
11
+ }
12
+ }, {
13
+ "modelValue": {
14
+ type: String,
15
+ default: null
16
+ },
17
+ "modelModifiers": {}
18
+ }),
19
+ emits: /* @__PURE__ */ mergeModels(["apply"], ["update:modelValue"]),
20
+ setup(__props, { emit: __emit }) {
21
+ const model = useModel(__props, "modelValue");
22
+ const emit = __emit;
23
+ return (_ctx, _cache) => {
24
+ return openBlock(), createElementBlock("div", _hoisted_1, [
25
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
26
+ return openBlock(), createBlock(_sfc_main$1, {
27
+ key: option.value,
28
+ radio: model.value,
29
+ "onUpdate:radio": [
30
+ _cache[0] || (_cache[0] = ($event) => model.value = $event),
31
+ _cache[1] || (_cache[1] = ($event) => emit("apply"))
32
+ ],
33
+ label: option.label,
34
+ value: option.value,
35
+ mode: "radio",
36
+ class: "mn-b-micro"
37
+ }, null, 8, ["radio", "label", "value"]);
38
+ }), 128))
39
+ ]);
40
+ };
41
+ }
42
+ };
43
+ export {
44
+ _sfc_main as default
45
+ };
46
+ //# sourceMappingURL=FilterOptions.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterOptions.vue.js","sources":["../../../../../../../../../src/modules/core/views/components/sections/filters/FilterOptions.vue"],"sourcesContent":["<!-- filters/FilterOptions.vue -->\n<template>\n <div class=\"filter-options\">\n <Checkbox\n v-for=\"option in options\"\n :key=\"option.value\"\n v-model:radio=\"model\"\n :label=\"option.label\"\n :value=\"option.value\"\n mode=\"radio\"\n class=\"mn-b-micro\"\n @update:radio=\"emit('apply')\"\n />\n </div>\n</template>\n\n<script setup>\nimport Checkbox from '@martyrs/src/components/Checkbox/Checkbox.vue'\n\nconst props = defineProps({\n options: {\n type: Array,\n required: true,\n default: () => []\n }\n})\n\nconst model = defineModel({\n type: String,\n default: null\n})\n\nconst emit = defineEmits(['apply'])\n</script>"],"names":["_useModel"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,UAAM,QAAQA,SAAW,SAAA,YAGxB;AAED,UAAM,OAAO;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,105 @@
1
+ import { mergeModels, useModel, ref, watch, createElementBlock, openBlock, createElementVNode, createCommentVNode, createVNode, Fragment, renderList, normalizeClass, toDisplayString } from "vue";
2
+ import Field from "../../../../../../components/Field/Field.vue2.js";
3
+ const _hoisted_1 = { class: "filter-price" };
4
+ const _hoisted_2 = { class: "flex flex-v-center gap-thin" };
5
+ const _hoisted_3 = {
6
+ key: 0,
7
+ class: "mt-thin"
8
+ };
9
+ const _hoisted_4 = ["onClick"];
10
+ const _sfc_main = {
11
+ __name: "FilterRange",
12
+ props: /* @__PURE__ */ mergeModels({
13
+ config: {
14
+ type: Object,
15
+ default: () => ({})
16
+ },
17
+ minPlaceholder: {
18
+ type: String,
19
+ default: "Min"
20
+ },
21
+ maxPlaceholder: {
22
+ type: String,
23
+ default: "Max"
24
+ },
25
+ label: {
26
+ type: String,
27
+ default: void 0
28
+ }
29
+ }, {
30
+ "modelValue": {
31
+ type: Object,
32
+ default: () => ({ min: null, max: null })
33
+ },
34
+ "modelModifiers": {}
35
+ }),
36
+ emits: /* @__PURE__ */ mergeModels(["update:modelValue", "apply"], ["update:modelValue"]),
37
+ setup(__props, { emit: __emit }) {
38
+ const model = useModel(__props, "modelValue");
39
+ const emit = __emit;
40
+ const localValue = ref({
41
+ min: model.value?.min || null,
42
+ max: model.value?.max || null
43
+ });
44
+ watch(model, (val) => {
45
+ if (val) {
46
+ localValue.value = {
47
+ min: val.min || null,
48
+ max: val.max || null
49
+ };
50
+ }
51
+ }, { deep: true });
52
+ const updateValue = () => {
53
+ model.value = { ...localValue.value };
54
+ emit("apply");
55
+ };
56
+ const applyPreset = (preset) => {
57
+ localValue.value = {
58
+ min: preset.min || null,
59
+ max: preset.max || null
60
+ };
61
+ updateValue();
62
+ };
63
+ const isPresetActive = (preset) => {
64
+ return localValue.value.min === preset.min && localValue.value.max === preset.max;
65
+ };
66
+ return (_ctx, _cache) => {
67
+ return openBlock(), createElementBlock("div", _hoisted_1, [
68
+ createElementVNode("div", _hoisted_2, [
69
+ createVNode(Field, {
70
+ type: "number",
71
+ field: localValue.value.min,
72
+ "onUpdate:field": _cache[0] || (_cache[0] = ($event) => localValue.value.min = $event),
73
+ placeholder: __props.minPlaceholder,
74
+ label: __props.label,
75
+ class: "flex-1 bg-light pd-regular radius-small",
76
+ onBlur: updateValue
77
+ }, null, 8, ["field", "placeholder", "label"]),
78
+ _cache[2] || (_cache[2] = createElementVNode("span", { class: "t-small" }, "—", -1)),
79
+ createVNode(Field, {
80
+ type: "number",
81
+ field: localValue.value.max,
82
+ "onUpdate:field": _cache[1] || (_cache[1] = ($event) => localValue.value.max = $event),
83
+ placeholder: __props.maxPlaceholder,
84
+ label: __props.label,
85
+ class: "flex-1 bg-light pd-regular radius-small",
86
+ onBlur: updateValue
87
+ }, null, 8, ["field", "placeholder", "label"])
88
+ ]),
89
+ __props.config?.presets ? (openBlock(), createElementBlock("div", _hoisted_3, [
90
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.config.presets, (preset) => {
91
+ return openBlock(), createElementBlock("button", {
92
+ key: preset.label,
93
+ onClick: ($event) => applyPreset(preset),
94
+ class: normalizeClass(["btn btn-small mr-thin mb-thin", isPresetActive(preset) ? "btn-primary" : "btn-secondary"])
95
+ }, toDisplayString(preset.label), 11, _hoisted_4);
96
+ }), 128))
97
+ ])) : createCommentVNode("", true)
98
+ ]);
99
+ };
100
+ }
101
+ };
102
+ export {
103
+ _sfc_main as default
104
+ };
105
+ //# sourceMappingURL=FilterRange.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterRange.vue.js","sources":["../../../../../../../../../src/modules/core/views/components/sections/filters/FilterRange.vue"],"sourcesContent":["<!-- filters/FilterPrice.vue -->\n<template>\n <div class=\"filter-price\">\n <div class=\"flex flex-v-center gap-thin\">\n <Field\n type=\"number\"\n v-model:field=\"localValue.min\"\n :placeholder=\"minPlaceholder\"\n :label=\"label\"\n class=\"flex-1 bg-light pd-regular radius-small\"\n @blur=\"updateValue\"\n />\n <span class=\"t-small\">—</span>\n <Field\n type=\"number\"\n v-model:field=\"localValue.max\"\n :placeholder=\"maxPlaceholder\"\n :label=\"label\"\n class=\"flex-1 bg-light pd-regular radius-small\"\n @blur=\"updateValue\"\n />\n </div>\n \n <div v-if=\"config?.presets\" class=\"mt-thin\">\n <button\n v-for=\"preset in config.presets\"\n :key=\"preset.label\"\n @click=\"applyPreset(preset)\"\n class=\"btn btn-small mr-thin mb-thin\"\n :class=\"isPresetActive(preset) ? 'btn-primary' : 'btn-secondary'\"\n >\n {{ preset.label }}\n </button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, watch } from 'vue'\nimport Field from '@martyrs/src/components/Field/Field.vue';\n\nconst props = defineProps({\n config: {\n type: Object,\n default: () => ({})\n },\n minPlaceholder: {\n type: String,\n default: 'Min'\n },\n maxPlaceholder: {\n type: String,\n default: 'Max'\n },\n label: {\n type: String,\n default: undefined\n }\n})\n\nconst model = defineModel({\n type: Object,\n default: () => ({ min: null, max: null })\n})\n\nconst emit = defineEmits(['update:modelValue', 'apply'])\n\nconst localValue = ref({ \n min: model.value?.min || null, \n max: model.value?.max || null \n})\n\nwatch(model, (val) => {\n if (val) {\n localValue.value = { \n min: val.min || null, \n max: val.max || null \n }\n }\n}, { deep: true })\n\nconst updateValue = () => {\n model.value = { ...localValue.value }\n emit('apply')\n}\n\nconst applyPreset = (preset) => {\n localValue.value = { \n min: preset.min || null, \n max: preset.max || null \n }\n updateValue()\n}\n\nconst isPresetActive = (preset) => {\n return localValue.value.min === preset.min && localValue.value.max === preset.max\n}\n</script>"],"names":["_useModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,UAAM,QAAQA,SAAW,SAAA,YAGxB;AAED,UAAM,OAAO;AAEb,UAAM,aAAa,IAAI;AAAA,MACrB,KAAK,MAAM,OAAO,OAAO;AAAA,MACzB,KAAK,MAAM,OAAO,OAAO;AAAA,IAC3B,CAAC;AAED,UAAM,OAAO,CAAC,QAAQ;AACpB,UAAI,KAAK;AACP,mBAAW,QAAQ;AAAA,UACjB,KAAK,IAAI,OAAO;AAAA,UAChB,KAAK,IAAI,OAAO;AAAA,QACtB;AAAA,MACE;AAAA,IACF,GAAG,EAAE,MAAM,KAAI,CAAE;AAEjB,UAAM,cAAc,MAAM;AACxB,YAAM,QAAQ,EAAE,GAAG,WAAW,MAAK;AACnC,WAAK,OAAO;AAAA,IACd;AAEA,UAAM,cAAc,CAAC,WAAW;AAC9B,iBAAW,QAAQ;AAAA,QACjB,KAAK,OAAO,OAAO;AAAA,QACnB,KAAK,OAAO,OAAO;AAAA,MACvB;AACE,kBAAW;AAAA,IACb;AAEA,UAAM,iBAAiB,CAAC,WAAW;AACjC,aAAO,WAAW,MAAM,QAAQ,OAAO,OAAO,WAAW,MAAM,QAAQ,OAAO;AAAA,IAChF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,168 @@
1
+ import { mergeModels, useModel, reactive, watch, createElementBlock, openBlock, createCommentVNode, createElementVNode, Fragment, renderList, createBlock, toDisplayString, normalizeClass } from "vue";
2
+ import { useGlobalMixins } from "../../../mixins/mixins.js";
3
+ import FilterCheckbox from "./FilterCheckbox.vue2.js";
4
+ import _sfc_main$1 from "./FilterRange.vue.js";
5
+ import FilterDateRange from "./FilterDateRange.vue2.js";
6
+ import _sfc_main$2 from "./FilterOptions.vue.js";
7
+ const _hoisted_1 = {
8
+ key: 0,
9
+ class: "flex-v-center flex-nowrap flex mn-b-medium"
10
+ };
11
+ const _hoisted_2 = { class: "filters-content" };
12
+ const _hoisted_3 = { class: "mn-b-small" };
13
+ const _hoisted_4 = { class: "flex gap-thin mn-t-medium" };
14
+ const _sfc_main = {
15
+ __name: "FiltersGroup",
16
+ props: /* @__PURE__ */ mergeModels({
17
+ filters: {
18
+ type: Array,
19
+ required: true
20
+ },
21
+ immediate: {
22
+ type: Boolean,
23
+ default: false
24
+ },
25
+ showHeader: {
26
+ type: Boolean,
27
+ default: true
28
+ },
29
+ showApplyButton: {
30
+ type: Boolean,
31
+ default: false
32
+ },
33
+ showResetButton: {
34
+ type: Boolean,
35
+ default: true
36
+ }
37
+ }, {
38
+ "selected": {
39
+ type: Object,
40
+ default: () => ({})
41
+ },
42
+ "selectedModifiers": {}
43
+ }),
44
+ emits: ["update:selected"],
45
+ setup(__props) {
46
+ const props = __props;
47
+ const selected = useModel(__props, "selected");
48
+ const { returnCurrency } = useGlobalMixins();
49
+ const workingValues = reactive({});
50
+ watch(() => props.filters, (newFilters) => {
51
+ newFilters.forEach((filter) => {
52
+ if (!workingValues[filter.value]) {
53
+ if (filter.type === "checkbox") {
54
+ workingValues[filter.value] = [...selected.value[filter.value] || []];
55
+ } else if (filter.type === "range") {
56
+ workingValues[filter.value] = { ...selected.value[filter.value] || { min: "", max: "" } };
57
+ } else if (filter.type === "date") {
58
+ workingValues[filter.value] = selected.value[filter.value] || null;
59
+ } else {
60
+ workingValues[filter.value] = selected.value[filter.value] || null;
61
+ }
62
+ }
63
+ });
64
+ }, { immediate: true, deep: true });
65
+ watch(selected, (newValue) => {
66
+ Object.keys(newValue).forEach((key) => {
67
+ const filter = props.filters.find((f) => f.value === key);
68
+ if (filter) {
69
+ if (filter.type === "checkbox") {
70
+ workingValues[key] = [...newValue[key] || []];
71
+ } else if (filter.type === "range") {
72
+ workingValues[key] = { ...newValue[key] || { min: "", max: "" } };
73
+ } else {
74
+ workingValues[key] = newValue[key];
75
+ }
76
+ }
77
+ });
78
+ }, { deep: true });
79
+ const handleApply = (filterValue) => {
80
+ if (props.immediate) {
81
+ const updated = { ...selected.value };
82
+ updated[filterValue] = workingValues[filterValue];
83
+ selected.value = updated;
84
+ }
85
+ };
86
+ const applyFilters = () => {
87
+ const updated = {};
88
+ Object.keys(workingValues).forEach((key) => {
89
+ updated[key] = workingValues[key];
90
+ });
91
+ selected.value = updated;
92
+ };
93
+ const resetFilters = () => {
94
+ props.filters.forEach((filter) => {
95
+ if (filter.type === "checkbox") {
96
+ workingValues[filter.value] = [];
97
+ } else if (filter.type === "range") {
98
+ workingValues[filter.value] = { min: "", max: "" };
99
+ } else if (filter.type === "date") {
100
+ workingValues[filter.value] = null;
101
+ } else {
102
+ workingValues[filter.value] = null;
103
+ }
104
+ });
105
+ if (props.immediate) {
106
+ applyFilters();
107
+ }
108
+ };
109
+ return (_ctx, _cache) => {
110
+ return openBlock(), createElementBlock("div", null, [
111
+ __props.showHeader ? (openBlock(), createElementBlock("div", _hoisted_1, _cache[0] || (_cache[0] = [
112
+ createElementVNode("h3", { class: "flex-child-full" }, "Filters", -1)
113
+ ]))) : createCommentVNode("", true),
114
+ createElementVNode("div", _hoisted_2, [
115
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.filters, (filter) => {
116
+ return openBlock(), createElementBlock("div", {
117
+ key: filter.value,
118
+ class: "mn-b-medium"
119
+ }, [
120
+ createElementVNode("h4", _hoisted_3, toDisplayString(filter.title), 1),
121
+ filter.type === "checkbox" ? (openBlock(), createBlock(FilterCheckbox, {
122
+ key: 0,
123
+ modelValue: workingValues[filter.value],
124
+ "onUpdate:modelValue": ($event) => workingValues[filter.value] = $event,
125
+ options: filter.options,
126
+ onApply: ($event) => handleApply(filter.value)
127
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "onApply"])) : filter.type === "range" ? (openBlock(), createBlock(_sfc_main$1, {
128
+ key: 1,
129
+ modelValue: workingValues[filter.value],
130
+ "onUpdate:modelValue": ($event) => workingValues[filter.value] = $event,
131
+ minPlaceholder: filter.minPlaceholder || "Min",
132
+ maxPlaceholder: filter.maxPlaceholder || "Max",
133
+ label: filter.label,
134
+ onApply: ($event) => handleApply(filter.value)
135
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "minPlaceholder", "maxPlaceholder", "label", "onApply"])) : filter.type === "date" ? (openBlock(), createBlock(FilterDateRange, {
136
+ key: 2,
137
+ modelValue: workingValues[filter.value],
138
+ "onUpdate:modelValue": ($event) => workingValues[filter.value] = $event,
139
+ onApply: ($event) => handleApply(filter.value)
140
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onApply"])) : filter.type === "radio" ? (openBlock(), createBlock(_sfc_main$2, {
141
+ key: 3,
142
+ modelValue: workingValues[filter.value],
143
+ "onUpdate:modelValue": ($event) => workingValues[filter.value] = $event,
144
+ options: filter.options
145
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : createCommentVNode("", true)
146
+ ]);
147
+ }), 128))
148
+ ]),
149
+ createElementVNode("div", _hoisted_4, [
150
+ __props.showApplyButton ? (openBlock(), createElementBlock("button", {
151
+ key: 0,
152
+ onClick: applyFilters,
153
+ class: "button bg-main flex-child-full"
154
+ }, " Apply ")) : createCommentVNode("", true),
155
+ __props.showResetButton ? (openBlock(), createElementBlock("button", {
156
+ key: 1,
157
+ onClick: resetFilters,
158
+ class: normalizeClass(["button bg-light", { "flex-child-full": !__props.showApplyButton }])
159
+ }, " Reset Filters ", 2)) : createCommentVNode("", true)
160
+ ])
161
+ ]);
162
+ };
163
+ }
164
+ };
165
+ export {
166
+ _sfc_main as default
167
+ };
168
+ //# sourceMappingURL=FiltersGroup.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FiltersGroup.vue.js","sources":["../../../../../../../../../src/modules/core/views/components/sections/filters/FiltersGroup.vue"],"sourcesContent":["<template>\n <div>\n <div v-if=\"showHeader\" class=\"flex-v-center flex-nowrap flex mn-b-medium\">\n <h3 class=\"flex-child-full\">Filters</h3>\n </div>\n\n <div class=\"filters-content\">\n <div\n v-for=\"filter in filters\"\n :key=\"filter.value\"\n class=\"mn-b-medium\"\n >\n <h4 class=\"mn-b-small\">{{ filter.title }}</h4>\n\n <!-- Checkbox Filter -->\n <FilterCheckbox\n v-if=\"filter.type === 'checkbox'\"\n v-model=\"workingValues[filter.value]\"\n :options=\"filter.options\"\n @apply=\"handleApply(filter.value)\"\n />\n\n <!-- Range Filter -->\n <FilterRange\n v-else-if=\"filter.type === 'range'\"\n v-model=\"workingValues[filter.value]\"\n :minPlaceholder=\"filter.minPlaceholder || 'Min'\"\n :maxPlaceholder=\"filter.maxPlaceholder || 'Max'\"\n :label=\"filter.label\"\n @apply=\"handleApply(filter.value)\"\n />\n\n <!-- Date Filter -->\n <FilterDateRange\n v-else-if=\"filter.type === 'date'\"\n v-model=\"workingValues[filter.value]\"\n @apply=\"handleApply(filter.value)\"\n />\n\n <!-- Radio/Options Filter -->\n <FilterOptions\n v-else-if=\"filter.type === 'radio'\"\n v-model=\"workingValues[filter.value]\"\n :options=\"filter.options\"\n />\n </div>\n </div>\n\n <div class=\"flex gap-thin mn-t-medium\">\n <button\n v-if=\"showApplyButton\"\n @click=\"applyFilters\"\n class=\"button bg-main flex-child-full\"\n >\n Apply\n </button>\n <button\n v-if=\"showResetButton\"\n @click=\"resetFilters\"\n class=\"button bg-light\"\n :class=\"{ 'flex-child-full': !showApplyButton }\"\n >\n Reset Filters\n </button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, reactive, watch } from 'vue'\nimport { useGlobalMixins } from '@martyrs/src/modules/core/views/mixins/mixins.js'\nimport FilterCheckbox from './FilterCheckbox.vue'\nimport FilterRange from './FilterRange.vue'\nimport FilterDateRange from './FilterDateRange.vue'\nimport FilterOptions from './FilterOptions.vue'\n\nconst props = defineProps({\n filters: {\n type: Array,\n required: true\n },\n immediate: {\n type: Boolean,\n default: false\n },\n showHeader: {\n type: Boolean,\n default: true\n },\n showApplyButton: {\n type: Boolean,\n default: false\n },\n showResetButton: {\n type: Boolean,\n default: true\n }\n})\n\nconst selected = defineModel('selected', {\n type: Object,\n default: () => ({})\n})\n\nconst { returnCurrency } = useGlobalMixins()\n\nconst workingValues = reactive({})\n\n// Initialize working values\nwatch(() => props.filters, (newFilters) => {\n newFilters.forEach(filter => {\n if (!workingValues[filter.value]) {\n if (filter.type === 'checkbox') {\n workingValues[filter.value] = [...(selected.value[filter.value] || [])]\n } else if (filter.type === 'range') {\n workingValues[filter.value] = { ...(selected.value[filter.value] || { min: '', max: '' }) }\n } else if (filter.type === 'date') {\n workingValues[filter.value] = selected.value[filter.value] || null\n } else {\n workingValues[filter.value] = selected.value[filter.value] || null\n }\n }\n })\n}, { immediate: true, deep: true })\n\n// Sync selected to workingValues\nwatch(selected, (newValue) => {\n Object.keys(newValue).forEach(key => {\n const filter = props.filters.find(f => f.value === key)\n if (filter) {\n if (filter.type === 'checkbox') {\n workingValues[key] = [...(newValue[key] || [])]\n } else if (filter.type === 'range') {\n workingValues[key] = { ...(newValue[key] || { min: '', max: '' }) }\n } else {\n workingValues[key] = newValue[key]\n }\n }\n })\n}, { deep: true })\n\nconst handleApply = (filterValue) => {\n if (props.immediate) {\n const updated = { ...selected.value }\n updated[filterValue] = workingValues[filterValue]\n selected.value = updated\n }\n}\n\nconst applyFilters = () => {\n const updated = {}\n Object.keys(workingValues).forEach(key => {\n updated[key] = workingValues[key]\n })\n selected.value = updated\n}\n\nconst resetFilters = () => {\n props.filters.forEach(filter => {\n if (filter.type === 'checkbox') {\n workingValues[filter.value] = []\n } else if (filter.type === 'range') {\n workingValues[filter.value] = { min: '', max: '' }\n } else if (filter.type === 'date') {\n workingValues[filter.value] = null\n } else {\n workingValues[filter.value] = null\n }\n })\n\n if (props.immediate) {\n applyFilters()\n }\n}\n</script>\n\n<style scoped>\n</style>\n"],"names":["_useModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,UAAM,QAAQ;AAuBd,UAAM,WAAWA,SAAW,SAAC,UAG5B;AAED,UAAM,EAAE,eAAc,IAAK,gBAAe;AAE1C,UAAM,gBAAgB,SAAS,CAAA,CAAE;AAGjC,UAAM,MAAM,MAAM,SAAS,CAAC,eAAe;AACzC,iBAAW,QAAQ,YAAU;AAC3B,YAAI,CAAC,cAAc,OAAO,KAAK,GAAG;AAChC,cAAI,OAAO,SAAS,YAAY;AAC9B,0BAAc,OAAO,KAAK,IAAI,CAAC,GAAI,SAAS,MAAM,OAAO,KAAK,KAAK,EAAG;AAAA,UACxE,WAAW,OAAO,SAAS,SAAS;AAClC,0BAAc,OAAO,KAAK,IAAI,EAAE,GAAI,SAAS,MAAM,OAAO,KAAK,KAAK,EAAE,KAAK,IAAI,KAAK,GAAE,EAAG;AAAA,UAC3F,WAAW,OAAO,SAAS,QAAQ;AACjC,0BAAc,OAAO,KAAK,IAAI,SAAS,MAAM,OAAO,KAAK,KAAK;AAAA,UAChE,OAAO;AACL,0BAAc,OAAO,KAAK,IAAI,SAAS,MAAM,OAAO,KAAK,KAAK;AAAA,UAChE;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,GAAG,EAAE,WAAW,MAAM,MAAM,KAAI,CAAE;AAGlC,UAAM,UAAU,CAAC,aAAa;AAC5B,aAAO,KAAK,QAAQ,EAAE,QAAQ,SAAO;AACnC,cAAM,SAAS,MAAM,QAAQ,KAAK,OAAK,EAAE,UAAU,GAAG;AACtD,YAAI,QAAQ;AACV,cAAI,OAAO,SAAS,YAAY;AAC9B,0BAAc,GAAG,IAAI,CAAC,GAAI,SAAS,GAAG,KAAK,EAAG;AAAA,UAChD,WAAW,OAAO,SAAS,SAAS;AAClC,0BAAc,GAAG,IAAI,EAAE,GAAI,SAAS,GAAG,KAAK,EAAE,KAAK,IAAI,KAAK,GAAE,EAAG;AAAA,UACnE,OAAO;AACL,0BAAc,GAAG,IAAI,SAAS,GAAG;AAAA,UACnC;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,GAAG,EAAE,MAAM,KAAI,CAAE;AAEjB,UAAM,cAAc,CAAC,gBAAgB;AACnC,UAAI,MAAM,WAAW;AACnB,cAAM,UAAU,EAAE,GAAG,SAAS,MAAK;AACnC,gBAAQ,WAAW,IAAI,cAAc,WAAW;AAChD,iBAAS,QAAQ;AAAA,MACnB;AAAA,IACF;AAEA,UAAM,eAAe,MAAM;AACzB,YAAM,UAAU,CAAA;AAChB,aAAO,KAAK,aAAa,EAAE,QAAQ,SAAO;AACxC,gBAAQ,GAAG,IAAI,cAAc,GAAG;AAAA,MAClC,CAAC;AACD,eAAS,QAAQ;AAAA,IACnB;AAEA,UAAM,eAAe,MAAM;AACzB,YAAM,QAAQ,QAAQ,YAAU;AAC9B,YAAI,OAAO,SAAS,YAAY;AAC9B,wBAAc,OAAO,KAAK,IAAI,CAAA;AAAA,QAChC,WAAW,OAAO,SAAS,SAAS;AAClC,wBAAc,OAAO,KAAK,IAAI,EAAE,KAAK,IAAI,KAAK,GAAE;AAAA,QAClD,WAAW,OAAO,SAAS,QAAQ;AACjC,wBAAc,OAAO,KAAK,IAAI;AAAA,QAChC,OAAO;AACL,wBAAc,OAAO,KAAK,IAAI;AAAA,QAChC;AAAA,MACF,CAAC;AAED,UAAI,MAAM,WAAW;AACnB,qBAAY;AAAA,MACd;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -75,6 +75,10 @@ function renderAndMountApp({ createApp, hooks = {} }) {
75
75
  await store.auth.actions.logout();
76
76
  }
77
77
  }
78
+ const savedPosition = localStorage.getItem("position");
79
+ if (savedPosition) {
80
+ store.core.state.position = JSON.parse(savedPosition);
81
+ }
78
82
  performance.mark("loading-24-end");
79
83
  performance.measure("loading-24", "loading-24-start", "loading-24-end");
80
84
  const measure24 = performance.getEntriesByName("loading-24")[0];