@ozdao/prometheus-framework 0.2.36 → 0.2.38
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.css +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +42 -52
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +39 -242
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -0
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +373 -0
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.js +4 -0
- package/dist/prometheus-framework/src/components/FieldPhone/click-outside.cjs +1 -2
- package/dist/prometheus-framework/src/components/FieldPhone/click-outside.js +13 -13
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +111 -2
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +49 -47
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +43 -42
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js +61 -56
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/store/events.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/store/events.js +59 -39
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +31 -31
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +85 -55
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +30 -38
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +31 -21
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +95 -92
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +54 -74
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +58 -48
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +26 -26
- package/dist/prometheus-framework.cjs.js +18 -18
- package/dist/prometheus-framework.es.js +507 -493
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/modules/globals/store/globals.js +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),oe=require("./click-outside.cjs"),re=require("./all-countries.cjs");require("./FieldPhone2.vue2.cjs");const ue=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),w=require("../../../node_modules/libphonenumber-js/min/exports/parsePhoneNumber.cjs"),ie=["tabindex"],se={class:"flex-nowrap flex flex-v-center p-medium vti__selection"},de=["innerHTML"],ce={key:1,class:"vti__country-code"},fe=["onClick","onMousemove"],ve=["innerHTML"],pe={key:1},ye=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex"],me={key:0,class:"mn-t-thin mn-b-thin invalid-feedback"},he={__name:"FieldPhone2",props:{modelValue:{type:String,default:""},badClass:{type:[String,Array,Object],default:""},goodClass:{type:[String,Array,Object],default:""},badStyle:{type:[String,Array,Object],default:""},goodStyle:{type:[String,Array,Object],default:""},badInputClass:{type:[String,Array,Object],default:""},goodInputClass:{type:[String,Array,Object],default:""},badInputStyle:{type:[String,Array,Object],default:""},goodInputStyle:{type:[String,Array,Object],default:""},allCountries:{type:Array,default:()=>re.default},autoFormat:{type:Boolean,default:()=>!0},validation:{type:[Boolean,Object],default:!1},customValidate:{type:[Boolean,RegExp],default:()=>!1},defaultCountry:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1},autoDefaultCountry:{type:Boolean,default:()=>!0},ignoredCountries:{type:Array,default:()=>[]},invalidMsg:{type:String,default:()=>""},mode:{type:String,default:()=>"auto"},onlyCountries:{type:Array,default:()=>[]},preferredCountries:{type:Array,default:()=>[]},validCharactersOnly:{type:Boolean,default:()=>!1},rootClass:{type:[String,Array,Object],default:()=>""},inputClass:{type:[String,Array,Object],default:()=>""},divInputClass:{type:[String,Array,Object],default:()=>""},rootStyle:{type:[String,Array,Object],default:()=>""},dropdownStyle:{type:[String,Array,Object],default:()=>""},listStyle:{type:[String,Array,Object],default:()=>""},inputStyle:{type:[String,Array,Object],default:()=>""},inputId:{type:[String,Array,Object],default:()=>""},Placeholder:{type:[String,Object,Function],default:()=>""},dropdownOptions:{type:Object,default:()=>({showDialCodeInList:!0,showDialCodeInSelection:!1,showFlags:!0,tabindex:0})},inputOptions:{type:Object,default:()=>({autocomplete:"on",autofocus:!1,id:"",maxlength:25,name:"telephone",placeholder:"Enter a phone number",readonly:!1,required:!1,tabindex:0,type:"tel",styleClasses:""})}},emits:["update:modelValue","validate","country-changed","open","close","blur","focus","enter","space"],setup(a,{emit:V}){let N=oe.default;const n=a,c=V;e.ref(5),e.ref(5),e.reactive({action:null,amount:null});const r=e.ref(n.modelValue?n.modelValue:""),v=e.ref(""),f=e.ref(!1),P=e.ref(!1),s=e.ref(null),S=e.ref(""),x=e.ref(null),T=e.ref("below"),I=e.ref(n.Placeholder!==""?n.Placeholder:n.inputOptions.placeholder),B=e.ref(null),d=e.ref(null),O=e.ref(null);e.onMounted(async()=>{n.modelValue&&(r.value=n.modelValue),G(),U().then(()=>{var t;!r.value&&((t=n.inputOptions)!=null&&t.showDialCode)&&v.value&&(r.value=`+${v.value}`),c("validate",u.value)}).catch(console.error).then(()=>{P.value=!0})});const p=e.computed(()=>C(v.value)),M=e.computed(()=>p.value?p.value.flag:null),F=e.computed(()=>n.mode==="auto"?!r.value||r.value[0]!=="+"?"national":"international":["international","national"].includes(n.mode)?n.mode:(console.error('Invalid value of prop "mode"'),"international")),k=e.computed(()=>n.onlyCountries&&n.onlyCountries.length?n.allCountries.filter(({iso2:t})=>n.onlyCountries.includes(t.toUpperCase())):n.ignoredCountries&&n.ignoredCountries.length?n.allCountries.filter(({iso2:t})=>!n.ignoredCountries.includes(t.toUpperCase())&&!n.ignoredCountries.includes(t.toLowerCase())):n.allCountries),y=e.computed(()=>[...K(n.preferredCountries).map(l=>({...l,preferred:!0})),...k.value]),u=e.computed(()=>{var b,D,A;let t={};((b=r.value)==null?void 0:b[0])==="+"?t=w.parsePhoneNumber(r.value)||{}:t=w.parsePhoneNumber(r.value,v.value)||{};const{metadata:l,...o}=t;let i=(D=t.isValid)==null?void 0:D.call(t),h=r.value;return i&&(h=(A=t.format)==null?void 0:A.call(t,F.value.toUpperCase(),{nationalPrefix:!1})),t.country&&(n.ignoredCountries.length||n.onlyCountries.length)&&(C(t.country)||(i=!1,t={...t,country:null})),{...o,countryCode:t.country,valid:i,country:p.value,formatted:h}}),H=e.computed(()=>u.value.valid===!0?n.goodClass:u.value.valid===!1?n.badClass:void 0),q=e.computed(()=>u.value.valid===!0?n.goodStyle:u.value.valid===!1?n.badStyle:void 0),z=e.computed(()=>u.value.valid===!0?n.goodInputClass:u.value.valid===!1?n.badInputClass:void 0),L=e.computed(()=>u.value.valid===!0?n.goodInputStyle:u.value.valid===!1?n.badInputStyle:void 0);e.watch(p,(t,l)=>{if(!t&&(l!=null&&l.iso2)){v.value=l.iso2;return}t!=null&&t.iso2&&(c("country-changed",t),E())}),e.watch(()=>u.value.countryCode,t=>{v.value=t}),e.watch(()=>u.value.valid,()=>{c("validate",u.value)}),e.watch(()=>u.value.formatted,t=>{!n.autoFormat||n.customValidate||(g(t),e.nextTick(()=>{t&&!n.modelValue&&(r.value=t)}))}),e.watch(()=>n.inputOptions.placeholder,()=>{E()}),e.watch(()=>n.modelValue,(t,l)=>{J()?r.value=t:e.nextTick(()=>{r.value=l,j()})}),e.watch(f,t=>{t?(ae(),c("open")):c("close")});function R(){return fetch("https://ip2c.org/s").then(t=>t.text()).then(t=>{const l=(t||"").toString();if(!l||l[0]!=="1")throw new Error("unable to fetch the country");return l.substr(2,2)})}function $(t,l){if(t.setSelectionRange)t.focus(),t.setSelectionRange(l,l);else if(t.createTextRange){const o=t.createTextRange();o.collapse(!0),o.moveEnd("character",l),o.moveStart("character",l),o.select()}}function E(){I.value=n.inputOptions.placeholder}function U(){return new Promise(t=>{var o;if(((o=r.value)==null?void 0:o[0])==="+"){t();return}if(n.defaultCountry){m(n.defaultCountry),t();return}const l=n.preferredCountries[0]||k.value[0];n.autoDefaultCountry?R().then(i=>{m(i||v.value)}).catch(i=>{console.warn(i),m(l)}).finally(()=>{t()}):(m(l),t())})}function K(t=[]){return t.map(l=>C(l)).filter(Boolean)}function C(t=""){return k.value.find(l=>l.iso2===t.toUpperCase())}function W(t,l){const o=s.value===t,i=t===n.preferredCountries.length-1,h=n.preferredCountries.some(b=>b.toUpperCase()===l);return{highlighted:o,"last-preferred":i,preferred:h}}function m(t){var o,i;let l=typeof t=="string"?C(t):t;if(l){if(((o=r.value)==null?void 0:o[0])==="+"&&l.iso2&&u.value.nationalNumber){v.value=l.iso2,r.value=w.parsePhoneNumber(u.value.nationalNumber,l.iso2).formatInternational();return}if((i=n.inputOptions)!=null&&i.showDialCode&&l){r.value=`+${l.dialCode}`;return}v.value=l.iso2,g(r.value)}}function G(){const t=r.value;if(n.validCharactersOnly){const l=r.value.match(/[()\-+0-9\s]*/g);r.value=l.join("")}if(n.customValidate&&n.customValidate instanceof RegExp){const l=r.value.match(n.customValidate);r.value=l?l.join(""):""}t!==r.value&&g(r.value)}function J(){return n.validCharactersOnly&&!/^[()\-+0-9\s]*$/.test(r.value)?!1:n.customValidate?Q():!0}function Q(){return n.customValidate instanceof RegExp?n.customValidate.test(r.value):!1}function j(){O.value.setCustomValidity(u.valid?"":n.invalidMsg),g(r.value)}function g(t){c("update:modelValue",t),u.value.valid?c("country",u.value.number):c("country",null)}function X(){c("blur")}function Y(){$(O.value,r.value.length),c("focus")}function Z(){c("enter")}function _(){c("space")}function ee(){n.disabled||(f.value=!f.value)}function te(){f.value=!1}function ne(t){t.keyCode===40?(t.preventDefault(),f.value=!0,s.value=s.value===null?0:Math.min(y.value.length-1,s.value+1),e.nextTick(()=>{const l=d.value.children[s.value];l.offsetTop+l.clientHeight>d.value.scrollTop+d.value.clientHeight&&(d.value.scrollTop=l.offsetTop-d.value.clientHeight+l.clientHeight)})):t.keyCode===38?(t.preventDefault(),f.value=!0,s.value=s.value===null?y.value.length-1:Math.max(0,s.value-1),e.nextTick(()=>{const l=d.value.children[s.value];l.offsetTop<d.value.scrollTop&&(d.value.scrollTop=l.offsetTop)})):t.keyCode===13?(t.preventDefault(),s.value!==null&&m(y.value[s.value]),f.value=!f.value):(S.value+=t.key,clearTimeout(x),x=setTimeout(()=>{S.value=""},700),e.nextTick(()=>{const l=y.value.slice(n.preferredCountries.length).findIndex(o=>o.name.toLowerCase().startsWith(S.value));if(l>=0){s.value=n.preferredCountries.length+l;const o=d.value.children[s.value];(o.offsetTop<d.value.scrollTop||o.offsetTop+o.clientHeight>d.value.scrollTop+d.value.clientHeight)&&(d.value.scrollTop=o.offsetTop-d.value.clientHeight/2)}}))}function le(){s.value=y.value.map(t=>t.iso2).indexOf(v.value),f.value=!1}function ae(){const l=window.innerHeight-B.value.getBoundingClientRect().bottom>200;T.value=l?"below":"above"}return(t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass([[a.rootClass,H.value,t.$attrs.class,{"bg-fourth-nano":a.validation},{disabled:a.disabled}],"vue3-reactive-tel-input"]),style:e.normalizeStyle([a.rootStyle,q.value]),ref_key:"rootElement",ref:B},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([["vti__dropdown",{open:f.value}],"br-solid br-black-transp br-1px radius-medium"]),style:e.normalizeStyle([a.dropdownStyle]),tabindex:a.dropdownOptions.tabindex,onKeydown:[ne,e.withKeys(le,["esc"])],onClick:ee},[e.createElementVNode("span",se,[a.dropdownOptions.showFlags?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:M.value,class:"mn-r-thin"},null,8,de)):e.createCommentVNode("",!0),a.dropdownOptions.showDialCodeInSelection?(e.openBlock(),e.createElementBlock("span",ce," +"+e.toDisplayString(p.value&&p.value.dialCode),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("ul",{ref_key:"list",ref:d,class:e.normalizeClass(["bs-black radius-small vti__dropdown-list",T.value]),style:e.normalizeStyle([a.listStyle])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,i)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["flex-nowrap flex w-max",["vti__dropdown-item",W(i,o.iso2)]]),key:o.iso2+(o.preferred?"-preferred":""),onClick:h=>m(o),onMousemove:h=>s.value=i},[a.dropdownOptions.showFlags?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:o.flag,class:"mn-r-thin"},null,8,ve)):e.createCommentVNode("",!0),e.createElementVNode("strong",null,e.toDisplayString(o.name),1),a.dropdownOptions.showDialCodeInList?(e.openBlock(),e.createElementBlock("span",pe," +"+e.toDisplayString(o.dialCode),1)):e.createCommentVNode("",!0)],42,fe))),128))],6),[[e.vShow,f.value]])],46,ie)),[[e.unref(N),te]]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=o=>r.value=o),inputmode:"numeric",pattern:"\\d*",ref_key:"input",ref:O,type:a.inputOptions.type,autocomplete:a.inputOptions.autocomplete,autofocus:a.inputOptions.autofocus,class:e.normalizeClass(["vti__input",a.inputOptions.styleClasses,a.inputClass,z.value]),style:e.normalizeStyle([a.inputStyle,L.value]),disabled:a.disabled,id:a.inputId!==""?a.inputId:a.inputOptions.id,maxlength:a.inputOptions.maxlength,name:a.inputId!==""?a.inputId:a.inputOptions.name,placeholder:I.value,readonly:a.inputOptions.readonly,required:a.inputOptions.required,tabindex:a.inputOptions.tabindex,onBlur:X,onFocus:Y,onInput:j,onKeyup:[e.withKeys(Z,["enter"]),e.withKeys(_,["space"])]},null,46,ye),[[e.vModelDynamic,r.value]]),e.renderSlot(t.$slots,"default",{},void 0,!0)],6),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[a.validation?(e.openBlock(),e.createElementBlock("div",me," * "+e.toDisplayString(a.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64))}},Ce=ue.default(he,[["__scopeId","data-v-0ab16817"]]);exports.default=Ce;
|
@@ -0,0 +1,373 @@
|
|
1
|
+
import { ref as d, reactive as Ce, onMounted as ge, computed as p, watch as h, nextTick as S, openBlock as y, createElementBlock as m, Fragment as K, createElementVNode as w, normalizeClass as I, normalizeStyle as A, withDirectives as M, withKeys as P, createCommentVNode as x, toDisplayString as D, renderList as be, vShow as Oe, unref as Se, vModelDynamic as we, renderSlot as Ie, createVNode as xe, Transition as Te, withCtx as ke } from "vue";
|
2
|
+
import je from "./click-outside.js";
|
3
|
+
import Ae from "./all-countries.js";
|
4
|
+
import "./FieldPhone2.vue2.js";
|
5
|
+
import De from "../../../../_virtual/_plugin-vue_export-helper.js";
|
6
|
+
import { parsePhoneNumber as H } from "../../../node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js";
|
7
|
+
const Be = ["tabindex"], Ee = { class: "flex-nowrap flex flex-v-center p-medium vti__selection" }, Fe = ["innerHTML"], Me = {
|
8
|
+
key: 1,
|
9
|
+
class: "vti__country-code"
|
10
|
+
}, Pe = ["onClick", "onMousemove"], He = ["innerHTML"], Ve = { key: 1 }, Le = ["type", "autocomplete", "autofocus", "disabled", "id", "maxlength", "name", "placeholder", "readonly", "required", "tabindex"], Re = {
|
11
|
+
key: 0,
|
12
|
+
class: "mn-t-thin mn-b-thin invalid-feedback"
|
13
|
+
}, Ne = {
|
14
|
+
__name: "FieldPhone2",
|
15
|
+
props: {
|
16
|
+
modelValue: { type: String, default: "" },
|
17
|
+
badClass: { type: [String, Array, Object], default: "" },
|
18
|
+
goodClass: { type: [String, Array, Object], default: "" },
|
19
|
+
badStyle: { type: [String, Array, Object], default: "" },
|
20
|
+
goodStyle: { type: [String, Array, Object], default: "" },
|
21
|
+
badInputClass: { type: [String, Array, Object], default: "" },
|
22
|
+
goodInputClass: { type: [String, Array, Object], default: "" },
|
23
|
+
badInputStyle: { type: [String, Array, Object], default: "" },
|
24
|
+
goodInputStyle: { type: [String, Array, Object], default: "" },
|
25
|
+
allCountries: { type: Array, default: () => Ae },
|
26
|
+
autoFormat: { type: Boolean, default: () => !0 },
|
27
|
+
validation: { type: [Boolean, Object], default: !1 },
|
28
|
+
customValidate: { type: [Boolean, RegExp], default: () => !1 },
|
29
|
+
defaultCountry: { type: String, default: () => "" },
|
30
|
+
disabled: { type: Boolean, default: () => !1 },
|
31
|
+
autoDefaultCountry: { type: Boolean, default: () => !0 },
|
32
|
+
ignoredCountries: { type: Array, default: () => [] },
|
33
|
+
invalidMsg: { type: String, default: () => "" },
|
34
|
+
mode: { type: String, default: () => "auto" },
|
35
|
+
onlyCountries: { type: Array, default: () => [] },
|
36
|
+
preferredCountries: { type: Array, default: () => [] },
|
37
|
+
validCharactersOnly: { type: Boolean, default: () => !1 },
|
38
|
+
rootClass: { type: [String, Array, Object], default: () => "" },
|
39
|
+
inputClass: { type: [String, Array, Object], default: () => "" },
|
40
|
+
divInputClass: { type: [String, Array, Object], default: () => "" },
|
41
|
+
rootStyle: { type: [String, Array, Object], default: () => "" },
|
42
|
+
dropdownStyle: { type: [String, Array, Object], default: () => "" },
|
43
|
+
listStyle: { type: [String, Array, Object], default: () => "" },
|
44
|
+
inputStyle: { type: [String, Array, Object], default: () => "" },
|
45
|
+
inputId: { type: [String, Array, Object], default: () => "" },
|
46
|
+
Placeholder: { type: [String, Object, Function], default: () => "" },
|
47
|
+
dropdownOptions: {
|
48
|
+
type: Object,
|
49
|
+
default: () => ({
|
50
|
+
showDialCodeInList: !0,
|
51
|
+
showDialCodeInSelection: !1,
|
52
|
+
showFlags: !0,
|
53
|
+
tabindex: 0
|
54
|
+
})
|
55
|
+
},
|
56
|
+
inputOptions: {
|
57
|
+
type: Object,
|
58
|
+
default: () => ({
|
59
|
+
autocomplete: "on",
|
60
|
+
autofocus: !1,
|
61
|
+
id: "",
|
62
|
+
maxlength: 25,
|
63
|
+
name: "telephone",
|
64
|
+
placeholder: "Enter a phone number",
|
65
|
+
readonly: !1,
|
66
|
+
required: !1,
|
67
|
+
tabindex: 0,
|
68
|
+
type: "tel",
|
69
|
+
styleClasses: ""
|
70
|
+
})
|
71
|
+
}
|
72
|
+
},
|
73
|
+
emits: [
|
74
|
+
"update:modelValue",
|
75
|
+
"validate",
|
76
|
+
"country-changed",
|
77
|
+
"open",
|
78
|
+
"close",
|
79
|
+
"blur",
|
80
|
+
"focus",
|
81
|
+
"enter",
|
82
|
+
"space"
|
83
|
+
],
|
84
|
+
setup(l, { emit: W }) {
|
85
|
+
let G = je;
|
86
|
+
const t = l, c = W;
|
87
|
+
d(5), d(5), Ce({
|
88
|
+
action: null,
|
89
|
+
amount: null
|
90
|
+
});
|
91
|
+
const o = d(t.modelValue ? t.modelValue : ""), v = d(""), f = d(!1), J = d(!1), i = d(null), B = d(""), V = d(null), L = d("below"), R = d(t.Placeholder !== "" ? t.Placeholder : t.inputOptions.placeholder), N = d(null), s = d(null), E = d(null);
|
92
|
+
ge(async () => {
|
93
|
+
t.modelValue && (o.value = t.modelValue), ue(), le().then(() => {
|
94
|
+
var e;
|
95
|
+
!o.value && ((e = t.inputOptions) != null && e.showDialCode) && v.value && (o.value = `+${v.value}`), c("validate", u.value);
|
96
|
+
}).catch(console.error).then(() => {
|
97
|
+
J.value = !0;
|
98
|
+
});
|
99
|
+
});
|
100
|
+
const C = p(() => T(v.value)), Q = p(() => C.value ? C.value.flag : null), X = p(() => t.mode === "auto" ? !o.value || o.value[0] !== "+" ? "national" : "international" : ["international", "national"].includes(t.mode) ? t.mode : (console.error('Invalid value of prop "mode"'), "international")), F = p(() => t.onlyCountries && t.onlyCountries.length ? t.allCountries.filter(({ iso2: e }) => t.onlyCountries.includes(e.toUpperCase())) : t.ignoredCountries && t.ignoredCountries.length ? t.allCountries.filter(
|
101
|
+
({ iso2: e }) => !t.ignoredCountries.includes(e.toUpperCase()) && !t.ignoredCountries.includes(e.toLowerCase())
|
102
|
+
) : t.allCountries), g = p(() => [...ae(t.preferredCountries).map((n) => ({ ...n, preferred: !0 })), ...F.value]), u = p(() => {
|
103
|
+
var j, q, z;
|
104
|
+
let e = {};
|
105
|
+
((j = o.value) == null ? void 0 : j[0]) === "+" ? e = H(o.value) || {} : e = H(o.value, v.value) || {};
|
106
|
+
const { metadata: n, ...a } = e;
|
107
|
+
let r = (q = e.isValid) == null ? void 0 : q.call(e), O = o.value;
|
108
|
+
return r && (O = (z = e.format) == null ? void 0 : z.call(e, X.value.toUpperCase(), { nationalPrefix: !1 })), e.country && (t.ignoredCountries.length || t.onlyCountries.length) && (T(e.country) || (r = !1, e = { ...e, country: null })), {
|
109
|
+
...a,
|
110
|
+
countryCode: e.country,
|
111
|
+
valid: r,
|
112
|
+
country: C.value,
|
113
|
+
formatted: O
|
114
|
+
};
|
115
|
+
}), Y = p(() => u.value.valid === !0 ? t.goodClass : u.value.valid === !1 ? t.badClass : void 0), Z = p(() => u.value.valid === !0 ? t.goodStyle : u.value.valid === !1 ? t.badStyle : void 0), _ = p(() => u.value.valid === !0 ? t.goodInputClass : u.value.valid === !1 ? t.badInputClass : void 0), ee = p(() => u.value.valid === !0 ? t.goodInputStyle : u.value.valid === !1 ? t.badInputStyle : void 0);
|
116
|
+
h(C, (e, n) => {
|
117
|
+
if (!e && (n != null && n.iso2)) {
|
118
|
+
v.value = n.iso2;
|
119
|
+
return;
|
120
|
+
}
|
121
|
+
e != null && e.iso2 && (c("country-changed", e), $());
|
122
|
+
}), h(() => u.value.countryCode, (e) => {
|
123
|
+
v.value = e;
|
124
|
+
}), h(() => u.value.valid, () => {
|
125
|
+
c("validate", u.value);
|
126
|
+
}), h(() => u.value.formatted, (e) => {
|
127
|
+
!t.autoFormat || t.customValidate || (k(e), S(() => {
|
128
|
+
e && !t.modelValue && (o.value = e);
|
129
|
+
}));
|
130
|
+
}), h(() => t.inputOptions.placeholder, () => {
|
131
|
+
$();
|
132
|
+
}), h(() => t.modelValue, (e, n) => {
|
133
|
+
re() ? o.value = e : S(() => {
|
134
|
+
o.value = n, U();
|
135
|
+
});
|
136
|
+
}), h(f, (e) => {
|
137
|
+
e ? (he(), c("open")) : c("close");
|
138
|
+
});
|
139
|
+
function te() {
|
140
|
+
return fetch("https://ip2c.org/s").then((e) => e.text()).then((e) => {
|
141
|
+
const n = (e || "").toString();
|
142
|
+
if (!n || n[0] !== "1")
|
143
|
+
throw new Error("unable to fetch the country");
|
144
|
+
return n.substr(2, 2);
|
145
|
+
});
|
146
|
+
}
|
147
|
+
function ne(e, n) {
|
148
|
+
if (e.setSelectionRange)
|
149
|
+
e.focus(), e.setSelectionRange(n, n);
|
150
|
+
else if (e.createTextRange) {
|
151
|
+
const a = e.createTextRange();
|
152
|
+
a.collapse(!0), a.moveEnd("character", n), a.moveStart("character", n), a.select();
|
153
|
+
}
|
154
|
+
}
|
155
|
+
function $() {
|
156
|
+
R.value = t.inputOptions.placeholder;
|
157
|
+
}
|
158
|
+
function le() {
|
159
|
+
return new Promise((e) => {
|
160
|
+
var a;
|
161
|
+
if (((a = o.value) == null ? void 0 : a[0]) === "+") {
|
162
|
+
e();
|
163
|
+
return;
|
164
|
+
}
|
165
|
+
if (t.defaultCountry) {
|
166
|
+
b(t.defaultCountry), e();
|
167
|
+
return;
|
168
|
+
}
|
169
|
+
const n = t.preferredCountries[0] || F.value[0];
|
170
|
+
t.autoDefaultCountry ? te().then((r) => {
|
171
|
+
b(r || v.value);
|
172
|
+
}).catch((r) => {
|
173
|
+
console.warn(r), b(n);
|
174
|
+
}).finally(() => {
|
175
|
+
e();
|
176
|
+
}) : (b(n), e());
|
177
|
+
});
|
178
|
+
}
|
179
|
+
function ae(e = []) {
|
180
|
+
return e.map((n) => T(n)).filter(Boolean);
|
181
|
+
}
|
182
|
+
function T(e = "") {
|
183
|
+
return F.value.find((n) => n.iso2 === e.toUpperCase());
|
184
|
+
}
|
185
|
+
function oe(e, n) {
|
186
|
+
const a = i.value === e, r = e === t.preferredCountries.length - 1, O = t.preferredCountries.some((j) => j.toUpperCase() === n);
|
187
|
+
return { highlighted: a, "last-preferred": r, preferred: O };
|
188
|
+
}
|
189
|
+
function b(e) {
|
190
|
+
var a, r;
|
191
|
+
let n = typeof e == "string" ? T(e) : e;
|
192
|
+
if (n) {
|
193
|
+
if (((a = o.value) == null ? void 0 : a[0]) === "+" && n.iso2 && u.value.nationalNumber) {
|
194
|
+
v.value = n.iso2, o.value = H(u.value.nationalNumber, n.iso2).formatInternational();
|
195
|
+
return;
|
196
|
+
}
|
197
|
+
if ((r = t.inputOptions) != null && r.showDialCode && n) {
|
198
|
+
o.value = `+${n.dialCode}`;
|
199
|
+
return;
|
200
|
+
}
|
201
|
+
v.value = n.iso2, k(o.value);
|
202
|
+
}
|
203
|
+
}
|
204
|
+
function ue() {
|
205
|
+
const e = o.value;
|
206
|
+
if (t.validCharactersOnly) {
|
207
|
+
const n = o.value.match(/[()\-+0-9\s]*/g);
|
208
|
+
o.value = n.join("");
|
209
|
+
}
|
210
|
+
if (t.customValidate && t.customValidate instanceof RegExp) {
|
211
|
+
const n = o.value.match(t.customValidate);
|
212
|
+
o.value = n ? n.join("") : "";
|
213
|
+
}
|
214
|
+
e !== o.value && k(o.value);
|
215
|
+
}
|
216
|
+
function re() {
|
217
|
+
return t.validCharactersOnly && !/^[()\-+0-9\s]*$/.test(o.value) ? !1 : t.customValidate ? ie() : !0;
|
218
|
+
}
|
219
|
+
function ie() {
|
220
|
+
return t.customValidate instanceof RegExp ? t.customValidate.test(o.value) : !1;
|
221
|
+
}
|
222
|
+
function U() {
|
223
|
+
E.value.setCustomValidity(u.valid ? "" : t.invalidMsg), k(o.value);
|
224
|
+
}
|
225
|
+
function k(e) {
|
226
|
+
c("update:modelValue", e), u.value.valid ? c("country", u.value.number) : c("country", null);
|
227
|
+
}
|
228
|
+
function se() {
|
229
|
+
c("blur");
|
230
|
+
}
|
231
|
+
function de() {
|
232
|
+
ne(E.value, o.value.length), c("focus");
|
233
|
+
}
|
234
|
+
function ce() {
|
235
|
+
c("enter");
|
236
|
+
}
|
237
|
+
function fe() {
|
238
|
+
c("space");
|
239
|
+
}
|
240
|
+
function ve() {
|
241
|
+
t.disabled || (f.value = !f.value);
|
242
|
+
}
|
243
|
+
function pe() {
|
244
|
+
f.value = !1;
|
245
|
+
}
|
246
|
+
function ye(e) {
|
247
|
+
e.keyCode === 40 ? (e.preventDefault(), f.value = !0, i.value = i.value === null ? 0 : Math.min(g.value.length - 1, i.value + 1), S(() => {
|
248
|
+
const n = s.value.children[i.value];
|
249
|
+
n.offsetTop + n.clientHeight > s.value.scrollTop + s.value.clientHeight && (s.value.scrollTop = n.offsetTop - s.value.clientHeight + n.clientHeight);
|
250
|
+
})) : e.keyCode === 38 ? (e.preventDefault(), f.value = !0, i.value = i.value === null ? g.value.length - 1 : Math.max(0, i.value - 1), S(() => {
|
251
|
+
const n = s.value.children[i.value];
|
252
|
+
n.offsetTop < s.value.scrollTop && (s.value.scrollTop = n.offsetTop);
|
253
|
+
})) : e.keyCode === 13 ? (e.preventDefault(), i.value !== null && b(g.value[i.value]), f.value = !f.value) : (B.value += e.key, clearTimeout(V), V = setTimeout(() => {
|
254
|
+
B.value = "";
|
255
|
+
}, 700), S(() => {
|
256
|
+
const n = g.value.slice(t.preferredCountries.length).findIndex((a) => a.name.toLowerCase().startsWith(B.value));
|
257
|
+
if (n >= 0) {
|
258
|
+
i.value = t.preferredCountries.length + n;
|
259
|
+
const a = s.value.children[i.value];
|
260
|
+
(a.offsetTop < s.value.scrollTop || a.offsetTop + a.clientHeight > s.value.scrollTop + s.value.clientHeight) && (s.value.scrollTop = a.offsetTop - s.value.clientHeight / 2);
|
261
|
+
}
|
262
|
+
}));
|
263
|
+
}
|
264
|
+
function me() {
|
265
|
+
i.value = g.value.map((e) => e.iso2).indexOf(v.value), f.value = !1;
|
266
|
+
}
|
267
|
+
function he() {
|
268
|
+
const n = window.innerHeight - N.value.getBoundingClientRect().bottom > 200;
|
269
|
+
L.value = n ? "below" : "above";
|
270
|
+
}
|
271
|
+
return (e, n) => (y(), m(K, null, [
|
272
|
+
w("div", {
|
273
|
+
class: I([[
|
274
|
+
l.rootClass,
|
275
|
+
Y.value,
|
276
|
+
e.$attrs.class,
|
277
|
+
{ "bg-fourth-nano": l.validation },
|
278
|
+
{ disabled: l.disabled }
|
279
|
+
], "vue3-reactive-tel-input"]),
|
280
|
+
style: A([
|
281
|
+
l.rootStyle,
|
282
|
+
Z.value
|
283
|
+
]),
|
284
|
+
ref_key: "rootElement",
|
285
|
+
ref: N
|
286
|
+
}, [
|
287
|
+
M((y(), m("div", {
|
288
|
+
class: I([["vti__dropdown", { open: f.value }], "br-solid br-black-transp br-1px radius-medium"]),
|
289
|
+
style: A([l.dropdownStyle]),
|
290
|
+
tabindex: l.dropdownOptions.tabindex,
|
291
|
+
onKeydown: [
|
292
|
+
ye,
|
293
|
+
P(me, ["esc"])
|
294
|
+
],
|
295
|
+
onClick: ve
|
296
|
+
}, [
|
297
|
+
w("span", Ee, [
|
298
|
+
l.dropdownOptions.showFlags ? (y(), m("span", {
|
299
|
+
key: 0,
|
300
|
+
innerHTML: Q.value,
|
301
|
+
class: "mn-r-thin"
|
302
|
+
}, null, 8, Fe)) : x("", !0),
|
303
|
+
l.dropdownOptions.showDialCodeInSelection ? (y(), m("span", Me, " +" + D(C.value && C.value.dialCode), 1)) : x("", !0)
|
304
|
+
]),
|
305
|
+
M(w("ul", {
|
306
|
+
ref_key: "list",
|
307
|
+
ref: s,
|
308
|
+
class: I(["bs-black radius-small vti__dropdown-list", L.value]),
|
309
|
+
style: A([l.listStyle])
|
310
|
+
}, [
|
311
|
+
(y(!0), m(K, null, be(g.value, (a, r) => (y(), m("li", {
|
312
|
+
class: I(["flex-nowrap flex w-max", ["vti__dropdown-item", oe(r, a.iso2)]]),
|
313
|
+
key: a.iso2 + (a.preferred ? "-preferred" : ""),
|
314
|
+
onClick: (O) => b(a),
|
315
|
+
onMousemove: (O) => i.value = r
|
316
|
+
}, [
|
317
|
+
l.dropdownOptions.showFlags ? (y(), m("span", {
|
318
|
+
key: 0,
|
319
|
+
innerHTML: a.flag,
|
320
|
+
class: "mn-r-thin"
|
321
|
+
}, null, 8, He)) : x("", !0),
|
322
|
+
w("strong", null, D(a.name), 1),
|
323
|
+
l.dropdownOptions.showDialCodeInList ? (y(), m("span", Ve, " +" + D(a.dialCode), 1)) : x("", !0)
|
324
|
+
], 42, Pe))), 128))
|
325
|
+
], 6), [
|
326
|
+
[Oe, f.value]
|
327
|
+
])
|
328
|
+
], 46, Be)), [
|
329
|
+
[Se(G), pe]
|
330
|
+
]),
|
331
|
+
M(w("input", {
|
332
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => o.value = a),
|
333
|
+
inputmode: "numeric",
|
334
|
+
pattern: "\\d*",
|
335
|
+
ref_key: "input",
|
336
|
+
ref: E,
|
337
|
+
type: l.inputOptions.type,
|
338
|
+
autocomplete: l.inputOptions.autocomplete,
|
339
|
+
autofocus: l.inputOptions.autofocus,
|
340
|
+
class: I(["vti__input", l.inputOptions.styleClasses, l.inputClass, _.value]),
|
341
|
+
style: A([l.inputStyle, ee.value]),
|
342
|
+
disabled: l.disabled,
|
343
|
+
id: l.inputId !== "" ? l.inputId : l.inputOptions.id,
|
344
|
+
maxlength: l.inputOptions.maxlength,
|
345
|
+
name: l.inputId !== "" ? l.inputId : l.inputOptions.name,
|
346
|
+
placeholder: R.value,
|
347
|
+
readonly: l.inputOptions.readonly,
|
348
|
+
required: l.inputOptions.required,
|
349
|
+
tabindex: l.inputOptions.tabindex,
|
350
|
+
onBlur: se,
|
351
|
+
onFocus: de,
|
352
|
+
onInput: U,
|
353
|
+
onKeyup: [
|
354
|
+
P(ce, ["enter"]),
|
355
|
+
P(fe, ["space"])
|
356
|
+
]
|
357
|
+
}, null, 46, Le), [
|
358
|
+
[we, o.value]
|
359
|
+
]),
|
360
|
+
Ie(e.$slots, "default", {}, void 0, !0)
|
361
|
+
], 6),
|
362
|
+
xe(Te, { name: "fade" }, {
|
363
|
+
default: ke(() => [
|
364
|
+
l.validation ? (y(), m("div", Re, " * " + D(l.validation.message), 1)) : x("", !0)
|
365
|
+
]),
|
366
|
+
_: 1
|
367
|
+
})
|
368
|
+
], 64));
|
369
|
+
}
|
370
|
+
}, Ge = /* @__PURE__ */ De(Ne, [["__scopeId", "data-v-0ab16817"]]);
|
371
|
+
export {
|
372
|
+
Ge as default
|
373
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
|
@@ -1,2 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i={beforeMount(e,o,
|
2
|
-
is not a function, but has to be`;t&&(n+=`Found in component ${t}`),console.warn(n)}e.clickOutsideEvent=function(t){e===t.target||e.contains(t.target)||o.value(t,e)},document.body.addEventListener("click",e.clickOutsideEvent)},unmounted(e){document.body.removeEventListener("click",e.clickOutsideEvent)}};exports.default=i;
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i={beforeMount(e,o,u){var n;if(typeof o.value!="function"){let t=`[Vue-click-outside:] provided expression ${o.expression} is not a function, but has to be`;const c=(n=u.component)==null?void 0:n.name;c&&(t+=` Found in component ${c}`),console.warn(t)}e.clickOutsideEvent=function(t){e===t.target||e.contains(t.target)||o.value(t)},document.addEventListener("click",e.clickOutsideEvent,!0)},unmounted(e){document.removeEventListener("click",e.clickOutsideEvent,!0)}};exports.default=i;
|
@@ -1,19 +1,19 @@
|
|
1
|
-
const
|
2
|
-
beforeMount(
|
3
|
-
|
4
|
-
|
5
|
-
let
|
6
|
-
|
7
|
-
|
1
|
+
const u = {
|
2
|
+
beforeMount(e, n, i) {
|
3
|
+
var o;
|
4
|
+
if (typeof n.value != "function") {
|
5
|
+
let t = `[Vue-click-outside:] provided expression ${n.expression} is not a function, but has to be`;
|
6
|
+
const c = (o = i.component) == null ? void 0 : o.name;
|
7
|
+
c && (t += ` Found in component ${c}`), console.warn(t);
|
8
8
|
}
|
9
|
-
|
10
|
-
|
11
|
-
}, document.
|
9
|
+
e.clickOutsideEvent = function(t) {
|
10
|
+
e === t.target || e.contains(t.target) || n.value(t);
|
11
|
+
}, document.addEventListener("click", e.clickOutsideEvent, !0);
|
12
12
|
},
|
13
|
-
unmounted(
|
14
|
-
document.
|
13
|
+
unmounted(e) {
|
14
|
+
document.removeEventListener("click", e.clickOutsideEvent, !0);
|
15
15
|
}
|
16
16
|
};
|
17
17
|
export {
|
18
|
-
|
18
|
+
u as default
|
19
19
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../Loader/Loader.vue2.cjs");require("./LocationMarker.vue.cjs");const y=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),_=r=>(e.pushScopeId("data-v-e6e63879"),r=r(),e.popScopeId(),r),L={class:"pos-relative"},k={key:0,class:"i-regular",width:"98",height:"98",viewBox:"0 0 98 98",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b=_(()=>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)),M=_(()=>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=[b,M],V={__name:"LocationMarker",props:{location:{type:Object,default:()=>({lat:15.87,lng:100.9925})},address:{type:String,default:null},apiKey:String},emits:["update:location","update:address","update:country","update:state","update:city"],setup(r,{emit:v}){const t=r,n=v,u=e.ref(null),s=e.ref(!1);let c,i;e.onMounted(()=>{console.log(t.location),c=new google.maps.Map(u.value,{center:t.location,zoom:15,mapTypeControl:!1,fullscreenControl:!1,disableDefaultUI:!0}),i=new google.maps.Marker({position:t.location,map:c,draggable:!0}),i.addListener("dragend",o=>{const a={lat:o.latLng.lat(),lng:o.latLng.lng()};n("update:location",a),p(a)})}),e.watchEffect(()=>{t.location&&i&&i.setPosition(new google.maps.LatLng(t.location.lat,t.location.lng))}),e.watchEffect(()=>{if(t.location&&c){const o=new google.maps.LatLng(t.location.lat,t.location.lng);c.setCenter(o),c.setZoom(15)}});function p(o){new google.maps.Geocoder().geocode({location:o},(d,g)=>{if(g==="OK")if(d[0]){n("update:address",d[0].formatted_address);let f="",m="",C="";d[0].address_components.forEach(l=>{l.types.includes("country")&&(f=l.long_name),l.types.includes("administrative_area_level_1")&&(m=l.long_name),l.types.includes("locality")&&(C=l.long_name)}),n("update:country",f),n("update:state",m),n("update:city",C)}else console.error("No results found");else console.error("Geocoder failed due to: "+g)})}async function h(){s.value=!0,navigator.geolocation?navigator.geolocation.getCurrentPosition(o=>{const a={lat:o.coords.latitude,lng:o.coords.longitude};n("update:location",a),p(a),s.value=!1},()=>{console.error("Error getting location"),s.value=!1}):(console.error("Geolocation is not supported by this browser."),s.value=!1)}return(o,a)=>(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("div",{ref_key:"mapContainer",ref:u,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:h},[e.createVNode(e.Transition,{name:"ScaleOut",mode:"out-in"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createBlock(w.default,{key:1,class:"pos-t-0 pos-l-0 i-small"})):(e.openBlock(),e.createElementBlock("svg",k,E))]),_:1})])]))}},x=y.default(V,[["__scopeId","data-v-e6e63879"]]);exports.default=x;
|
@@ -1,4 +1,113 @@
|
|
1
|
-
|
1
|
+
import { ref as h, onMounted as b, watchEffect as w, openBlock as p, createElementBlock as v, createElementVNode as c, createVNode as x, Transition as M, withCtx as S, createBlock as V, pushScopeId as E, popScopeId as I } from "vue";
|
2
|
+
import Z from "../Loader/Loader.vue2.js";
|
3
|
+
import "./LocationMarker.vue.js";
|
4
|
+
import B from "../../../../_virtual/_plugin-vue_export-helper.js";
|
5
|
+
const y = (l) => (E("data-v-e6e63879"), l = l(), I(), l), H = { class: "pos-relative" }, G = {
|
6
|
+
key: 0,
|
7
|
+
class: "i-regular",
|
8
|
+
width: "98",
|
9
|
+
height: "98",
|
10
|
+
viewBox: "0 0 98 98",
|
11
|
+
fill: "none",
|
12
|
+
xmlns: "http://www.w3.org/2000/svg"
|
13
|
+
}, N = /* @__PURE__ */ y(() => /* @__PURE__ */ c("path", {
|
14
|
+
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",
|
15
|
+
fill: "rgb(var(--white))"
|
16
|
+
}, null, -1)), O = /* @__PURE__ */ y(() => /* @__PURE__ */ c("path", {
|
17
|
+
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",
|
18
|
+
fill: "rgb(var(--white))"
|
19
|
+
}, null, -1)), K = [
|
20
|
+
N,
|
21
|
+
O
|
22
|
+
], P = {
|
23
|
+
__name: "LocationMarker",
|
24
|
+
props: {
|
25
|
+
location: {
|
26
|
+
type: Object,
|
27
|
+
default: () => ({ lat: 15.87, lng: 100.9925 })
|
28
|
+
},
|
29
|
+
address: {
|
30
|
+
type: String,
|
31
|
+
default: null
|
32
|
+
},
|
33
|
+
apiKey: String
|
34
|
+
},
|
35
|
+
emits: ["update:location", "update:address", "update:country", "update:state", "update:city"],
|
36
|
+
setup(l, { emit: L }) {
|
37
|
+
const o = l, a = L, u = h(null), s = h(!1);
|
38
|
+
let r, i;
|
39
|
+
b(() => {
|
40
|
+
console.log(o.location), r = new google.maps.Map(u.value, {
|
41
|
+
center: o.location,
|
42
|
+
zoom: 15,
|
43
|
+
mapTypeControl: !1,
|
44
|
+
fullscreenControl: !1,
|
45
|
+
disableDefaultUI: !0
|
46
|
+
}), i = new google.maps.Marker({
|
47
|
+
position: o.location,
|
48
|
+
map: r,
|
49
|
+
draggable: !0
|
50
|
+
}), i.addListener("dragend", (e) => {
|
51
|
+
const t = { lat: e.latLng.lat(), lng: e.latLng.lng() };
|
52
|
+
a("update:location", t), g(t);
|
53
|
+
});
|
54
|
+
}), w(() => {
|
55
|
+
o.location && i && i.setPosition(new google.maps.LatLng(o.location.lat, o.location.lng));
|
56
|
+
}), w(() => {
|
57
|
+
if (o.location && r) {
|
58
|
+
const e = new google.maps.LatLng(o.location.lat, o.location.lng);
|
59
|
+
r.setCenter(e), r.setZoom(15);
|
60
|
+
}
|
61
|
+
});
|
62
|
+
function g(e) {
|
63
|
+
new google.maps.Geocoder().geocode({ location: e }, (d, f) => {
|
64
|
+
if (f === "OK")
|
65
|
+
if (d[0]) {
|
66
|
+
a("update:address", d[0].formatted_address);
|
67
|
+
let m = "", C = "", _ = "";
|
68
|
+
d[0].address_components.forEach((n) => {
|
69
|
+
n.types.includes("country") && (m = n.long_name), n.types.includes("administrative_area_level_1") && (C = n.long_name), n.types.includes("locality") && (_ = n.long_name);
|
70
|
+
}), a("update:country", m), a("update:state", C), a("update:city", _);
|
71
|
+
} else
|
72
|
+
console.error("No results found");
|
73
|
+
else
|
74
|
+
console.error("Geocoder failed due to: " + f);
|
75
|
+
});
|
76
|
+
}
|
77
|
+
async function k() {
|
78
|
+
s.value = !0, navigator.geolocation ? navigator.geolocation.getCurrentPosition((e) => {
|
79
|
+
const t = { lat: e.coords.latitude, lng: e.coords.longitude };
|
80
|
+
a("update:location", t), g(t), s.value = !1;
|
81
|
+
}, () => {
|
82
|
+
console.error("Error getting location"), s.value = !1;
|
83
|
+
}) : (console.error("Geolocation is not supported by this browser."), s.value = !1);
|
84
|
+
}
|
85
|
+
return (e, t) => (p(), v("div", H, [
|
86
|
+
c("div", {
|
87
|
+
ref_key: "mapContainer",
|
88
|
+
ref: u,
|
89
|
+
class: "w-100 h-100"
|
90
|
+
}, null, 512),
|
91
|
+
c("button", {
|
92
|
+
class: "cursor-pointer flex-center flex pos-absolute pos-t-regular pos-r-regular i-semi bg-second pd-nano radius-extra",
|
93
|
+
onClick: k
|
94
|
+
}, [
|
95
|
+
x(M, {
|
96
|
+
name: "ScaleOut",
|
97
|
+
mode: "out-in"
|
98
|
+
}, {
|
99
|
+
default: S(() => [
|
100
|
+
s.value ? (p(), V(Z, {
|
101
|
+
key: 1,
|
102
|
+
class: "pos-t-0 pos-l-0 i-small"
|
103
|
+
})) : (p(), v("svg", G, K))
|
104
|
+
]),
|
105
|
+
_: 1
|
106
|
+
})
|
107
|
+
])
|
108
|
+
]));
|
109
|
+
}
|
110
|
+
}, A = /* @__PURE__ */ B(P, [["__scopeId", "data-v-e6e63879"]]);
|
2
111
|
export {
|
3
|
-
|
112
|
+
A as default
|
4
113
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../FieldPhone/click-outside.cjs");require("./Select.vue.cjs");const g=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),B={key:0,class:"t-transp mn-r-small"},w={class:"w-100"},b=["onClick"],S={key:0,class:"w-100"},_={key:0,class:"mn-t-thin invalid-feedback"},C={__name:"Select",props:{label:String,select:[String,Object],property:String,placeholder:{type:String,default:"Please select an item"},options:{type:Array,default:()=>[]},validation:Boolean},emits:["update:select","focus","blur"],setup(o,{emit:m}){const i=m;let f=y.default;const t=o,n=e.ref(t.property?u(t.select,t.property,t.options):t.select),a=e.ref(!1);function v(){a.value=!1}function u(l,p,c){for(const s of c)if(s[p]===l||s===l)return s;return null}e.watch(()=>t.select,l=>{n.value=t.property?u(t.select,t.property,t.options):t.select});const k=e.computed(()=>t.select?t.options.filter(l=>l!==t.select):t.options),d=()=>{a.value=!a.value,i(a.value?"focus":"blur")},h=l=>{n.value=l,d(),t.property?i("update:select",n.value[t.property]):i("update:select",n.value)};return(l,p)=>{var c,s;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.withDirectives((e.openBlock(),e.createElementBlock("div",{onClick:e.withModifiers(d,["stop"]),class:e.normalizeClass([l.$attrs.class,"cursor-pointer flex-v-center flex-nowrap flex pos-relative"])},[o.label?(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("span",null,e.toDisplayString(o.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("li",w,[e.createElementVNode("span",null,e.toDisplayString((c=n.value)!=null&&c.name?(s=n.value)==null?void 0:s.name:n.value||o.placeholder),1)]),e.createVNode(e.Transition,{mode:"out-in",name:"TransitionTranslateY"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass([l.$attrs.class,"bs-black pos-absolute pos-t-100 pos-l-0 z-index-5 w-100 mn-t-thin"]),style:{"min-width":"max-content"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,r=>(e.openBlock(),e.createElementBlock("li",{onClick:e.withModifiers(V=>h(r),["stop"])},[r?(e.openBlock(),e.createElementBlock("span",S,e.toDisplayString(r.name||r),1)):e.createCommentVNode("",!0)],8,b))),256))],2),[[e.vShow,a.value]])]),_:1})],2)),[[e.unref(f),v]]),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[o.validation?(e.openBlock(),e.createElementBlock("div",_," * "+e.toDisplayString(o.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64)}}},E=g.default(C,[["__scopeId","data-v-67f55841"]]);exports.default=E;
|