@ozdao/prometheus-framework 0.2.201 → 0.2.202

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. package/dist/prometheus-framework/src/components/Address/Address.vue.cjs +113 -1
  2. package/dist/prometheus-framework/src/components/Address/Address.vue.cjs.map +1 -0
  3. package/dist/prometheus-framework/src/components/Address/Address.vue.js +76 -51
  4. package/dist/prometheus-framework/src/components/Address/Address.vue.js.map +1 -0
  5. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  6. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +1 -1
  7. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.cjs +169 -1
  8. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.cjs.map +1 -0
  9. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.js +125 -82
  10. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.js.map +1 -0
  11. package/dist/prometheus-framework/src/components/Menu/Menu.vue.cjs +17 -1
  12. package/dist/prometheus-framework/src/components/Menu/Menu.vue.cjs.map +1 -0
  13. package/dist/prometheus-framework/src/components/Menu/Menu.vue.js +11 -7
  14. package/dist/prometheus-framework/src/components/Menu/Menu.vue.js.map +1 -0
  15. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  16. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  17. package/dist/prometheus-framework/src/modules/backoffice/components/partials/Sidebar.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/backoffice/components/partials/Sidebar.vue.js +1 -1
  19. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +1 -1
  21. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  23. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
  31. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  33. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  35. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  37. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +1 -1
  39. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +3 -3
  40. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
  41. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.cjs.map +1 -1
  45. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.js +1 -1
  46. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.js.map +1 -1
  47. package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/globals/views/components/partials/LocationSelection.vue.cjs +2 -2
  50. package/dist/prometheus-framework/src/modules/globals/views/components/partials/LocationSelection.vue.js +2 -2
  51. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  53. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  55. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +2 -2
  56. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  57. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  61. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +2 -2
  62. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +2 -2
  63. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  65. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
  67. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +4 -4
  68. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +4 -4
  69. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +2 -2
  70. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  71. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  73. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  75. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +2 -2
  76. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  77. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +2 -2
  78. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +2 -2
  79. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  81. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  83. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +4 -4
  84. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +4 -4
  85. package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
  87. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  89. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  91. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  93. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +2 -2
  94. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  95. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  97. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  99. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +2 -2
  100. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  101. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
  103. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
  105. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  107. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +4 -4
  108. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +4 -4
  109. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +2 -2
  110. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  111. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +1 -1
  113. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +4 -4
  114. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +4 -4
  115. package/package.json +1 -1
  116. package/src/modules/globals/views/components/layouts/Client.vue +2 -2
@@ -1 +1,113 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");;/* empty css */const h={key:0,class:"t-transp mn-r-small"},v=["placeholder","value"],_={key:0,class:"mn-t-thin invalid-feedback"},k={__name:"Address",props:{apiKey:{type:String,required:!0},label:null,placeholder:"Enter something here",field:null,location:{type:Object,default:{lat:48.6900735,lng:41.1620239}},address:{type:String,default:""},locale:{type:String,default:"en"}},emits:["update:address","update:location","update:country","update:state","update:city"],setup(l,{emit:p}){const c=l,o=p,i=e.ref(null);let d;const m=()=>{const t=d.getPlace();if(!t.geometry||!t.address_components)return;let a="",s="",u="";for(let r=0;r<t.address_components.length;r++){let n=t.address_components[r];n.types.includes("country")&&(a=n.long_name),n.types.includes("administrative_area_level_1")&&(s=n.long_name),n.types.includes("locality")&&(u=n.long_name)}const y=t.formatted_address,g={lat:t.geometry.location.lat(),lng:t.geometry.location.lng()};o("update:address",y),o("update:location",g),o("update:country",a),o("update:state",s),o("update:city",u)};return e.onMounted(()=>{new f.Loader({apiKey:c.apiKey,version:"weekly",libraries:["places"],language:c.locale}).load().then(()=>{d=new google.maps.places.Autocomplete(i.value),d.addListener("place_changed",m)}).catch(a=>{console.error(a)})}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.$attrs.class,"flex-nowrap flex"])},[l.label?(e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("span",null,e.toDisplayString(l.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"addressInput",ref:i,class:"w-100",placeholder:l.placeholder,value:l.address,onInput:a[0]||(a[0]=(...s)=>t.onInput&&t.onInput(...s))},null,40,v),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[t.validation?(e.openBlock(),e.createElementBlock("div",_," * "+e.toDisplayString(t.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],2))}};exports.default=k;
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const index = require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");
5
+ ;/* empty css */
6
+ const _hoisted_1 = {
7
+ key: 0,
8
+ class: "t-transp mn-r-small"
9
+ };
10
+ const _hoisted_2 = ["placeholder", "value"];
11
+ const _hoisted_3 = {
12
+ key: 0,
13
+ class: "mn-t-thin invalid-feedback"
14
+ };
15
+ const _sfc_main = {
16
+ __name: "Address",
17
+ props: {
18
+ apiKey: {
19
+ type: String,
20
+ required: true
21
+ },
22
+ label: null,
23
+ placeholder: "Enter something here",
24
+ field: null,
25
+ location: {
26
+ type: Object,
27
+ default: { lat: 48.6900735, lng: 41.1620239 }
28
+ },
29
+ address: {
30
+ type: String,
31
+ default: ""
32
+ },
33
+ locale: {
34
+ type: String,
35
+ default: "en"
36
+ }
37
+ },
38
+ emits: ["update:address", "update:location", "update:country", "update:state", "update:city"],
39
+ setup(__props, { emit: __emit }) {
40
+ const props = __props;
41
+ const emit = __emit;
42
+ const addressInput = vue.ref(null);
43
+ let autocomplete;
44
+ const onPlaceChanged = () => {
45
+ const place = autocomplete.getPlace();
46
+ if (!place.geometry || !place.address_components) {
47
+ return;
48
+ }
49
+ let country = "", state = "", city = "";
50
+ for (let i = 0; i < place.address_components.length; i++) {
51
+ let addr = place.address_components[i];
52
+ if (addr.types.includes("country")) {
53
+ country = addr.long_name;
54
+ }
55
+ if (addr.types.includes("administrative_area_level_1")) {
56
+ state = addr.long_name;
57
+ }
58
+ if (addr.types.includes("locality")) {
59
+ city = addr.long_name;
60
+ }
61
+ }
62
+ const newAddress = place.formatted_address;
63
+ const newLocation = { lat: place.geometry.location.lat(), lng: place.geometry.location.lng() };
64
+ emit("update:address", newAddress);
65
+ emit("update:location", newLocation);
66
+ emit("update:country", country);
67
+ emit("update:state", state);
68
+ emit("update:city", city);
69
+ };
70
+ vue.onMounted(() => {
71
+ const loader = new index.Loader({
72
+ apiKey: props.apiKey,
73
+ version: "weekly",
74
+ libraries: ["places"],
75
+ language: props.locale
76
+ });
77
+ loader.load().then(() => {
78
+ autocomplete = new google.maps.places.Autocomplete(addressInput.value);
79
+ autocomplete.addListener("place_changed", onPlaceChanged);
80
+ }).catch((e) => {
81
+ console.error(e);
82
+ });
83
+ });
84
+ return (_ctx, _cache) => {
85
+ return vue.openBlock(), vue.createElementBlock("div", {
86
+ class: vue.normalizeClass([_ctx.$attrs.class, "flex-nowrap flex"])
87
+ }, [
88
+ __props.label ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
89
+ vue.createElementVNode("span", null, vue.toDisplayString(__props.label), 1)
90
+ ])) : vue.createCommentVNode("", true),
91
+ vue.createElementVNode("input", {
92
+ ref_key: "addressInput",
93
+ ref: addressInput,
94
+ class: "w-100",
95
+ placeholder: __props.placeholder,
96
+ value: __props.address,
97
+ onInput: _cache[0] || (_cache[0] = (...args) => _ctx.onInput && _ctx.onInput(...args))
98
+ }, null, 40, _hoisted_2),
99
+ vue.createVNode(vue.Transition, {
100
+ mode: "out-in",
101
+ name: "fade"
102
+ }, {
103
+ default: vue.withCtx(() => [
104
+ _ctx.validation ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, " * " + vue.toDisplayString(_ctx.validation.message), 1)) : vue.createCommentVNode("", true)
105
+ ]),
106
+ _: 1
107
+ })
108
+ ], 2);
109
+ };
110
+ }
111
+ };
112
+ exports.default = _sfc_main;
113
+ //# sourceMappingURL=Address.vue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Address.vue.cjs","sources":["../../../../../src/components/Address/Address.vue"],"sourcesContent":["<template>\n <div :class=\"$attrs.class\" class=\"flex-nowrap flex\"> \n <!-- ////////////////////////// -->\n <!-- Label -->\n <!-- ////////////////////////// -->\n <div v-if=\"label\" class=\"t-transp mn-r-small\">\n <span>{{label}}</span>\n </div>\n <!-- ////////////////////////// -->\n <!-- Input -->\n <!-- ////////////////////////// -->\n <input\n ref=\"addressInput\"\n class=\"w-100\"\n :placeholder=\"placeholder\"\n :value=\"address\"\n @input=\"onInput\"\n />\n <!-- ////////////////////////// -->\n <!-- Validation -->\n <!-- ////////////////////////// -->\n <transition mode=\"out-in\" name=\"fade\">\n <div v-if=\"validation\" class=\"mn-t-thin invalid-feedback\">\n * {{validation.message}}\n </div>\n </transition>\n </div>\n</template>\n\n<style>\n.pac-container {\n position: absolute;\n background-color: white;\n z-index: 1000;\n border-radius: 2rem;\n overflow: hidden;\n}\n</style>\n\n<script setup>\nimport { ref, onMounted, watchEffect } from 'vue';\n\nimport { Loader as GMLoader } from \"@googlemaps/js-api-loader\";\n\nconst props = defineProps({\n apiKey: {\n type: String,\n required: true,\n },\n label: null,\n placeholder: 'Enter something here',\n field: null,\n location: {\n type: Object,\n default: { lat: 48.6900735, lng: 41.16202390 }\n },\n address: {\n type: String,\n default: \"\"\n },\n locale: {\n type: String,\n default: 'en'\n }\n});\n\nconst emit = defineEmits(['update:address', 'update:location', 'update:country', 'update:state', 'update:city']);\n\nconst addressInput = ref(null);\n\nlet autocomplete;\n\nconst onPlaceChanged = () => {\n const place = autocomplete.getPlace();\n\n if (!place.geometry || !place.address_components) {\n return;\n }\n\n let country = '', state = '', city = '';\n\n for (let i = 0; i < place.address_components.length; i++) {\n\n let addr = place.address_components[i];\n\n if (addr.types.includes('country')) {\n country = addr.long_name;\n }\n if (addr.types.includes('administrative_area_level_1')) {\n state = addr.long_name;\n }\n if (addr.types.includes('locality')) {\n city = addr.long_name;\n }\n }\n \n const newAddress = place.formatted_address;\n const newLocation = { lat: place.geometry.location.lat(), lng: place.geometry.location.lng() };\n\n emit('update:address', newAddress);\n emit('update:location', newLocation);\n \n // Add new emits\n emit('update:country', country);\n emit('update:state', state);\n emit('update:city', city);\n};\n\nonMounted(() => { \n const loader = new GMLoader({ \n apiKey: props.apiKey, \n version: \"weekly\", \n libraries: [\"places\"],\n language: props.locale, \n });\n\n loader.load().then(() => { \n autocomplete = new google.maps.places.Autocomplete(addressInput.value); \n autocomplete.addListener('place_changed', onPlaceChanged); \n }).catch(e => { \n console.error(e); \n }); \n});\n</script>"],"names":["ref","onMounted","GMLoader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,UAAM,QAAQ;AAsBd,UAAM,OAAO;AAEb,UAAM,eAAeA,IAAAA,IAAI,IAAI;AAE7B,QAAI;AAEJ,UAAM,iBAAiB,MAAM;AAC3B,YAAM,QAAQ,aAAa;AAE3B,UAAI,CAAC,MAAM,YAAY,CAAC,MAAM,oBAAoB;AAChD;AAAA,MACD;AAED,UAAI,UAAU,IAAI,QAAQ,IAAI,OAAO;AAErC,eAAS,IAAI,GAAG,IAAI,MAAM,mBAAmB,QAAQ,KAAK;AAExD,YAAI,OAAO,MAAM,mBAAmB,CAAC;AAErC,YAAI,KAAK,MAAM,SAAS,SAAS,GAAG;AAClC,oBAAU,KAAK;AAAA,QAChB;AACD,YAAI,KAAK,MAAM,SAAS,6BAA6B,GAAG;AACtD,kBAAQ,KAAK;AAAA,QACd;AACD,YAAI,KAAK,MAAM,SAAS,UAAU,GAAG;AACnC,iBAAO,KAAK;AAAA,QACb;AAAA,MACF;AAED,YAAM,aAAa,MAAM;AACzB,YAAM,cAAc,EAAE,KAAK,MAAM,SAAS,SAAS,OAAO,KAAK,MAAM,SAAS,SAAS,IAAK,EAAA;AAE5F,WAAK,kBAAkB,UAAU;AACjC,WAAK,mBAAmB,WAAW;AAGnC,WAAK,kBAAkB,OAAO;AAC9B,WAAK,gBAAgB,KAAK;AAC1B,WAAK,eAAe,IAAI;AAAA,IAC1B;AAEAC,QAAAA,UAAU,MAAM;AACd,YAAM,SAAS,IAAIC,aAAS;AAAA,QAC1B,QAAQ,MAAM;AAAA,QACd,SAAS;AAAA,QACT,WAAW,CAAC,QAAQ;AAAA,QACpB,UAAU,MAAM;AAAA,MACpB,CAAG;AAED,aAAO,OAAO,KAAK,MAAM;AACvB,uBAAe,IAAI,OAAO,KAAK,OAAO,aAAa,aAAa,KAAK;AACrE,qBAAa,YAAY,iBAAiB,cAAc;AAAA,MAC5D,CAAG,EAAE,MAAM,OAAK;AACZ,gBAAQ,MAAM,CAAC;AAAA,MACnB,CAAG;AAAA,IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,18 +1,21 @@
1
- import { ref as w, onMounted as k, openBlock as r, createElementBlock as i, normalizeClass as b, createElementVNode as m, toDisplayString as y, createCommentVNode as g, createVNode as I, Transition as C, withCtx as S } from "vue";
2
- import { Loader as A } from "../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
1
+ import { ref, onMounted, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, createVNode, Transition, withCtx } from "vue";
2
+ import { Loader } from "../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
3
3
  /* empty css */
4
- const E = {
4
+ const _hoisted_1 = {
5
5
  key: 0,
6
6
  class: "t-transp mn-r-small"
7
- }, K = ["placeholder", "value"], L = {
7
+ };
8
+ const _hoisted_2 = ["placeholder", "value"];
9
+ const _hoisted_3 = {
8
10
  key: 0,
9
11
  class: "mn-t-thin invalid-feedback"
10
- }, P = {
12
+ };
13
+ const _sfc_main = {
11
14
  __name: "Address",
12
15
  props: {
13
16
  apiKey: {
14
17
  type: String,
15
- required: !0
18
+ required: true
16
19
  },
17
20
  label: null,
18
21
  placeholder: "Enter something here",
@@ -31,58 +34,80 @@ const E = {
31
34
  }
32
35
  },
33
36
  emits: ["update:address", "update:location", "update:country", "update:state", "update:city"],
34
- setup(n, { emit: f }) {
35
- const c = n, l = f, u = w(null);
36
- let s;
37
- const h = () => {
38
- const e = s.getPlace();
39
- if (!e.geometry || !e.address_components)
37
+ setup(__props, { emit: __emit }) {
38
+ const props = __props;
39
+ const emit = __emit;
40
+ const addressInput = ref(null);
41
+ let autocomplete;
42
+ const onPlaceChanged = () => {
43
+ const place = autocomplete.getPlace();
44
+ if (!place.geometry || !place.address_components) {
40
45
  return;
41
- let t = "", o = "", p = "";
42
- for (let d = 0; d < e.address_components.length; d++) {
43
- let a = e.address_components[d];
44
- a.types.includes("country") && (t = a.long_name), a.types.includes("administrative_area_level_1") && (o = a.long_name), a.types.includes("locality") && (p = a.long_name);
45
46
  }
46
- const v = e.formatted_address, _ = { lat: e.geometry.location.lat(), lng: e.geometry.location.lng() };
47
- l("update:address", v), l("update:location", _), l("update:country", t), l("update:state", o), l("update:city", p);
47
+ let country = "", state = "", city = "";
48
+ for (let i = 0; i < place.address_components.length; i++) {
49
+ let addr = place.address_components[i];
50
+ if (addr.types.includes("country")) {
51
+ country = addr.long_name;
52
+ }
53
+ if (addr.types.includes("administrative_area_level_1")) {
54
+ state = addr.long_name;
55
+ }
56
+ if (addr.types.includes("locality")) {
57
+ city = addr.long_name;
58
+ }
59
+ }
60
+ const newAddress = place.formatted_address;
61
+ const newLocation = { lat: place.geometry.location.lat(), lng: place.geometry.location.lng() };
62
+ emit("update:address", newAddress);
63
+ emit("update:location", newLocation);
64
+ emit("update:country", country);
65
+ emit("update:state", state);
66
+ emit("update:city", city);
48
67
  };
49
- return k(() => {
50
- new A({
51
- apiKey: c.apiKey,
68
+ onMounted(() => {
69
+ const loader = new Loader({
70
+ apiKey: props.apiKey,
52
71
  version: "weekly",
53
72
  libraries: ["places"],
54
- language: c.locale
55
- }).load().then(() => {
56
- s = new google.maps.places.Autocomplete(u.value), s.addListener("place_changed", h);
57
- }).catch((t) => {
58
- console.error(t);
73
+ language: props.locale
59
74
  });
60
- }), (e, t) => (r(), i("div", {
61
- class: b([e.$attrs.class, "flex-nowrap flex"])
62
- }, [
63
- n.label ? (r(), i("div", E, [
64
- m("span", null, y(n.label), 1)
65
- ])) : g("", !0),
66
- m("input", {
67
- ref_key: "addressInput",
68
- ref: u,
69
- class: "w-100",
70
- placeholder: n.placeholder,
71
- value: n.address,
72
- onInput: t[0] || (t[0] = (...o) => e.onInput && e.onInput(...o))
73
- }, null, 40, K),
74
- I(C, {
75
- mode: "out-in",
76
- name: "fade"
77
- }, {
78
- default: S(() => [
79
- e.validation ? (r(), i("div", L, " * " + y(e.validation.message), 1)) : g("", !0)
80
- ]),
81
- _: 1
82
- })
83
- ], 2));
75
+ loader.load().then(() => {
76
+ autocomplete = new google.maps.places.Autocomplete(addressInput.value);
77
+ autocomplete.addListener("place_changed", onPlaceChanged);
78
+ }).catch((e) => {
79
+ console.error(e);
80
+ });
81
+ });
82
+ return (_ctx, _cache) => {
83
+ return openBlock(), createElementBlock("div", {
84
+ class: normalizeClass([_ctx.$attrs.class, "flex-nowrap flex"])
85
+ }, [
86
+ __props.label ? (openBlock(), createElementBlock("div", _hoisted_1, [
87
+ createElementVNode("span", null, toDisplayString(__props.label), 1)
88
+ ])) : createCommentVNode("", true),
89
+ createElementVNode("input", {
90
+ ref_key: "addressInput",
91
+ ref: addressInput,
92
+ class: "w-100",
93
+ placeholder: __props.placeholder,
94
+ value: __props.address,
95
+ onInput: _cache[0] || (_cache[0] = (...args) => _ctx.onInput && _ctx.onInput(...args))
96
+ }, null, 40, _hoisted_2),
97
+ createVNode(Transition, {
98
+ mode: "out-in",
99
+ name: "fade"
100
+ }, {
101
+ default: withCtx(() => [
102
+ _ctx.validation ? (openBlock(), createElementBlock("div", _hoisted_3, " * " + toDisplayString(_ctx.validation.message), 1)) : createCommentVNode("", true)
103
+ ]),
104
+ _: 1
105
+ })
106
+ ], 2);
107
+ };
84
108
  }
85
109
  };
86
110
  export {
87
- P as default
111
+ _sfc_main as default
88
112
  };
113
+ //# sourceMappingURL=Address.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Address.vue.js","sources":["../../../../../src/components/Address/Address.vue"],"sourcesContent":["<template>\n <div :class=\"$attrs.class\" class=\"flex-nowrap flex\"> \n <!-- ////////////////////////// -->\n <!-- Label -->\n <!-- ////////////////////////// -->\n <div v-if=\"label\" class=\"t-transp mn-r-small\">\n <span>{{label}}</span>\n </div>\n <!-- ////////////////////////// -->\n <!-- Input -->\n <!-- ////////////////////////// -->\n <input\n ref=\"addressInput\"\n class=\"w-100\"\n :placeholder=\"placeholder\"\n :value=\"address\"\n @input=\"onInput\"\n />\n <!-- ////////////////////////// -->\n <!-- Validation -->\n <!-- ////////////////////////// -->\n <transition mode=\"out-in\" name=\"fade\">\n <div v-if=\"validation\" class=\"mn-t-thin invalid-feedback\">\n * {{validation.message}}\n </div>\n </transition>\n </div>\n</template>\n\n<style>\n.pac-container {\n position: absolute;\n background-color: white;\n z-index: 1000;\n border-radius: 2rem;\n overflow: hidden;\n}\n</style>\n\n<script setup>\nimport { ref, onMounted, watchEffect } from 'vue';\n\nimport { Loader as GMLoader } from \"@googlemaps/js-api-loader\";\n\nconst props = defineProps({\n apiKey: {\n type: String,\n required: true,\n },\n label: null,\n placeholder: 'Enter something here',\n field: null,\n location: {\n type: Object,\n default: { lat: 48.6900735, lng: 41.16202390 }\n },\n address: {\n type: String,\n default: \"\"\n },\n locale: {\n type: String,\n default: 'en'\n }\n});\n\nconst emit = defineEmits(['update:address', 'update:location', 'update:country', 'update:state', 'update:city']);\n\nconst addressInput = ref(null);\n\nlet autocomplete;\n\nconst onPlaceChanged = () => {\n const place = autocomplete.getPlace();\n\n if (!place.geometry || !place.address_components) {\n return;\n }\n\n let country = '', state = '', city = '';\n\n for (let i = 0; i < place.address_components.length; i++) {\n\n let addr = place.address_components[i];\n\n if (addr.types.includes('country')) {\n country = addr.long_name;\n }\n if (addr.types.includes('administrative_area_level_1')) {\n state = addr.long_name;\n }\n if (addr.types.includes('locality')) {\n city = addr.long_name;\n }\n }\n \n const newAddress = place.formatted_address;\n const newLocation = { lat: place.geometry.location.lat(), lng: place.geometry.location.lng() };\n\n emit('update:address', newAddress);\n emit('update:location', newLocation);\n \n // Add new emits\n emit('update:country', country);\n emit('update:state', state);\n emit('update:city', city);\n};\n\nonMounted(() => { \n const loader = new GMLoader({ \n apiKey: props.apiKey, \n version: \"weekly\", \n libraries: [\"places\"],\n language: props.locale, \n });\n\n loader.load().then(() => { \n autocomplete = new google.maps.places.Autocomplete(addressInput.value); \n autocomplete.addListener('place_changed', onPlaceChanged); \n }).catch(e => { \n console.error(e); \n }); \n});\n</script>"],"names":["GMLoader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,UAAM,QAAQ;AAsBd,UAAM,OAAO;AAEb,UAAM,eAAe,IAAI,IAAI;AAE7B,QAAI;AAEJ,UAAM,iBAAiB,MAAM;AAC3B,YAAM,QAAQ,aAAa;AAE3B,UAAI,CAAC,MAAM,YAAY,CAAC,MAAM,oBAAoB;AAChD;AAAA,MACD;AAED,UAAI,UAAU,IAAI,QAAQ,IAAI,OAAO;AAErC,eAAS,IAAI,GAAG,IAAI,MAAM,mBAAmB,QAAQ,KAAK;AAExD,YAAI,OAAO,MAAM,mBAAmB,CAAC;AAErC,YAAI,KAAK,MAAM,SAAS,SAAS,GAAG;AAClC,oBAAU,KAAK;AAAA,QAChB;AACD,YAAI,KAAK,MAAM,SAAS,6BAA6B,GAAG;AACtD,kBAAQ,KAAK;AAAA,QACd;AACD,YAAI,KAAK,MAAM,SAAS,UAAU,GAAG;AACnC,iBAAO,KAAK;AAAA,QACb;AAAA,MACF;AAED,YAAM,aAAa,MAAM;AACzB,YAAM,cAAc,EAAE,KAAK,MAAM,SAAS,SAAS,OAAO,KAAK,MAAM,SAAS,SAAS,IAAK,EAAA;AAE5F,WAAK,kBAAkB,UAAU;AACjC,WAAK,mBAAmB,WAAW;AAGnC,WAAK,kBAAkB,OAAO;AAC9B,WAAK,gBAAgB,KAAK;AAC1B,WAAK,eAAe,IAAI;AAAA,IAC1B;AAEA,cAAU,MAAM;AACd,YAAM,SAAS,IAAIA,OAAS;AAAA,QAC1B,QAAQ,MAAM;AAAA,QACd,SAAS;AAAA,QACT,WAAW,CAAC,QAAQ;AAAA,QACpB,UAAU,MAAM;AAAA,MACpB,CAAG;AAED,aAAO,OAAO,KAAK,MAAM;AACvB,uBAAe,IAAI,OAAO,KAAK,OAAO,aAAa,aAAa,KAAK;AACrE,qBAAa,YAAY,iBAAiB,cAAc;AAAA,MAC5D,CAAG,EAAE,MAAM,OAAK;AACZ,gBAAQ,MAAM,CAAC;AAAA,MACnB,CAAG;AAAA,IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,7 +4,7 @@ const vue = require("vue");
4
4
  const SkeletonEvent = require("../../modules/icons/skeletons/SkeletonEvent.vue.cjs");
5
5
  ;/* empty css */
6
6
  const EmptyState = require("../EmptyState/EmptyState.vue.cjs");
7
- const Dropdown = require("../Dropdown/Dropdown.vue.cjs");
7
+ const Dropdown = require("../Dropdown/Dropdown.vue2.cjs");
8
8
  const Calendar = require("../DatePicker/Calendar.vue2.cjs");
9
9
  const BottomSheet = require("../BottomSheet/BottomSheet.vue.cjs");
10
10
  const BlockSearch = require("../../modules/globals/views/components/blocks/BlockSearch.vue.cjs");
@@ -2,7 +2,7 @@ import { mergeModels, useModel, ref, watch, onMounted, onUnmounted, openBlock, c
2
2
  import SkeletonEvent from "../../modules/icons/skeletons/SkeletonEvent.vue.js";
3
3
  /* empty css */
4
4
  import _sfc_main$a from "../EmptyState/EmptyState.vue.js";
5
- import _sfc_main$5 from "../Dropdown/Dropdown.vue.js";
5
+ import _sfc_main$5 from "../Dropdown/Dropdown.vue2.js";
6
6
  import _sfc_main$7 from "../DatePicker/Calendar.vue2.js";
7
7
  import _sfc_main$3 from "../BottomSheet/BottomSheet.vue.js";
8
8
  import _sfc_main$1 from "../../modules/globals/views/components/blocks/BlockSearch.vue.js";
@@ -1 +1,169 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs"),h=require("../Loader/Loader.vue2.cjs");;/* empty css */const v={class:"pos-relative"},L={key:0,class:"i-regular",width:"98",height:"98",viewBox:"0 0 98 98",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k=e.createElementVNode("path",{d:"M50.0004 31.4995C39.7996 31.4995 31.5 39.7991 31.5 49.9999C31.5 60.2007 39.7996 68.5003 50.0004 68.5003C60.2012 68.5003 68.5008 60.2007 68.5008 49.9999C68.5008 39.7991 60.2012 31.4995 50.0004 31.4995ZM50.0004 63.7944C42.3941 63.7944 36.2059 57.6062 36.2059 49.9999C36.2059 42.3936 42.3941 36.2054 50.0004 36.2054C57.6067 36.2054 63.7949 42.3936 63.7949 49.9999C63.7949 57.6062 57.6067 63.7944 50.0004 63.7944Z",fill:"rgb(var(--white))"},null,-1),b=e.createElementVNode("path",{d:"M97.6471 47.6471H84.56C83.3977 30.4141 69.5859 16.6024 52.3529 15.44V2.35294C52.3529 1.05255 51.2988 0 50 0C48.6996 0 47.6471 1.05255 47.6471 2.35294V15.44C30.4141 16.6024 16.6024 30.4141 15.44 47.6471H2.35294C1.05255 47.6471 0 48.6996 0 50C0 51.2988 1.05255 52.3529 2.35294 52.3529H15.44C16.6024 69.5859 30.4141 83.3977 47.6471 84.56V97.6471C47.6471 98.9459 48.6996 100 50 100C51.2988 100 52.3529 98.9459 52.3529 97.6471V84.56C69.5859 83.3977 83.3977 69.5859 84.56 52.3529H97.6471C98.9459 52.3529 100 51.2988 100 50C100 48.6996 98.9459 47.6471 97.6471 47.6471ZM50 79.9435C33.4886 79.9435 20.0565 66.5114 20.0565 50C20.0565 33.4886 33.4886 20.0565 50 20.0565C66.5098 20.0565 79.9435 33.4886 79.9435 50C79.9435 66.5098 66.5098 79.9435 50 79.9435Z",fill:"rgb(var(--white))"},null,-1),E=[k,b],M={__name:"LocationMarker",props:{location:{type:Object,default:()=>({lat:15.87,lng:100.9925})},address:{type:String,default:null},apiKey:String,locale:{type:String,default:"en"}},emits:["update:location","update:address","update:country","update:state","update:city"],setup(C,{emit:_}){const o=C,n=_,d=e.ref(null),s=e.ref(!1);let c,i;e.onMounted(()=>{new w.Loader({apiKey:o.apiKey,version:"weekly",libraries:["places"],language:o.locale}).load().then(()=>{c=new google.maps.Map(d.value,{center:o.location,zoom:15,mapTypeControl:!1,fullscreenControl:!1,disableDefaultUI:!0}),i=new google.maps.Marker({position:o.location,map:c,draggable:!0}),i.addListener("dragend",t=>{const l={lat:t.latLng.lat(),lng:t.latLng.lng()};n("update:location",l),u(l)})}).catch(t=>{console.error(t)})}),e.watchEffect(()=>{o.location&&i&&i.setPosition(new google.maps.LatLng(o.location.lat,o.location.lng))}),e.watchEffect(()=>{if(o.location&&c){const a=new google.maps.LatLng(o.location.lat,o.location.lng);c.setCenter(a),c.setZoom(15)}});function u(a){new google.maps.Geocoder().geocode({location:a},(l,g)=>{if(g==="OK")if(l[0]){n("update:address",l[0].formatted_address);let p="",f="",m="";l[0].address_components.forEach(r=>{r.types.includes("country")&&(p=r.long_name),r.types.includes("administrative_area_level_1")&&(f=r.long_name),r.types.includes("locality")&&(m=r.long_name)}),n("update:country",p),n("update:state",f),n("update:city",m)}else console.error("No results found");else console.error("Geocoder failed due to: "+g)})}async function y(){s.value=!0,navigator.geolocation?navigator.geolocation.getCurrentPosition(a=>{const t={lat:a.coords.latitude,lng:a.coords.longitude};n("update:location",t),u(t),s.value=!1},()=>{console.error("Error getting location"),s.value=!1}):(console.error("Geolocation is not supported by this browser."),s.value=!1)}return(a,t)=>(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",{ref_key:"mapContainer",ref:d,class:"w-100 h-100"},null,512),e.createElementVNode("button",{class:"cursor-pointer flex-center flex pos-absolute pos-t-regular pos-r-regular i-semi bg-second pd-nano radius-extra",onClick:y},[e.createVNode(e.Transition,{name:"ScaleOut",mode:"out-in"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createBlock(h.default,{key:1,class:"pos-t-0 pos-l-0 i-small"})):(e.openBlock(),e.createElementBlock("svg",L,E))]),_:1})])]))}};exports.default=M;
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const index = require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");
5
+ const Loader = require("../Loader/Loader.vue2.cjs");
6
+ ;/* empty css */
7
+ const _hoisted_1 = { class: "pos-relative" };
8
+ const _hoisted_2 = {
9
+ key: 0,
10
+ class: "i-regular",
11
+ width: "98",
12
+ height: "98",
13
+ viewBox: "0 0 98 98",
14
+ fill: "none",
15
+ xmlns: "http://www.w3.org/2000/svg"
16
+ };
17
+ const _hoisted_3 = /* @__PURE__ */ vue.createElementVNode("path", {
18
+ d: "M50.0004 31.4995C39.7996 31.4995 31.5 39.7991 31.5 49.9999C31.5 60.2007 39.7996 68.5003 50.0004 68.5003C60.2012 68.5003 68.5008 60.2007 68.5008 49.9999C68.5008 39.7991 60.2012 31.4995 50.0004 31.4995ZM50.0004 63.7944C42.3941 63.7944 36.2059 57.6062 36.2059 49.9999C36.2059 42.3936 42.3941 36.2054 50.0004 36.2054C57.6067 36.2054 63.7949 42.3936 63.7949 49.9999C63.7949 57.6062 57.6067 63.7944 50.0004 63.7944Z",
19
+ fill: "rgb(var(--white))"
20
+ }, null, -1);
21
+ const _hoisted_4 = /* @__PURE__ */ vue.createElementVNode("path", {
22
+ d: "M97.6471 47.6471H84.56C83.3977 30.4141 69.5859 16.6024 52.3529 15.44V2.35294C52.3529 1.05255 51.2988 0 50 0C48.6996 0 47.6471 1.05255 47.6471 2.35294V15.44C30.4141 16.6024 16.6024 30.4141 15.44 47.6471H2.35294C1.05255 47.6471 0 48.6996 0 50C0 51.2988 1.05255 52.3529 2.35294 52.3529H15.44C16.6024 69.5859 30.4141 83.3977 47.6471 84.56V97.6471C47.6471 98.9459 48.6996 100 50 100C51.2988 100 52.3529 98.9459 52.3529 97.6471V84.56C69.5859 83.3977 83.3977 69.5859 84.56 52.3529H97.6471C98.9459 52.3529 100 51.2988 100 50C100 48.6996 98.9459 47.6471 97.6471 47.6471ZM50 79.9435C33.4886 79.9435 20.0565 66.5114 20.0565 50C20.0565 33.4886 33.4886 20.0565 50 20.0565C66.5098 20.0565 79.9435 33.4886 79.9435 50C79.9435 66.5098 66.5098 79.9435 50 79.9435Z",
23
+ fill: "rgb(var(--white))"
24
+ }, null, -1);
25
+ const _hoisted_5 = [
26
+ _hoisted_3,
27
+ _hoisted_4
28
+ ];
29
+ const _sfc_main = {
30
+ __name: "LocationMarker",
31
+ props: {
32
+ location: {
33
+ type: Object,
34
+ default: () => ({ lat: 15.87, lng: 100.9925 })
35
+ },
36
+ address: {
37
+ type: String,
38
+ default: null
39
+ },
40
+ apiKey: String,
41
+ locale: {
42
+ type: String,
43
+ default: "en"
44
+ }
45
+ },
46
+ emits: ["update:location", "update:address", "update:country", "update:state", "update:city"],
47
+ setup(__props, { emit: __emit }) {
48
+ const props = __props;
49
+ const emit = __emit;
50
+ const mapContainer = vue.ref(null);
51
+ const locationLoading = vue.ref(false);
52
+ let map, marker;
53
+ vue.onMounted(() => {
54
+ const loader = new index.Loader({
55
+ apiKey: props.apiKey,
56
+ version: "weekly",
57
+ libraries: ["places"],
58
+ language: props.locale
59
+ });
60
+ loader.load().then(() => {
61
+ map = new google.maps.Map(mapContainer.value, {
62
+ center: props.location,
63
+ zoom: 15,
64
+ mapTypeControl: false,
65
+ fullscreenControl: false,
66
+ disableDefaultUI: true
67
+ });
68
+ marker = new google.maps.Marker({
69
+ position: props.location,
70
+ map,
71
+ draggable: true
72
+ });
73
+ marker.addListener("dragend", (e) => {
74
+ const newLocation = { lat: e.latLng.lat(), lng: e.latLng.lng() };
75
+ emit("update:location", newLocation);
76
+ getAddressFromLocation(newLocation);
77
+ });
78
+ }).catch((e) => {
79
+ console.error(e);
80
+ });
81
+ });
82
+ vue.watchEffect(() => {
83
+ if (props.location && marker) {
84
+ marker.setPosition(new google.maps.LatLng(props.location.lat, props.location.lng));
85
+ }
86
+ });
87
+ vue.watchEffect(() => {
88
+ if (props.location && map) {
89
+ const newCenter = new google.maps.LatLng(props.location.lat, props.location.lng);
90
+ map.setCenter(newCenter);
91
+ map.setZoom(15);
92
+ }
93
+ });
94
+ function getAddressFromLocation(location) {
95
+ const geocoder = new google.maps.Geocoder();
96
+ geocoder.geocode({ "location": location }, (results, status) => {
97
+ if (status === "OK") {
98
+ if (results[0]) {
99
+ emit("update:address", results[0].formatted_address);
100
+ let country = "", state = "", city = "";
101
+ results[0].address_components.forEach((addr) => {
102
+ if (addr.types.includes("country")) {
103
+ country = addr.long_name;
104
+ }
105
+ if (addr.types.includes("administrative_area_level_1")) {
106
+ state = addr.long_name;
107
+ }
108
+ if (addr.types.includes("locality")) {
109
+ city = addr.long_name;
110
+ }
111
+ });
112
+ emit("update:country", country);
113
+ emit("update:state", state);
114
+ emit("update:city", city);
115
+ } else {
116
+ console.error("No results found");
117
+ }
118
+ } else {
119
+ console.error("Geocoder failed due to: " + status);
120
+ }
121
+ });
122
+ }
123
+ async function setUserLocation() {
124
+ locationLoading.value = true;
125
+ if (navigator.geolocation) {
126
+ navigator.geolocation.getCurrentPosition((position) => {
127
+ const newLocation = { lat: position.coords.latitude, lng: position.coords.longitude };
128
+ emit("update:location", newLocation);
129
+ getAddressFromLocation(newLocation);
130
+ locationLoading.value = false;
131
+ }, () => {
132
+ console.error("Error getting location");
133
+ locationLoading.value = false;
134
+ });
135
+ } else {
136
+ console.error("Geolocation is not supported by this browser.");
137
+ locationLoading.value = false;
138
+ }
139
+ }
140
+ return (_ctx, _cache) => {
141
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
142
+ vue.createElementVNode("div", {
143
+ ref_key: "mapContainer",
144
+ ref: mapContainer,
145
+ class: "w-100 h-100"
146
+ }, null, 512),
147
+ vue.createElementVNode("button", {
148
+ class: "cursor-pointer flex-center flex pos-absolute pos-t-regular pos-r-regular i-semi bg-second pd-nano radius-extra",
149
+ onClick: setUserLocation
150
+ }, [
151
+ vue.createVNode(vue.Transition, {
152
+ name: "ScaleOut",
153
+ mode: "out-in"
154
+ }, {
155
+ default: vue.withCtx(() => [
156
+ !locationLoading.value ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_2, _hoisted_5)) : (vue.openBlock(), vue.createBlock(Loader.default, {
157
+ key: 1,
158
+ class: "pos-t-0 pos-l-0 i-small"
159
+ }))
160
+ ]),
161
+ _: 1
162
+ })
163
+ ])
164
+ ]);
165
+ };
166
+ }
167
+ };
168
+ exports.default = _sfc_main;
169
+ //# sourceMappingURL=LocationMarker.vue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocationMarker.vue.cjs","sources":["../../../../../src/components/LocationMarker/LocationMarker.vue"],"sourcesContent":["<template>\n <div class=\"pos-relative\">\n <div ref=\"mapContainer\" class=\"w-100 h-100\"></div>\n\n <button class=\"cursor-pointer flex-center flex pos-absolute pos-t-regular pos-r-regular i-semi bg-second pd-nano radius-extra\" @click=\"setUserLocation\">\n\n <transition name=\"ScaleOut\" mode=\"out-in\"> \n <svg v-if=\"!locationLoading\" class=\"i-regular\" width=\"98\" height=\"98\" viewBox=\"0 0 98 98\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M50.0004 31.4995C39.7996 31.4995 31.5 39.7991 31.5 49.9999C31.5 60.2007 39.7996 68.5003 50.0004 68.5003C60.2012 68.5003 68.5008 60.2007 68.5008 49.9999C68.5008 39.7991 60.2012 31.4995 50.0004 31.4995ZM50.0004 63.7944C42.3941 63.7944 36.2059 57.6062 36.2059 49.9999C36.2059 42.3936 42.3941 36.2054 50.0004 36.2054C57.6067 36.2054 63.7949 42.3936 63.7949 49.9999C63.7949 57.6062 57.6067 63.7944 50.0004 63.7944Z\" fill=\"rgb(var(--white))\"/>\n <path d=\"M97.6471 47.6471H84.56C83.3977 30.4141 69.5859 16.6024 52.3529 15.44V2.35294C52.3529 1.05255 51.2988 0 50 0C48.6996 0 47.6471 1.05255 47.6471 2.35294V15.44C30.4141 16.6024 16.6024 30.4141 15.44 47.6471H2.35294C1.05255 47.6471 0 48.6996 0 50C0 51.2988 1.05255 52.3529 2.35294 52.3529H15.44C16.6024 69.5859 30.4141 83.3977 47.6471 84.56V97.6471C47.6471 98.9459 48.6996 100 50 100C51.2988 100 52.3529 98.9459 52.3529 97.6471V84.56C69.5859 83.3977 83.3977 69.5859 84.56 52.3529H97.6471C98.9459 52.3529 100 51.2988 100 50C100 48.6996 98.9459 47.6471 97.6471 47.6471ZM50 79.9435C33.4886 79.9435 20.0565 66.5114 20.0565 50C20.0565 33.4886 33.4886 20.0565 50 20.0565C66.5098 20.0565 79.9435 33.4886 79.9435 50C79.9435 66.5098 66.5098 79.9435 50 79.9435Z\" fill=\"rgb(var(--white))\"/> \n </svg>\n\n <Loader v-else class=\"pos-t-0 pos-l-0 i-small\"/>\n </transition>\n\n </button>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, watchEffect } from 'vue';\nimport { Loader as GMLoader } from \"@googlemaps/js-api-loader\";\n\nimport Loader from '@pf/src/components/Loader/Loader.vue'\n\n// Добавим новый проп для ключа API\nconst props = defineProps({\n location: {\n type: Object,\n default: () => ({ lat: 15.8700, lng: 100.9925 })\n },\n address: {\n type: String,\n default: null\n },\n apiKey: String,\n locale: {\n type: String,\n default: 'en'\n }\n})\n\nconst emit = defineEmits(['update:location', 'update:address', 'update:country', 'update:state', 'update:city']);\n\nconst mapContainer = ref(null);\nconst locationLoading = ref(false);\n\nlet map, marker;\n\nonMounted(() => {\n const loader = new GMLoader({\n apiKey: props.apiKey,\n version: \"weekly\",\n libraries: [\"places\"],\n language: props.locale, \n });\n\n loader.load().then(() => {\n map = new google.maps.Map(mapContainer.value, {\n center: props.location,\n zoom: 15,\n mapTypeControl: false,\n fullscreenControl: false,\n disableDefaultUI: true\n });\n\n marker = new google.maps.Marker({\n position: props.location,\n map,\n draggable: true,\n });\n\n marker.addListener(\"dragend\", (e) => {\n const newLocation = { lat: e.latLng.lat(), lng: e.latLng.lng() };\n\n emit('update:location', newLocation);\n\n getAddressFromLocation(newLocation);\n });\n }).catch(e => {\n console.error(e);\n });\n});\n\nwatchEffect(() => {\n if (props.location && marker) {\n marker.setPosition(new google.maps.LatLng(props.location.lat, props.location.lng));\n }\n});\n\nwatchEffect(() => {\n if (props.location && map) {\n const newCenter = new google.maps.LatLng(props.location.lat, props.location.lng);\n \n map.setCenter(newCenter);\n map.setZoom(15);\n }\n});\n\nfunction getAddressFromLocation(location) {\n \n const geocoder = new google.maps.Geocoder;\n\n geocoder.geocode({ 'location': location }, (results, status) => {\n if (status === 'OK') {\n if (results[0]) {\n emit('update:address', results[0].formatted_address);\n\n let country = '', state = '', city = '';\n\n results[0].address_components.forEach((addr) => {\n if (addr.types.includes('country')) {\n country = addr.long_name;\n }\n if (addr.types.includes('administrative_area_level_1')) {\n state = addr.long_name;\n }\n if (addr.types.includes('locality')) {\n city = addr.long_name;\n }\n });\n\n emit('update:country', country);\n emit('update:state', state);\n emit('update:city', city);\n } else {\n console.error('No results found');\n }\n } else {\n console.error('Geocoder failed due to: ' + status);\n }\n });\n}\n\n// Функция для установки местоположения пользователя\nasync function setUserLocation() {\n locationLoading.value = true\n \n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition((position) => {\n const newLocation = { lat: position.coords.latitude, lng: position.coords.longitude };\n emit('update:location', newLocation);\n getAddressFromLocation(newLocation);\n locationLoading.value = false\n }, () => {\n console.error('Error getting location');\n locationLoading.value = false\n });\n } else {\n console.error('Geolocation is not supported by this browser.');\n locationLoading.value = false\n }\n}\n</script>\n\n\n<style >\n.my-location-button {\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 99;\n}\n\n.gm-style-cc { display:none; }\n\n\n</style>\n"],"names":["ref","onMounted","GMLoader","watchEffect"],"mappings":"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"}