@ozdao/prometheus-framework 0.2.35 → 0.2.37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/dist/main.css +1 -1
  2. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  3. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +42 -52
  4. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.cjs +1 -1
  5. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.js +61 -2
  6. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.cjs +1 -1
  7. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.js +2 -61
  8. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  9. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +2 -49
  10. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
  11. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +49 -2
  12. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  14. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +39 -242
  16. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -0
  17. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +373 -0
  18. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.cjs +1 -0
  19. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.js +4 -0
  20. package/dist/prometheus-framework/src/components/FieldPhone/click-outside.cjs +1 -2
  21. package/dist/prometheus-framework/src/components/FieldPhone/click-outside.js +13 -13
  22. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +111 -2
  24. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +70 -2
  26. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -70
  28. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +49 -47
  30. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  32. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +45 -44
  34. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs +2 -2
  35. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js +61 -56
  36. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
  38. package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue.js +1 -1
  40. package/dist/prometheus-framework/src/modules/events/store/events.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/events/store/events.js +59 -39
  42. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  44. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +31 -31
  46. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +85 -55
  48. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/orders/store/orders.js +30 -38
  50. package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +31 -21
  52. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  54. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  56. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +96 -93
  58. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  62. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  64. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  66. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +54 -74
  68. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +58 -48
  70. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/products/store/products.js +26 -26
  72. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  76. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +2 -2
  78. package/dist/prometheus-framework.cjs.js +13 -14
  79. package/dist/prometheus-framework.es.js +346 -557
  80. package/dist/style.css +1 -1
  81. package/package.json +1 -1
  82. package/src/components/Button/Button.vue +26 -19
  83. package/src/components/FieldBig/FieldBig.vue +1 -1
  84. package/src/components/FieldPhone/FieldPhone.vue +55 -304
  85. package/src/components/FieldPhone/FieldPhone2.vue +671 -0
  86. package/src/components/FieldPhone/click-outside.js +16 -11
  87. package/src/components/Footer/Footer.vue +4 -4
  88. package/src/components/Header/Header.vue +2 -1
  89. package/src/components/Select/Select.vue +2 -1
  90. package/src/modules/chats/components/sections/ChatWindow.vue +3 -1
  91. package/src/modules/chats/store/chat.store.js +1 -3
  92. package/src/modules/events/components/pages/EditEvent.vue +2 -1
  93. package/src/modules/events/components/pages/Event.vue +8 -2
  94. package/src/modules/events/components/sections/SectionMainGuest.vue +1 -1
  95. package/src/modules/events/components/sections/SectionSpecialGuests.vue +0 -1
  96. package/src/modules/events/store/events.js +23 -3
  97. package/src/modules/globals/mixins/mixins.js +33 -2
  98. package/src/modules/landing/components/sections/HeroGovernance.vue +156 -0
  99. package/src/modules/marketplace/components/sections/Filters.vue +3 -0
  100. package/src/modules/marketplace/router/marketplace.js +1 -0
  101. package/src/modules/orders/components/blocks/StatusHistory.vue +8 -3
  102. package/src/modules/orders/components/pages/EditOrder.vue +9 -11
  103. package/src/modules/orders/components/pages/FormOrder.vue +58 -46
  104. package/src/modules/orders/components/pages/Order.vue +63 -42
  105. package/src/modules/orders/components/sections/FormOrderDetails.vue +50 -18
  106. package/src/modules/orders/controllers/orders.controller.js +10 -1
  107. package/src/modules/orders/models/order.model.js +1 -0
  108. package/src/modules/orders/store/orders.js +21 -27
  109. package/src/modules/orders/store/shopcart.js +14 -2
  110. package/src/modules/organizations/components/sections/DetailsTab.vue +2 -2
  111. package/src/modules/products/components/sections/FilterProducts.vue +3 -4
  112. package/src/modules/products/components/sections/HeroRecommendation.vue +29 -2
  113. package/src/modules/products/components/sections/SectionProduct.vue +14 -9
  114. package/src/modules/products/controllers/products.controller.js +26 -17
  115. package/src/modules/products/routes/products.routes.js +6 -6
  116. package/src/modules/products/store/products.js +10 -10
  117. package/src/styles/config.scss +10 -3
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Button.vue.cjs");const u=["disabled"],d={key:0},m={key:0,class:"loading"},h=e.createElementVNode("svg",{class:"i-regular",width:"135",height:"140",viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:"#fff"},[e.createElementVNode("rect",{y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"60",width:"15",height:"140",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})])],-1),b=[h],f={key:0,class:"loading t-white"},g={key:0,class:"error"},v={key:0,class:"button-counter"},N={__name:"Button",props:{submit:{type:Function,default:async()=>{console.log("Button click.")}},counter:{type:Object},callback:{type:Function,default:async()=>{console.log("Button callback.")}},callbackDelay:{type:Number,default:750},showSucces:{type:Boolean,default:!0},showLoader:{type:Boolean,default:!0},validation:{type:Boolean,default:!1}},setup(a){const l=a,t=e.ref(null),n=e.ref(null),i=e.ref(!1),r=e.ref(!1);async function c(){t.value.style["pointer-events"]="none",n.value=null,i.value=!0;const o=()=>{t.value&&(t.value.classList.replace("bg-light-main","bg-main"),t.value.style.pointerEvents="auto",i.value=!1,r.value=!1,n.value=null)};try{await l.submit(),t.value.classList.replace("bg-main","bg-light-main"),i.value=!1,l.showSucces?(r.value=!0,setTimeout(o,500)):o(),l.callback&&setTimeout(()=>l.callback(),l.callbackDelay)}catch{t.value.classList.replace("bg-main","bg-fourth-nano"),n.value="❌",setTimeout(()=>{o(),t.value.classList.replace("bg-fourth-nano","bg-main")},1330)}}return(o,s)=>(e.openBlock(),e.createElementBlock("button",{onClick:e.withModifiers(c,["stop"]),disabled:a.validation,ref_key:"button",ref:t,class:"button"},[e.createVNode(e.Transition,{name:"TransitionTranslateY-small"},{default:e.withCtx(()=>[!i.value&&!n.value&&!r.value||!a.showLoader?(e.openBlock(),e.createElementBlock("span",d,[e.renderSlot(o.$slots,"default")])):e.createCommentVNode("",!0)]),_:3}),e.createVNode(e.Transition,{name:"TransitionTranslateY-small"},{default:e.withCtx(()=>[i.value&&!n.value&&a.showLoader?(e.openBlock(),e.createElementBlock("span",m,b)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"TransitionTranslateY-small"},{default:e.withCtx(()=>[r.value&&a.showSucces?(e.openBlock(),e.createElementBlock("span",f,"✔")):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"TransitionTranslateY-small"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(n.value),1)):e.createCommentVNode("",!0)]),_:1}),a.counter?(e.openBlock(),e.createElementBlock("p",v,e.toDisplayString(a.counter),1)):e.createCommentVNode("",!0)],8,u))}};exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Button.vue.cjs");const u=["disabled"],d={key:0},m={key:1,class:"loading"},h=e.createElementVNode("svg",{class:"i-regular",width:"135",height:"140",viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:"#fff"},[e.createElementVNode("rect",{y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"60",width:"15",height:"140",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})])],-1),b=[h],f={key:2,class:"t-semi loading t-black"},g={key:3,class:"error"},v={key:0,class:"button-counter"},y={__name:"Button",props:{submit:{type:Function,default:async()=>{console.log("Button click.")}},text:{type:Object,default:t=>(console.log(t),t={...t.text,success:"✔",error:"✖"})},counter:{type:Object},callback:{type:Function,default:async()=>{console.log("Button callback.")}},callbackDelay:{type:Number,default:750},showSucces:{type:Boolean,default:!0},showLoader:{type:Boolean,default:!0},validation:{type:Boolean,default:!1}},setup(t){const n=t,a=e.ref(null),l=e.ref(null),o=e.ref(!1),c=e.ref(!1);async function r(){a.value.style["pointer-events"]="none",l.value=null,o.value=!0;const i=()=>{a.value&&(a.value.classList.replace("bg-fifth","bg-main"),a.value.style.pointerEvents="auto",o.value=!1,c.value=!1,l.value=null)};try{await n.submit(),a.value.classList.replace("bg-main","bg-fifth"),o.value=!1,n.showSucces?(c.value=!0,setTimeout(i,500)):i(),n.callback&&setTimeout(()=>n.callback(),n.callbackDelay)}catch{a.value.classList.replace("bg-main","bg-fourth-nano"),l.value=n.error,setTimeout(()=>{i(),a.value.classList.replace("bg-fourth-nano","bg-main")},1330)}}return(i,s)=>(e.openBlock(),e.createElementBlock("button",{onClick:e.withModifiers(r,["stop"]),disabled:t.validation,ref_key:"button",ref:a,class:"button"},[e.createVNode(e.Transition,{name:"moveFromTopAbsolute"},{default:e.withCtx(()=>[!o.value&&!l.value&&!c.value||!t.showLoader?(e.openBlock(),e.createElementBlock("span",d,[e.renderSlot(i.$slots,"default")])):o.value&&!l.value&&t.showLoader?(e.openBlock(),e.createElementBlock("span",m,b)):c.value&&t.showSucces?(e.openBlock(),e.createElementBlock("span",f,e.toDisplayString(t.text.success),1)):l.value?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(l.value),1)):e.createCommentVNode("",!0)]),_:3}),t.counter?(e.openBlock(),e.createElementBlock("p",v,e.toDisplayString(t.counter),1)):e.createCommentVNode("",!0)],8,u))}};exports.default=y;
@@ -1,9 +1,9 @@
1
- import { ref as h, openBlock as i, createElementBlock as l, withModifiers as p, createVNode as m, Transition as b, withCtx as f, renderSlot as w, createCommentVNode as r, toDisplayString as g, createElementVNode as e, createTextVNode as c } from "vue";
1
+ import { ref as d, openBlock as l, createElementBlock as s, withModifiers as v, createVNode as g, Transition as y, withCtx as p, renderSlot as w, toDisplayString as h, createCommentVNode as b, createElementVNode as e, createTextVNode as r } from "vue";
2
2
  import "./Button.vue.js";
3
- const k = ["disabled"], N = { key: 0 }, x = {
4
- key: 0,
3
+ const k = ["disabled"], x = { key: 0 }, N = {
4
+ key: 1,
5
5
  class: "loading"
6
- }, _ = /* @__PURE__ */ e("svg", {
6
+ }, C = /* @__PURE__ */ e("svg", {
7
7
  class: "i-regular",
8
8
  width: "135",
9
9
  height: "140",
@@ -25,7 +25,7 @@ const k = ["disabled"], N = { key: 0 }, x = {
25
25
  calcMode: "linear",
26
26
  repeatCount: "indefinite"
27
27
  }),
28
- /* @__PURE__ */ c(),
28
+ /* @__PURE__ */ r(),
29
29
  /* @__PURE__ */ e("animate", {
30
30
  attributeName: "y",
31
31
  begin: "0.5s",
@@ -50,7 +50,7 @@ const k = ["disabled"], N = { key: 0 }, x = {
50
50
  calcMode: "linear",
51
51
  repeatCount: "indefinite"
52
52
  }),
53
- /* @__PURE__ */ c(),
53
+ /* @__PURE__ */ r(),
54
54
  /* @__PURE__ */ e("animate", {
55
55
  attributeName: "y",
56
56
  begin: "0.25s",
@@ -74,7 +74,7 @@ const k = ["disabled"], N = { key: 0 }, x = {
74
74
  calcMode: "linear",
75
75
  repeatCount: "indefinite"
76
76
  }),
77
- /* @__PURE__ */ c(),
77
+ /* @__PURE__ */ r(),
78
78
  /* @__PURE__ */ e("animate", {
79
79
  attributeName: "y",
80
80
  begin: "0s",
@@ -99,7 +99,7 @@ const k = ["disabled"], N = { key: 0 }, x = {
99
99
  calcMode: "linear",
100
100
  repeatCount: "indefinite"
101
101
  }),
102
- /* @__PURE__ */ c(),
102
+ /* @__PURE__ */ r(),
103
103
  /* @__PURE__ */ e("animate", {
104
104
  attributeName: "y",
105
105
  begin: "0.25s",
@@ -124,7 +124,7 @@ const k = ["disabled"], N = { key: 0 }, x = {
124
124
  calcMode: "linear",
125
125
  repeatCount: "indefinite"
126
126
  }),
127
- /* @__PURE__ */ c(),
127
+ /* @__PURE__ */ r(),
128
128
  /* @__PURE__ */ e("animate", {
129
129
  attributeName: "y",
130
130
  begin: "0.5s",
@@ -134,15 +134,15 @@ const k = ["disabled"], N = { key: 0 }, x = {
134
134
  repeatCount: "indefinite"
135
135
  })
136
136
  ])
137
- ], -1), C = [
138
- _
139
- ], T = {
140
- key: 0,
141
- class: "loading t-white"
142
- }, M = {
143
- key: 0,
137
+ ], -1), M = [
138
+ C
139
+ ], B = {
140
+ key: 2,
141
+ class: "t-semi loading t-black"
142
+ }, _ = {
143
+ key: 3,
144
144
  class: "error"
145
- }, B = {
145
+ }, L = {
146
146
  key: 0,
147
147
  class: "button-counter"
148
148
  }, V = {
@@ -154,6 +154,14 @@ const k = ["disabled"], N = { key: 0 }, x = {
154
154
  console.log("Button click.");
155
155
  }
156
156
  },
157
+ text: {
158
+ type: Object,
159
+ default: (t) => (console.log(t), t = {
160
+ ...t.text,
161
+ success: "✔",
162
+ error: "✖"
163
+ })
164
+ },
157
165
  counter: {
158
166
  type: Object
159
167
  },
@@ -180,55 +188,37 @@ const k = ["disabled"], N = { key: 0 }, x = {
180
188
  default: !1
181
189
  }
182
190
  },
183
- setup(a) {
184
- const s = a, t = h(null), n = h(null), u = h(!1), d = h(!1);
185
- async function v() {
186
- t.value.style["pointer-events"] = "none", n.value = null, u.value = !0;
191
+ setup(t) {
192
+ const n = t, a = d(null), i = d(null), u = d(!1), c = d(!1);
193
+ async function f() {
194
+ a.value.style["pointer-events"] = "none", i.value = null, u.value = !0;
187
195
  const o = () => {
188
- t.value && (t.value.classList.replace("bg-light-main", "bg-main"), t.value.style.pointerEvents = "auto", u.value = !1, d.value = !1, n.value = null);
196
+ a.value && (a.value.classList.replace("bg-fifth", "bg-main"), a.value.style.pointerEvents = "auto", u.value = !1, c.value = !1, i.value = null);
189
197
  };
190
198
  try {
191
- await s.submit(), t.value.classList.replace("bg-main", "bg-light-main"), u.value = !1, s.showSucces ? (d.value = !0, setTimeout(o, 500)) : o(), s.callback && setTimeout(() => s.callback(), s.callbackDelay);
199
+ await n.submit(), a.value.classList.replace("bg-main", "bg-fifth"), u.value = !1, n.showSucces ? (c.value = !0, setTimeout(o, 500)) : o(), n.callback && setTimeout(() => n.callback(), n.callbackDelay);
192
200
  } catch {
193
- t.value.classList.replace("bg-main", "bg-fourth-nano"), n.value = "❌", setTimeout(() => {
194
- o(), t.value.classList.replace("bg-fourth-nano", "bg-main");
201
+ a.value.classList.replace("bg-main", "bg-fourth-nano"), i.value = n.error, setTimeout(() => {
202
+ o(), a.value.classList.replace("bg-fourth-nano", "bg-main");
195
203
  }, 1330);
196
204
  }
197
205
  }
198
- return (o, y) => (i(), l("button", {
199
- onClick: p(v, ["stop"]),
200
- disabled: a.validation,
206
+ return (o, m) => (l(), s("button", {
207
+ onClick: v(f, ["stop"]),
208
+ disabled: t.validation,
201
209
  ref_key: "button",
202
- ref: t,
210
+ ref: a,
203
211
  class: "button"
204
212
  }, [
205
- m(b, { name: "TransitionTranslateY-small" }, {
206
- default: f(() => [
207
- !u.value && !n.value && !d.value || !a.showLoader ? (i(), l("span", N, [
213
+ g(y, { name: "moveFromTopAbsolute" }, {
214
+ default: p(() => [
215
+ !u.value && !i.value && !c.value || !t.showLoader ? (l(), s("span", x, [
208
216
  w(o.$slots, "default")
209
- ])) : r("", !0)
217
+ ])) : u.value && !i.value && t.showLoader ? (l(), s("span", N, M)) : c.value && t.showSucces ? (l(), s("span", B, h(t.text.success), 1)) : i.value ? (l(), s("span", _, h(i.value), 1)) : b("", !0)
210
218
  ]),
211
219
  _: 3
212
220
  }),
213
- m(b, { name: "TransitionTranslateY-small" }, {
214
- default: f(() => [
215
- u.value && !n.value && a.showLoader ? (i(), l("span", x, C)) : r("", !0)
216
- ]),
217
- _: 1
218
- }),
219
- m(b, { name: "TransitionTranslateY-small" }, {
220
- default: f(() => [
221
- d.value && a.showSucces ? (i(), l("span", T, "✔")) : r("", !0)
222
- ]),
223
- _: 1
224
- }),
225
- m(b, { name: "TransitionTranslateY-small" }, {
226
- default: f(() => [
227
- n.value ? (i(), l("span", M, g(n.value), 1)) : r("", !0)
228
- ]),
229
- _: 1
230
- }),
231
- a.counter ? (i(), l("p", B, g(a.counter), 1)) : r("", !0)
221
+ t.counter ? (l(), s("p", L, h(t.counter), 1)) : b("", !0)
232
222
  ], 8, k));
233
223
  }
234
224
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue");require("./Checkbox.vue2.cjs");const o=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),u={class:"flex-v-center flex-nowrap flex"},s={key:0,class:"mn-r-auto t-transp mn-r-small"},m=["name","value","checked"],y={__name:"Checkbox",props:{label:String,name:String,value:String,radio:{type:[Array,Boolean,Object],default:()=>[]}},emits:["update:radio"],setup(e,{emit:d}){const t=e,l=d,c=i=>{if(Array.isArray(t.radio)){let r=[...t.radio];if(i.target.checked)r.push(t.value);else{const n=r.indexOf(t.value);n!==-1&&r.splice(n,1)}l("update:radio",r)}else typeof t.radio=="boolean"&&l("update:radio",i.target.checked)};return(i,r)=>(a.openBlock(),a.createElementBlock("label",u,[e.label?(a.openBlock(),a.createElementBlock("div",s,[a.createElementVNode("span",null,a.toDisplayString(e.label),1)])):a.createCommentVNode("",!0),a.createElementVNode("input",{onChange:c,class:"round radiobutton",type:"checkbox",name:e.name,value:e.value,checked:Array.isArray(e.radio)?e.radio.includes(e.value):e.radio},null,40,m),a.createElementVNode("div",{class:a.normalizeClass(["transition-elastic cursor-pointer mn-l-thin pd-thin h-2r w-4r radius-extra",{"bg-grey":!(Array.isArray(e.radio)?e.radio.includes(e.value):e.radio),"bg-main":Array.isArray(e.radio)?e.radio.includes(e.value):e.radio}])},[a.createElementVNode("div",{class:a.normalizeClass(["transition-linear w-1r h-1r radius-extra h-100 bg-white",{"mn-r-auto":!(Array.isArray(e.radio)?e.radio.includes(e.value):e.radio),"mn-l-auto":Array.isArray(e.radio)?e.radio.includes(e.value):e.radio}])},null,2)],2)]))}},h=o.default(y,[["__scopeId","data-v-ef88ec33"]]);exports.default=h;
@@ -1,4 +1,63 @@
1
- const e = "";
1
+ import { openBlock as d, createElementBlock as o, createElementVNode as t, toDisplayString as m, createCommentVNode as h, normalizeClass as c } from "vue";
2
+ import "./Checkbox.vue2.js";
3
+ import y from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = { class: "flex-v-center flex-nowrap flex" }, v = {
5
+ key: 0,
6
+ class: "mn-r-auto t-transp mn-r-small"
7
+ }, x = ["name", "value", "checked"], b = {
8
+ __name: "Checkbox",
9
+ props: {
10
+ label: String,
11
+ name: String,
12
+ value: String,
13
+ radio: {
14
+ type: [Array, Boolean, Object],
15
+ default: () => []
16
+ }
17
+ },
18
+ emits: ["update:radio"],
19
+ setup(e, { emit: u }) {
20
+ const a = e, n = u, s = (r) => {
21
+ if (Array.isArray(a.radio)) {
22
+ let i = [...a.radio];
23
+ if (r.target.checked)
24
+ i.push(a.value);
25
+ else {
26
+ const l = i.indexOf(a.value);
27
+ l !== -1 && i.splice(l, 1);
28
+ }
29
+ n("update:radio", i);
30
+ } else
31
+ typeof a.radio == "boolean" && n("update:radio", r.target.checked);
32
+ };
33
+ return (r, i) => (d(), o("label", f, [
34
+ e.label ? (d(), o("div", v, [
35
+ t("span", null, m(e.label), 1)
36
+ ])) : h("", !0),
37
+ t("input", {
38
+ onChange: s,
39
+ class: "round radiobutton",
40
+ type: "checkbox",
41
+ name: e.name,
42
+ value: e.value,
43
+ checked: Array.isArray(e.radio) ? e.radio.includes(e.value) : e.radio
44
+ }, null, 40, x),
45
+ t("div", {
46
+ class: c(["transition-elastic cursor-pointer mn-l-thin pd-thin h-2r w-4r radius-extra", {
47
+ "bg-grey": !(Array.isArray(e.radio) ? e.radio.includes(e.value) : e.radio),
48
+ "bg-main": Array.isArray(e.radio) ? e.radio.includes(e.value) : e.radio
49
+ }])
50
+ }, [
51
+ t("div", {
52
+ class: c(["transition-linear w-1r h-1r radius-extra h-100 bg-white", {
53
+ "mn-r-auto": !(Array.isArray(e.radio) ? e.radio.includes(e.value) : e.radio),
54
+ "mn-l-auto": Array.isArray(e.radio) ? e.radio.includes(e.value) : e.radio
55
+ }])
56
+ }, null, 2)
57
+ ], 2)
58
+ ]));
59
+ }
60
+ }, w = /* @__PURE__ */ y(b, [["__scopeId", "data-v-ef88ec33"]]);
2
61
  export {
3
- e as default
62
+ w as default
4
63
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue");require("./Checkbox.vue.cjs");const o=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),u={class:"flex-v-center flex-nowrap flex"},s={key:0,class:"mn-r-auto t-transp mn-r-small"},m=["name","value","checked"],y={__name:"Checkbox",props:{label:String,name:String,value:String,radio:{type:[Array,Boolean,Object],default:()=>[]}},emits:["update:radio"],setup(e,{emit:d}){const t=e,l=d,c=i=>{if(Array.isArray(t.radio)){let r=[...t.radio];if(i.target.checked)r.push(t.value);else{const n=r.indexOf(t.value);n!==-1&&r.splice(n,1)}l("update:radio",r)}else typeof t.radio=="boolean"&&l("update:radio",i.target.checked)};return(i,r)=>(a.openBlock(),a.createElementBlock("label",u,[e.label?(a.openBlock(),a.createElementBlock("div",s,[a.createElementVNode("span",null,a.toDisplayString(e.label),1)])):a.createCommentVNode("",!0),a.createElementVNode("input",{onChange:c,class:"round radiobutton",type:"checkbox",name:e.name,value:e.value,checked:Array.isArray(e.radio)?e.radio.includes(e.value):e.radio},null,40,m),a.createElementVNode("div",{class:a.normalizeClass(["transition-elastic cursor-pointer mn-l-thin pd-thin h-2r w-4r radius-extra",{"bg-grey":!(Array.isArray(e.radio)?e.radio.includes(e.value):e.radio),"bg-main":Array.isArray(e.radio)?e.radio.includes(e.value):e.radio}])},[a.createElementVNode("div",{class:a.normalizeClass(["transition-linear w-1r h-1r radius-extra h-100 bg-white",{"mn-r-auto":!(Array.isArray(e.radio)?e.radio.includes(e.value):e.radio),"mn-l-auto":Array.isArray(e.radio)?e.radio.includes(e.value):e.radio}])},null,2)],2)]))}},h=o.default(y,[["__scopeId","data-v-ef88ec33"]]);exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
@@ -1,63 +1,4 @@
1
- import { openBlock as d, createElementBlock as o, createElementVNode as t, toDisplayString as m, createCommentVNode as h, normalizeClass as c } from "vue";
2
- import "./Checkbox.vue.js";
3
- import y from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = { class: "flex-v-center flex-nowrap flex" }, v = {
5
- key: 0,
6
- class: "mn-r-auto t-transp mn-r-small"
7
- }, x = ["name", "value", "checked"], b = {
8
- __name: "Checkbox",
9
- props: {
10
- label: String,
11
- name: String,
12
- value: String,
13
- radio: {
14
- type: [Array, Boolean, Object],
15
- default: () => []
16
- }
17
- },
18
- emits: ["update:radio"],
19
- setup(e, { emit: u }) {
20
- const a = e, n = u, s = (r) => {
21
- if (Array.isArray(a.radio)) {
22
- let i = [...a.radio];
23
- if (r.target.checked)
24
- i.push(a.value);
25
- else {
26
- const l = i.indexOf(a.value);
27
- l !== -1 && i.splice(l, 1);
28
- }
29
- n("update:radio", i);
30
- } else
31
- typeof a.radio == "boolean" && n("update:radio", r.target.checked);
32
- };
33
- return (r, i) => (d(), o("label", f, [
34
- e.label ? (d(), o("div", v, [
35
- t("span", null, m(e.label), 1)
36
- ])) : h("", !0),
37
- t("input", {
38
- onChange: s,
39
- class: "round radiobutton",
40
- type: "checkbox",
41
- name: e.name,
42
- value: e.value,
43
- checked: Array.isArray(e.radio) ? e.radio.includes(e.value) : e.radio
44
- }, null, 40, x),
45
- t("div", {
46
- class: c(["transition-elastic cursor-pointer mn-l-thin pd-thin h-2r w-4r radius-extra", {
47
- "bg-grey": !(Array.isArray(e.radio) ? e.radio.includes(e.value) : e.radio),
48
- "bg-main": Array.isArray(e.radio) ? e.radio.includes(e.value) : e.radio
49
- }])
50
- }, [
51
- t("div", {
52
- class: c(["transition-linear w-1r h-1r radius-extra h-100 bg-white", {
53
- "mn-r-auto": !(Array.isArray(e.radio) ? e.radio.includes(e.value) : e.radio),
54
- "mn-l-auto": Array.isArray(e.radio) ? e.radio.includes(e.value) : e.radio
55
- }])
56
- }, null, 2)
57
- ], 2)
58
- ]));
59
- }
60
- }, w = /* @__PURE__ */ y(b, [["__scopeId", "data-v-ef88ec33"]]);
1
+ const e = "";
61
2
  export {
62
- w as default
3
+ e as default
63
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("../FieldPhone/click-outside.cjs");require("./Dropdown.vue2.cjs");const u=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),s={__name:"Dropdown",props:{label:{type:String,default:"Open"},align:{type:String,default:"left"}},setup(i){let n=a.default;const t=e.ref(!1);function r(){t.value=!1}return(o,l)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"dropdown pos-relative",onClick:l[0]||(l[0]=e.withModifiers(c=>t.value=!t.value,["stop"]))},[e.createTextVNode(e.toDisplayString(i.label)+" ",1),e.createVNode(e.Transition,{name:"TransitionTranslateY",mode:"out-in"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{style:e.normalizeStyle({left:i.align==="left"?"0":"auto",right:i.align==="right"?"0":"auto"}),class:"dropdown-content w-15r radius-big"},[e.renderSlot(o.$slots,"default",{},void 0,!0)],4),[[e.vShow,t.value]])]),_:3})])),[[e.unref(n),r]])}},d=u.default(s,[["__scopeId","data-v-2f59adb5"]]);exports.default=d;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
@@ -1,51 +1,4 @@
1
- import { ref as a, withDirectives as i, openBlock as d, createElementBlock as s, withModifiers as u, createTextVNode as c, toDisplayString as f, createVNode as p, Transition as m, withCtx as v, createElementVNode as g, normalizeStyle as w, renderSlot as k, vShow as S, unref as h } from "vue";
2
- import y from "../FieldPhone/click-outside.js";
3
- import "./Dropdown.vue2.js";
4
- import O from "../../../../_virtual/_plugin-vue_export-helper.js";
5
- const b = {
6
- __name: "Dropdown",
7
- props: {
8
- label: {
9
- type: String,
10
- default: "Open"
11
- },
12
- align: {
13
- type: String,
14
- default: "left"
15
- }
16
- },
17
- setup(t) {
18
- let l = y;
19
- const e = a(!1);
20
- function n() {
21
- e.value = !1;
22
- }
23
- return (r, o) => i((d(), s("div", {
24
- class: "dropdown pos-relative",
25
- onClick: o[0] || (o[0] = u((x) => e.value = !e.value, ["stop"]))
26
- }, [
27
- c(f(t.label) + " ", 1),
28
- p(m, {
29
- name: "TransitionTranslateY",
30
- mode: "out-in"
31
- }, {
32
- default: v(() => [
33
- i(g("div", {
34
- style: w({ left: t.align === "left" ? "0" : "auto", right: t.align === "right" ? "0" : "auto" }),
35
- class: "dropdown-content w-15r radius-big"
36
- }, [
37
- k(r.$slots, "default", {}, void 0, !0)
38
- ], 4), [
39
- [S, e.value]
40
- ])
41
- ]),
42
- _: 3
43
- })
44
- ])), [
45
- [h(l), n]
46
- ]);
47
- }
48
- }, N = /* @__PURE__ */ O(b, [["__scopeId", "data-v-2f59adb5"]]);
1
+ const _ = "";
49
2
  export {
50
- N as default
3
+ _ as default
51
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("../FieldPhone/click-outside.cjs");require("./Dropdown.vue.cjs");const u=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),s={__name:"Dropdown",props:{label:{type:String,default:"Open"},align:{type:String,default:"left"}},setup(i){let n=a.default;const t=e.ref(!1);function r(){t.value=!1}return(o,l)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"dropdown pos-relative",onClick:l[0]||(l[0]=e.withModifiers(c=>t.value=!t.value,["stop"]))},[e.createTextVNode(e.toDisplayString(i.label)+" ",1),e.createVNode(e.Transition,{name:"TransitionTranslateY",mode:"out-in"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{style:e.normalizeStyle({left:i.align==="left"?"0":"auto",right:i.align==="right"?"0":"auto"}),class:"dropdown-content w-15r radius-big"},[e.renderSlot(o.$slots,"default",{},void 0,!0)],4),[[e.vShow,t.value]])]),_:3})])),[[e.unref(n),r]])}},d=u.default(s,[["__scopeId","data-v-2f59adb5"]]);exports.default=d;
@@ -1,4 +1,51 @@
1
- const _ = "";
1
+ import { ref as a, withDirectives as i, openBlock as d, createElementBlock as s, withModifiers as u, createTextVNode as c, toDisplayString as f, createVNode as p, Transition as m, withCtx as v, createElementVNode as g, normalizeStyle as w, renderSlot as k, vShow as S, unref as h } from "vue";
2
+ import y from "../FieldPhone/click-outside.js";
3
+ import "./Dropdown.vue.js";
4
+ import O from "../../../../_virtual/_plugin-vue_export-helper.js";
5
+ const b = {
6
+ __name: "Dropdown",
7
+ props: {
8
+ label: {
9
+ type: String,
10
+ default: "Open"
11
+ },
12
+ align: {
13
+ type: String,
14
+ default: "left"
15
+ }
16
+ },
17
+ setup(t) {
18
+ let l = y;
19
+ const e = a(!1);
20
+ function n() {
21
+ e.value = !1;
22
+ }
23
+ return (r, o) => i((d(), s("div", {
24
+ class: "dropdown pos-relative",
25
+ onClick: o[0] || (o[0] = u((x) => e.value = !e.value, ["stop"]))
26
+ }, [
27
+ c(f(t.label) + " ", 1),
28
+ p(m, {
29
+ name: "TransitionTranslateY",
30
+ mode: "out-in"
31
+ }, {
32
+ default: v(() => [
33
+ i(g("div", {
34
+ style: w({ left: t.align === "left" ? "0" : "auto", right: t.align === "right" ? "0" : "auto" }),
35
+ class: "dropdown-content w-15r radius-big"
36
+ }, [
37
+ k(r.$slots, "default", {}, void 0, !0)
38
+ ], 4), [
39
+ [S, e.value]
40
+ ])
41
+ ]),
42
+ _: 3
43
+ })
44
+ ])), [
45
+ [h(l), n]
46
+ ]);
47
+ }
48
+ }, N = /* @__PURE__ */ O(b, [["__scopeId", "data-v-2f59adb5"]]);
2
49
  export {
3
- _ as default
50
+ N as default
4
51
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("../Field/Field.vue2.cjs"),B=require("vue-i18n"),w={class:"pd-thin radius-extra flex-nowrap flex"},S=["innerHTML"],_={__name:"FieldBig",props:{input:String,placeholder:{type:String},action:{type:String,default:"Action"},placeholderTexts:{type:Object,default:()=>({en:["Lowest THC, please!","Something with banana flavors?","I'm in the mood for trippy vibes."],ru:["Я хочу самый низкий THC","Я хочу чего-нибудь бананового","Я хочу курнуть хейза"]})},typingSpeed:{type:Number,default:200},loopTyping:{type:Boolean,default:!1},enableTyping:{type:Boolean,default:!1}},emits:["update:input","action"],setup(c,{emit:y}){const t=c,{t:F,locale:s}=B.useI18n();let o=e.ref(0),n=e.ref(t.input),p=e.ref(t.placeholder),i=e.ref(t.enableTyping),d=e.ref(null),f=e.ref(""),r=e.ref(!0),v=null;const g=y;function m(){g("action")}function T(a){g("update:input",a),f.value=a}function h(){o.value=(o.value+1)%t.placeholderTexts[s.value].length}function I(){i.value=!1,clearInterval(d.value),p.value=t.placeholder,f.value||(n.value="")}function x(){!f.value&&t.enableTyping&&(i.value=!0,p.value="",b())}function b(){let a=t.placeholderTexts[s.value][o.value],l=0,u=!1;v=setInterval(()=>{r.value=!r.value},200),d.value=setInterval(()=>{i.value&&(u?(n.value=n.value.slice(0,-1),n.value=a.substring(0,l)+(r.value&&l%2?"|":""),l--):(n.value=a.substring(0,l)+(r.value&&l%2?"|":""),l++),l>a.length&&t.loopTyping&&setTimeout(()=>{u=!0,n.value=a.substring(0,l)},333),l===0&&u&&(u=!1,h(),a=t.placeholderTexts[s.value][o.value]))},t.typingSpeed)}return e.onMounted(()=>{t.enableTyping&&b()}),e.watchEffect(()=>{i.value||(clearInterval(d.value),clearInterval(v))}),(a,l)=>(e.openBlock(),e.createElementBlock("div",w,[e.createVNode(k.default,{field:e.unref(n),"onUpdate:field":[l[0]||(l[0]=u=>e.isRef(n)?n.value=u:n=u),T],placeholder:e.unref(i)?" ":e.unref(p),onInput:h,onFocus:I,onBlur:x,class:"w-100 t-semi uppercase pd-small p-big"},null,8,["field","placeholder"]),c.action?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:m,class:"w-min hover-bg-black hover-t-white t-black bg-main button",innerHTML:c.action},null,8,S)):e.createCommentVNode("",!0)]))}};exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("../Field/Field.vue2.cjs"),B=require("vue-i18n"),w={class:"pd-thin radius-extra flex-nowrap flex"},S=["innerHTML"],_={__name:"FieldBig",props:{input:String,placeholder:{type:String},action:{type:String,default:"Action"},placeholderTexts:{type:Object,default:()=>({en:["Lowest THC, please!","Something with banana flavors?","I'm in the mood for trippy vibes."],ru:["Я хочу самый низкий THC","Я хочу чего-нибудь бананового","Я хочу курнуть хейза"]})},typingSpeed:{type:Number,default:200},loopTyping:{type:Boolean,default:!1},enableTyping:{type:Boolean,default:!1}},emits:["update:input","action"],setup(c,{emit:y}){const t=c,{t:F,locale:s}=B.useI18n();let o=e.ref(0),n=e.ref(t.input),p=e.ref(t.placeholder),i=e.ref(t.enableTyping),d=e.ref(null),f=e.ref(""),r=e.ref(!0),v=null;const g=y;function m(){g("action")}function T(a){g("update:input",a),f.value=a}function h(){o.value=(o.value+1)%t.placeholderTexts[s.value].length}function I(){i.value=!1,clearInterval(d.value),p.value=t.placeholder,f.value||(n.value="")}function x(){!f.value&&t.enableTyping&&(i.value=!0,p.value="",b())}function b(){let a=t.placeholderTexts[s.value][o.value],l=0,u=!1;v=setInterval(()=>{r.value=!r.value},200),d.value=setInterval(()=>{i.value&&(u?(n.value=n.value.slice(0,-1),n.value=a.substring(0,l)+(r.value&&l%2?"|":""),l--):(n.value=a.substring(0,l)+(r.value&&l%2?"|":""),l++),l>a.length&&t.loopTyping&&setTimeout(()=>{u=!0,n.value=a.substring(0,l)},333),l===0&&u&&(u=!1,h(),a=t.placeholderTexts[s.value][o.value]))},t.typingSpeed)}return e.onMounted(()=>{t.enableTyping&&b()}),e.watchEffect(()=>{i.value||(clearInterval(d.value),clearInterval(v))}),(a,l)=>(e.openBlock(),e.createElementBlock("div",w,[e.createVNode(k.default,{field:e.unref(n),"onUpdate:field":[l[0]||(l[0]=u=>e.isRef(n)?n.value=u:n=u),T],placeholder:e.unref(i)?" ":e.unref(p),onInput:h,onFocus:I,onBlur:x,class:"w-100 t-semi uppercase pd-small p-big"},null,8,["field","placeholder"]),c.action?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:m,class:"w-max hover-bg-black hover-t-white t-black bg-main button",innerHTML:c.action},null,8,S)):e.createCommentVNode("",!0)]))}};exports.default=_;
@@ -90,7 +90,7 @@ const N = { class: "pd-thin radius-extra flex-nowrap flex" }, V = ["innerHTML"],
90
90
  p.action ? (b(), T("button", {
91
91
  key: 0,
92
92
  onClick: x,
93
- class: "w-min hover-bg-black hover-t-white t-black bg-main button",
93
+ class: "w-max hover-bg-black hover-t-white t-black bg-main button",
94
94
  innerHTML: p.action
95
95
  }, null, 8, V)) : _("", !0)
96
96
  ]));
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),u=require("./utils.cjs"),f=require("./click-outside.cjs");require("./FieldPhone.vue2.cjs");const y=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),h=require("../../../node_modules/libphonenumber-js/min/exports/parsePhoneNumber.cjs");function r(e){const t=u.default.options[e];return typeof t>"u"?u.default.options[e]:t}const C=i.defineComponent({name:"Vue3ReactiveTelInput",directives:{clickOutside:f.default},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:()=>r("allCountries")},autoFormat:{type:Boolean,default:()=>r("autoFormat")},validation:{type:[Boolean,Object],default:!1},customValidate:{type:[Boolean,RegExp],default:()=>r("customValidate")},defaultCountry:{type:String,default:()=>r("defaultCountry")},disabled:{type:Boolean,default:()=>r("disabled")},autoDefaultCountry:{type:Boolean,default:()=>r("autoDefaultCountry")},dropdownOptions:{type:Object,default:()=>r("dropdownOptions")},ignoredCountries:{type:Array,default:()=>r("ignoredCountries")},inputOptions:{type:Object,default:()=>r("inputOptions")},invalidMsg:{type:String,default:()=>r("invalidMsg")},mode:{type:String,default:()=>r("mode")},onlyCountries:{type:Array,default:()=>r("onlyCountries")},preferredCountries:{type:Array,default:()=>r("preferredCountries")},validCharactersOnly:{type:Boolean,default:()=>r("validCharactersOnly")},rootClass:{type:[String,Array,Object],default:()=>r("styleClasses")},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:()=>""}},data(){return{counter:5,initCounter:5,message:{action:null,amount:null},phone:this.modelValue?this.modelValue:"",activeCountryCode:"",open:!1,finishMounted:!1,selectedIndex:null,typeToFindInput:"",typeToFindTimer:null,dropdownOpenDirection:"below",parsedPlaceholder:this.Placeholder!==""?this.Placeholder:this.inputOptions.placeholder}},watch:{activeCountry(e,t){if(!e&&(t!=null&&t.iso2)){this.activeCountryCode=t.iso2;return}e!=null&&e.iso2&&this.$emit("country-changed",e)},"phoneObject.countryCode":function(e){this.activeCountryCode=e},"phoneObject.valid":function(){this.$emit("validate",this.phoneObject)},"phoneObject.formatted":function(e){!this.autoFormat||this.customValidate||(this.emitInput(e),this.$nextTick(()=>{e&&!this.value&&(this.phone=e)}))},"inputOptions.placeholder":function(){this.resetPlaceholder()},value(e,t){this.testCharacters()?this.phone=e:this.$nextTick(()=>{this.phone=t,this.onInput()})},open(e){e?(this.setDropdownPosition(),this.$emit("open")):this.$emit("close")}},mounted(){this.cleanInvalidCharacters(),this.initializeCountry().then(()=>{var e;!this.phone&&((e=this.inputOptions)!=null&&e.showDialCode)&&this.activeCountryCode&&(this.phone=`+${this.activeCountryCode}`),this.$emit("validate",this.phoneObject)}).catch(console.error).then(()=>{this.finishMounted=!0})},computed:{activeCountry(){return this.findCountry(this.activeCountryCode)},activeCountryFlag(){return this.activeCountry?this.activeCountry.flag:null},parsedMode(){return this.mode==="auto"?!this.phone||this.phone[0]!=="+"?"national":"international":["international","national"].includes(this.mode)?this.mode:(console.error('Invalid value of prop "mode"'),"international")},filteredCountries(){return this.onlyCountries.length?this.allCountries.filter(({iso2:e})=>this.onlyCountries.some(t=>t.toUpperCase()===e)):this.ignoredCountries.length?this.allCountries.filter(({iso2:e})=>!this.ignoredCountries.includes(e.toUpperCase())&&!this.ignoredCountries.includes(e.toLowerCase())):this.allCountries},sortedCountries(){return[...this.getCountries(this.preferredCountries).map(t=>({...t,preferred:!0})),...this.filteredCountries]},phoneObject(){var a,d,n;let e;((a=this.phone)==null?void 0:a[0])==="+"?e=h.parsePhoneNumber(this.phone)||{}:e=h.parsePhoneNumber(this.phone,this.activeCountryCode)||{};const{metadata:t,...o}=e;let s=(d=e.isValid)==null?void 0:d.call(e),l=this.phone;return s&&(l=(n=e.format)==null?void 0:n.call(e,this.parsedMode.toUpperCase(),{nationalPrefix:!1})),e.country&&(this.ignoredCountries.length||this.onlyCountries.length)&&(this.findCountry(e.country)||(s=!1,Object.assign(e,{country:null}))),Object.assign(o,{countryCode:e.country,valid:s,country:this.activeCountry,formatted:l}),o},classes(){return this.phoneObject.valid===!0?this.goodClass:this.phoneObject.valid===!1?this.badClass:void 0},styles(){return this.phoneObject.valid===!0?this.goodStyle:this.phoneObject.valid===!1?this.badStyle:void 0},Iclasses(){return this.phoneObject.valid===!0?this.goodInputClass:this.phoneObject.valid===!1?this.badInputClass:void 0},Istyles(){return this.phoneObject.valid===!0?this.goodInputStyle:this.phoneObject.valid===!1?this.badInputStyle:void 0}},methods:{resetPlaceholder(){this.parsedPlaceholder=this.inputOptions.placeholder},initializeCountry(){return new Promise(e=>{var o;if(((o=this.phone)==null?void 0:o[0])==="+"){e();return}if(this.defaultCountry){this.choose(this.defaultCountry),e();return}const t=this.preferredCountries[0]||this.filteredCountries[0];this.autoDefaultCountry?u.getCountry().then(s=>{this.choose(s||this.activeCountryCode)}).catch(s=>{console.warn(s),this.choose(t)}).then(()=>{e()}):(this.choose(t),e())})},getCountries(e=[]){return e.map(t=>this.findCountry(t)).filter(Boolean)},findCountry(e=""){return this.filteredCountries.find(t=>t.iso2===e.toUpperCase())},getItemClass(e,t){const o=this.selectedIndex===e,s=e===this.preferredCountries.length-1,l=this.preferredCountries.some(a=>a.toUpperCase()===t);return{highlighted:o,"last-preferred":s,preferred:l}},choose(e){var o,s;let t=e;if(typeof t=="string"&&(t=this.findCountry(t)),!!t){if(((o=this.phone)==null?void 0:o[0])==="+"&&t.iso2&&this.phoneObject.nationalNumber){this.activeCountryCode=t.iso2,this.phone=h.parsePhoneNumber(this.phoneObject.nationalNumber,t.iso2).formatInternational();return}if((s=this.inputOptions)!=null&&s.showDialCode&&t){this.phone=`+${t.dialCode}`;return}this.activeCountryCode=t.iso2,this.emitInput(this.phone)}},cleanInvalidCharacters(){const e=this.phone;if(this.validCharactersOnly){const t=this.phone.match(/[()\-+0-9\s]*/g);this.phone=t.join("")}if(this.customValidate&&this.customValidate instanceof RegExp){const t=this.phone.match(this.customValidate);this.phone=t.join("")}e!==this.phone&&this.emitInput(this.phone)},testCharacters(){return this.validCharactersOnly&&!/^[()\-+0-9\s]*$/.test(this.phone)?!1:this.customValidate?this.testCustomValidate():!0},testCustomValidate(){return this.customValidate instanceof RegExp?this.customValidate.test(this.phone):!1},onInput(){this.$refs.input.setCustomValidity(this.phoneObject.valid?"":this.invalidMsg),this.emitInput(this.phoneObject)},emitInput(e){this.$emit("update:modelValue",e)},onBlur(){this.$emit("blur")},onFocus(){u.setCaretPosition(this.$refs.input,this.phone.length),this.$emit("focus")},onEnter(){this.$emit("enter")},onSpace(){this.$emit("space")},focus(){this.$refs.input.focus()},toggleDropdown(){this.disabled||(this.open=!this.open)},clickedOutside(){this.open=!1},keyboardNav(e){if(e.keyCode===40){e.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=0:this.selectedIndex=Math.min(this.sortedCountries.length-1,this.selectedIndex+1);const t=this.$refs.list.children[this.selectedIndex];t.offsetTop+t.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight&&(this.$refs.list.scrollTop=t.offsetTop-this.$refs.list.clientHeight+t.clientHeight)}else if(e.keyCode===38){e.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=this.sortedCountries.length-1:this.selectedIndex=Math.max(0,this.selectedIndex-1);const t=this.$refs.list.children[this.selectedIndex];t.offsetTop<this.$refs.list.scrollTop&&(this.$refs.list.scrollTop=t.offsetTop)}else if(e.keyCode===13)this.selectedIndex!==null&&this.choose(this.sortedCountries[this.selectedIndex]),this.open=!this.open;else{this.typeToFindInput+=e.key,clearTimeout(this.typeToFindTimer),this.typeToFindTimer=setTimeout(()=>{this.typeToFindInput=""},700);const t=this.sortedCountries.slice(this.preferredCountries.length).findIndex(o=>o.name.toLowerCase().startsWith(this.typeToFindInput));if(t>=0){this.selectedIndex=this.preferredCountries.length+t;const o=this.$refs.list.children[this.selectedIndex],s=o.offsetTop<this.$refs.list.scrollTop,l=o.offsetTop+o.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight;(s||l)&&(this.$refs.list.scrollTop=o.offsetTop-this.$refs.list.clientHeight/2)}}},reset(){this.selectedIndex=this.sortedCountries.map(e=>e.iso2).indexOf(this.activeCountryCode),this.open=!1},setDropdownPosition(){window.innerHeight-this.$refs.rootElement.getBoundingClientRect().bottom>200?this.dropdownOpenDirection="below":this.dropdownOpenDirection="above"}}}),m=["tabindex"],g={class:"flex-nowrap flex flex-v-center p-medium vti__selection"},b=["innerHTML"],O={key:1,class:"vti__country-code"},v=["onClick","onMousemove"],I=["innerHTML"],S={key:1},w=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex"],k={key:0,class:"mn-t-thin mn-b-thin invalid-feedback"};function j(e,t,o,s,l,a){const d=i.resolveDirective("click-outside");return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",{class:i.normalizeClass(["vue3-reactive-tel-input",{"bg-fourth-nano":e.validation},e.$attrs.class,e.rootClass,{disabled:e.disabled},e.classes]),style:i.normalizeStyle([e.rootStyle,e.styles]),ref:"rootElement"},[i.withDirectives((i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass([["vti__dropdown",{open:e.open}],"br-solid br-black-transp br-1px radius-medium"]),tabindex:e.dropdownOptions.tabindex,onKeydown:[t[0]||(t[0]=(...n)=>e.keyboardNav&&e.keyboardNav(...n)),t[2]||(t[2]=i.withKeys((...n)=>e.reset&&e.reset(...n),["esc"]))],onClick:t[1]||(t[1]=(...n)=>e.toggleDropdown&&e.toggleDropdown(...n)),style:i.normalizeStyle([e.dropdownStyle])},[i.createElementVNode("span",g,[e.dropdownOptions.showFlags?(i.openBlock(),i.createElementBlock("span",{key:0,innerHTML:e.activeCountryFlag,class:"mn-r-thin"},null,8,b)):i.createCommentVNode("",!0),e.dropdownOptions.showDialCodeInSelection?(i.openBlock(),i.createElementBlock("span",O," +"+i.toDisplayString(e.activeCountry&&e.activeCountry.dialCode),1)):i.createCommentVNode("",!0)]),i.withDirectives(i.createElementVNode("ul",{ref:"list",class:i.normalizeClass(["bs-black radius-small vti__dropdown-list",e.dropdownOpenDirection]),style:i.normalizeStyle([e.listStyle])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.sortedCountries,(n,p)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(["flex-nowrap flex w-max",["vti__dropdown-item",e.getItemClass(p,n.iso2)]]),key:n.iso2+(n.preferred?"-preferred":""),onClick:c=>e.choose(n),onMousemove:c=>e.selectedIndex=p},[e.dropdownOptions.showFlags?(i.openBlock(),i.createElementBlock("span",{key:0,innerHTML:n.flag,class:"mn-r-thin"},null,8,I)):i.createCommentVNode("",!0),i.createElementVNode("strong",null,i.toDisplayString(n.name),1),e.dropdownOptions.showDialCodeInList?(i.openBlock(),i.createElementBlock("span",S," +"+i.toDisplayString(n.dialCode),1)):i.createCommentVNode("",!0)],42,v))),128))],6),[[i.vShow,e.open]])],46,m)),[[d,e.clickedOutside]]),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[3]||(t[3]=n=>e.phone=n),pattern:"[0-9]*",ref:"input",type:e.inputOptions.type,autocomplete:e.inputOptions.autocomplete,autofocus:e.inputOptions.autofocus,class:i.normalizeClass(["vti__input",e.inputOptions.styleClasses,e.inputClass,e.Iclasses]),style:i.normalizeStyle([e.inputStyle,e.Istyles]),disabled:e.disabled,id:e.inputId!==""?e.inputId:e.inputOptions.id,maxlength:e.inputOptions.maxlength,name:e.inputId!==""?e.inputId:e.inputOptions.name,placeholder:e.parsedPlaceholder,readonly:e.inputOptions.readonly,required:e.inputOptions.required,tabindex:e.inputOptions.tabindex,onBlur:t[4]||(t[4]=(...n)=>e.onBlur&&e.onBlur(...n)),onFocus:t[5]||(t[5]=(...n)=>e.onFocus&&e.onFocus(...n)),onInput:t[6]||(t[6]=(...n)=>e.onInput&&e.onInput(...n)),onKeyup:[t[7]||(t[7]=i.withKeys((...n)=>e.onEnter&&e.onEnter(...n),["enter"])),t[8]||(t[8]=i.withKeys((...n)=>e.onSpace&&e.onSpace(...n),["space"]))]},null,46,w),[[i.vModelDynamic,e.phone]]),i.renderSlot(e.$slots,"default",{},void 0,!0)],6),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[e.validation?(i.openBlock(),i.createElementBlock("div",k," * "+i.toDisplayString(e.validation.message),1)):i.createCommentVNode("",!0)]),_:1})],64)}const $=y.default(C,[["render",j],["__scopeId","data-v-5198d519"]]);exports.default=$;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),u=require("./utils.cjs"),f=require("./click-outside.cjs");require("./FieldPhone.vue2.cjs");const y=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),h=require("../../../node_modules/libphonenumber-js/min/exports/parsePhoneNumber.cjs");function r(e){const t=u.default.options[e];return typeof t>"u"?u.default.options[e]:t}const C=i.defineComponent({name:"Vue3ReactiveTelInput",directives:{clickOutside:f.default},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:()=>r("allCountries")},autoFormat:{type:Boolean,default:()=>r("autoFormat")},validation:{type:[Boolean,Object],default:!1},customValidate:{type:[Boolean,RegExp],default:()=>r("customValidate")},defaultCountry:{type:String,default:()=>r("defaultCountry")},disabled:{type:Boolean,default:()=>r("disabled")},autoDefaultCountry:{type:Boolean,default:()=>r("autoDefaultCountry")},dropdownOptions:{type:Object,default:()=>r("dropdownOptions")},ignoredCountries:{type:Array,default:()=>r("ignoredCountries")},inputOptions:{type:Object,default:()=>r("inputOptions")},invalidMsg:{type:String,default:()=>r("invalidMsg")},mode:{type:String,default:()=>r("mode")},onlyCountries:{type:Array,default:()=>r("onlyCountries")},preferredCountries:{type:Array,default:()=>r("preferredCountries")},validCharactersOnly:{type:Boolean,default:()=>r("validCharactersOnly")},rootClass:{type:[String,Array,Object],default:()=>r("styleClasses")},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:()=>""}},data(){return{counter:5,initCounter:5,message:{action:null,amount:null},phone:this.modelValue?this.modelValue:"",activeCountryCode:"",open:!1,finishMounted:!1,selectedIndex:null,typeToFindInput:"",typeToFindTimer:null,dropdownOpenDirection:"below",parsedPlaceholder:this.Placeholder!==""?this.Placeholder:this.inputOptions.placeholder}},watch:{activeCountry(e,t){if(!e&&(t!=null&&t.iso2)){this.activeCountryCode=t.iso2;return}e!=null&&e.iso2&&this.$emit("country-changed",e)},"phoneObject.countryCode":function(e){this.activeCountryCode=e},"phoneObject.valid":function(){this.$emit("validate",this.phoneObject)},"phoneObject.formatted":function(e){!this.autoFormat||this.customValidate||(this.emitInput(e),this.$nextTick(()=>{e&&!this.value&&(this.phone=e)}))},"inputOptions.placeholder":function(){this.resetPlaceholder()},value(e,t){this.testCharacters()?this.phone=e:this.$nextTick(()=>{this.phone=t,this.onInput()})},open(e){e?(this.setDropdownPosition(),this.$emit("open")):this.$emit("close")}},mounted(){this.value&&(this.phone=this.value),this.cleanInvalidCharacters(),this.initializeCountry().then(()=>{var e;!this.phone&&((e=this.inputOptions)!=null&&e.showDialCode)&&this.activeCountryCode&&(this.phone=`+${this.activeCountryCode}`),this.$emit("validate",this.phoneObject)}).catch(console.error).then(()=>{this.finishMounted=!0})},computed:{activeCountry(){return this.findCountry(this.activeCountryCode)},activeCountryFlag(){return this.activeCountry?this.activeCountry.flag:null},parsedMode(){return this.mode==="auto"?!this.phone||this.phone[0]!=="+"?"national":"international":["international","national"].includes(this.mode)?this.mode:(console.error('Invalid value of prop "mode"'),"international")},filteredCountries(){return this.onlyCountries.length?this.allCountries.filter(({iso2:e})=>this.onlyCountries.some(t=>t.toUpperCase()===e)):this.ignoredCountries.length?this.allCountries.filter(({iso2:e})=>!this.ignoredCountries.includes(e.toUpperCase())&&!this.ignoredCountries.includes(e.toLowerCase())):this.allCountries},sortedCountries(){return[...this.getCountries(this.preferredCountries).map(t=>({...t,preferred:!0})),...this.filteredCountries]},phoneObject(){var a,d,n;let e;((a=this.phone)==null?void 0:a[0])==="+"?e=h.parsePhoneNumber(this.phone)||{}:e=h.parsePhoneNumber(this.phone,this.activeCountryCode)||{};const{metadata:t,...o}=e;let s=(d=e.isValid)==null?void 0:d.call(e),l=this.phone;return s&&(l=(n=e.format)==null?void 0:n.call(e,this.parsedMode.toUpperCase(),{nationalPrefix:!1})),e.country&&(this.ignoredCountries.length||this.onlyCountries.length)&&(this.findCountry(e.country)||(s=!1,Object.assign(e,{country:null}))),Object.assign(o,{countryCode:e.country,valid:s,country:this.activeCountry,formatted:l}),o},classes(){return this.phoneObject.valid===!0?this.goodClass:this.phoneObject.valid===!1?this.badClass:void 0},styles(){return this.phoneObject.valid===!0?this.goodStyle:this.phoneObject.valid===!1?this.badStyle:void 0},Iclasses(){return this.phoneObject.valid===!0?this.goodInputClass:this.phoneObject.valid===!1?this.badInputClass:void 0},Istyles(){return this.phoneObject.valid===!0?this.goodInputStyle:this.phoneObject.valid===!1?this.badInputStyle:void 0}},methods:{resetPlaceholder(){this.parsedPlaceholder=this.inputOptions.placeholder},initializeCountry(){return new Promise(e=>{var o;if(((o=this.phone)==null?void 0:o[0])==="+"){e();return}if(this.defaultCountry){this.choose(this.defaultCountry),e();return}const t=this.preferredCountries[0]||this.filteredCountries[0];this.autoDefaultCountry?u.getCountry().then(s=>{this.choose(s||this.activeCountryCode)}).catch(s=>{console.warn(s),this.choose(t)}).then(()=>{e()}):(this.choose(t),e())})},getCountries(e=[]){return e.map(t=>this.findCountry(t)).filter(Boolean)},findCountry(e=""){return this.filteredCountries.find(t=>t.iso2===e.toUpperCase())},getItemClass(e,t){const o=this.selectedIndex===e,s=e===this.preferredCountries.length-1,l=this.preferredCountries.some(a=>a.toUpperCase()===t);return{highlighted:o,"last-preferred":s,preferred:l}},choose(e){var o,s;let t=e;if(typeof t=="string"&&(t=this.findCountry(t)),!!t){if(((o=this.phone)==null?void 0:o[0])==="+"&&t.iso2&&this.phoneObject.nationalNumber){this.activeCountryCode=t.iso2,this.phone=h.parsePhoneNumber(this.phoneObject.nationalNumber,t.iso2).formatInternational();return}if((s=this.inputOptions)!=null&&s.showDialCode&&t){this.phone=`+${t.dialCode}`;return}this.activeCountryCode=t.iso2,this.emitInput(this.phone)}},cleanInvalidCharacters(){const e=this.phone;if(this.validCharactersOnly){const t=this.phone.match(/[()\-+0-9\s]*/g);this.phone=t.join("")}if(this.customValidate&&this.customValidate instanceof RegExp){const t=this.phone.match(this.customValidate);this.phone=t.join("")}e!==this.phone&&this.emitInput(this.phone)},testCharacters(){return this.validCharactersOnly&&!/^[()\-+0-9\s]*$/.test(this.phone)?!1:this.customValidate?this.testCustomValidate():!0},testCustomValidate(){return this.customValidate instanceof RegExp?this.customValidate.test(this.phone):!1},onInput(){this.$refs.input.setCustomValidity(this.phoneObject.valid?"":this.invalidMsg),this.emitInput(this.phoneObject)},emitInput(e){this.$emit("update:modelValue",e)},onBlur(){this.$emit("blur")},onFocus(){u.setCaretPosition(this.$refs.input,this.phone.length),this.$emit("focus")},onEnter(){this.$emit("enter")},onSpace(){this.$emit("space")},focus(){this.$refs.input.focus()},toggleDropdown(){this.disabled||(this.open=!this.open)},clickedOutside(){this.open=!1},keyboardNav(e){if(e.keyCode===40){e.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=0:this.selectedIndex=Math.min(this.sortedCountries.length-1,this.selectedIndex+1);const t=this.$refs.list.children[this.selectedIndex];t.offsetTop+t.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight&&(this.$refs.list.scrollTop=t.offsetTop-this.$refs.list.clientHeight+t.clientHeight)}else if(e.keyCode===38){e.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=this.sortedCountries.length-1:this.selectedIndex=Math.max(0,this.selectedIndex-1);const t=this.$refs.list.children[this.selectedIndex];t.offsetTop<this.$refs.list.scrollTop&&(this.$refs.list.scrollTop=t.offsetTop)}else if(e.keyCode===13)this.selectedIndex!==null&&this.choose(this.sortedCountries[this.selectedIndex]),this.open=!this.open;else{this.typeToFindInput+=e.key,clearTimeout(this.typeToFindTimer),this.typeToFindTimer=setTimeout(()=>{this.typeToFindInput=""},700);const t=this.sortedCountries.slice(this.preferredCountries.length).findIndex(o=>o.name.toLowerCase().startsWith(this.typeToFindInput));if(t>=0){this.selectedIndex=this.preferredCountries.length+t;const o=this.$refs.list.children[this.selectedIndex],s=o.offsetTop<this.$refs.list.scrollTop,l=o.offsetTop+o.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight;(s||l)&&(this.$refs.list.scrollTop=o.offsetTop-this.$refs.list.clientHeight/2)}}},reset(){this.selectedIndex=this.sortedCountries.map(e=>e.iso2).indexOf(this.activeCountryCode),this.open=!1},setDropdownPosition(){window.innerHeight-this.$refs.rootElement.getBoundingClientRect().bottom>200?this.dropdownOpenDirection="below":this.dropdownOpenDirection="above"}}}),m=["tabindex"],g={class:"flex-nowrap flex flex-v-center p-medium vti__selection"},b=["innerHTML"],v={key:1,class:"vti__country-code"},O=["onClick","onMousemove"],I=["innerHTML"],S={key:1},w=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex"],k={key:0,class:"mn-t-thin mn-b-thin invalid-feedback"};function j(e,t,o,s,l,a){const d=i.resolveDirective("click-outside");return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",{class:i.normalizeClass(["vue3-reactive-tel-input",{"bg-fourth-nano":e.validation},e.$attrs.class,e.rootClass,{disabled:e.disabled},e.classes]),style:i.normalizeStyle([e.rootStyle,e.styles]),ref:"rootElement"},[i.withDirectives((i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass([["vti__dropdown",{open:e.open}],"br-solid br-black-transp br-1px radius-medium"]),tabindex:e.dropdownOptions.tabindex,onKeydown:[t[0]||(t[0]=(...n)=>e.keyboardNav&&e.keyboardNav(...n)),t[2]||(t[2]=i.withKeys((...n)=>e.reset&&e.reset(...n),["esc"]))],onClick:t[1]||(t[1]=(...n)=>e.toggleDropdown&&e.toggleDropdown(...n)),style:i.normalizeStyle([e.dropdownStyle])},[i.createElementVNode("span",g,[e.dropdownOptions.showFlags?(i.openBlock(),i.createElementBlock("span",{key:0,innerHTML:e.activeCountryFlag,class:"mn-r-thin"},null,8,b)):i.createCommentVNode("",!0),e.dropdownOptions.showDialCodeInSelection?(i.openBlock(),i.createElementBlock("span",v," +"+i.toDisplayString(e.activeCountry&&e.activeCountry.dialCode),1)):i.createCommentVNode("",!0)]),i.withDirectives(i.createElementVNode("ul",{ref:"list",class:i.normalizeClass(["bs-black radius-small vti__dropdown-list",e.dropdownOpenDirection]),style:i.normalizeStyle([e.listStyle])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.sortedCountries,(n,p)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(["flex-nowrap flex w-max",["vti__dropdown-item",e.getItemClass(p,n.iso2)]]),key:n.iso2+(n.preferred?"-preferred":""),onClick:c=>e.choose(n),onMousemove:c=>e.selectedIndex=p},[e.dropdownOptions.showFlags?(i.openBlock(),i.createElementBlock("span",{key:0,innerHTML:n.flag,class:"mn-r-thin"},null,8,I)):i.createCommentVNode("",!0),i.createElementVNode("strong",null,i.toDisplayString(n.name),1),e.dropdownOptions.showDialCodeInList?(i.openBlock(),i.createElementBlock("span",S," +"+i.toDisplayString(n.dialCode),1)):i.createCommentVNode("",!0)],42,O))),128))],6),[[i.vShow,e.open]])],46,m)),[[d,e.clickedOutside]]),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[3]||(t[3]=n=>e.phone=n),inputmode:"numeric",pattern:"\\d*",ref:"input",type:e.inputOptions.type,autocomplete:e.inputOptions.autocomplete,autofocus:e.inputOptions.autofocus,class:i.normalizeClass(["vti__input",e.inputOptions.styleClasses,e.inputClass,e.Iclasses]),style:i.normalizeStyle([e.inputStyle,e.Istyles]),disabled:e.disabled,id:e.inputId!==""?e.inputId:e.inputOptions.id,maxlength:e.inputOptions.maxlength,name:e.inputId!==""?e.inputId:e.inputOptions.name,placeholder:e.parsedPlaceholder,readonly:e.inputOptions.readonly,required:e.inputOptions.required,tabindex:e.inputOptions.tabindex,onBlur:t[4]||(t[4]=(...n)=>e.onBlur&&e.onBlur(...n)),onFocus:t[5]||(t[5]=(...n)=>e.onFocus&&e.onFocus(...n)),onInput:t[6]||(t[6]=(...n)=>e.onInput&&e.onInput(...n)),onKeyup:[t[7]||(t[7]=i.withKeys((...n)=>e.onEnter&&e.onEnter(...n),["enter"])),t[8]||(t[8]=i.withKeys((...n)=>e.onSpace&&e.onSpace(...n),["space"]))]},null,46,w),[[i.vModelDynamic,e.phone]]),i.renderSlot(e.$slots,"default",{},void 0,!0)],6),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[e.validation?(i.openBlock(),i.createElementBlock("div",k," * "+i.toDisplayString(e.validation.message),1)):i.createCommentVNode("",!0)]),_:1})],64)}const $=y.default(C,[["render",j],["__scopeId","data-v-a2b07445"]]);exports.default=$;