@ozdao/prometheus-framework 0.2.90 → 0.2.91

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. package/dist/auth.server.js +1 -0
  2. package/dist/auth.server.mjs +1 -0
  3. package/dist/main-BQisDfLk.js +92 -0
  4. package/dist/main-DTlUA63C.mjs +13617 -0
  5. package/dist/main.css +1 -1
  6. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  7. package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
  8. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  9. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -102
  10. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  11. package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
  12. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
  14. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  16. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +17 -16
  18. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -103
  20. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +103 -1
  22. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +1 -36
  24. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +36 -1
  26. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +9 -8
  28. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  30. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  32. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +28 -29
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +65 -65
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +38 -39
  40. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/auth/store/auth.js +35 -37
  42. package/dist/prometheus-framework/src/modules/auth/store/twofa.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/auth/store/twofa.js +3 -3
  44. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  46. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +12 -11
  48. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  50. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  52. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  54. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
  55. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
  56. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
  57. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
  58. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  64. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  68. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  70. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
  72. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +3 -3
  74. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  76. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +4 -3
  78. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +5 -4
  80. package/dist/prometheus-framework/src/modules/middlewares/client/inputs.validation.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/middlewares/client/inputs.validation.js +10 -13
  82. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +3 -3
  84. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +3 -3
  86. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +2 -2
  88. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  90. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  92. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  94. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +2 -2
  96. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +3 -3
  102. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  104. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +5 -4
  106. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
  108. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +6 -5
  110. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
  112. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  116. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
  120. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  122. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  124. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +9 -8
  128. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  132. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  134. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +5 -4
  136. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
  138. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +5 -4
  140. package/dist/prometheus-framework.cjs.js +1 -1
  141. package/dist/prometheus-framework.es.js +1 -1
  142. package/dist/style.css +1 -1
  143. package/dist/web-CXzcKdk4.mjs +54 -0
  144. package/dist/web-D9Cfcy5k.js +1 -0
  145. package/package.json +1 -1
  146. package/src/components/Button/Button.vue +5 -8
  147. package/src/components/FieldPhone/FieldPhone.vue +4 -0
  148. package/src/modules/auth/components/pages/ResetPassword.vue +1 -1
  149. package/src/modules/auth/components/pages/SignIn.vue +3 -3
  150. package/src/modules/auth/components/pages/SignUp.vue +1 -1
  151. package/src/modules/auth/controllers/auth.controller.js +1 -0
  152. package/src/modules/auth/store/auth.js +3 -5
  153. package/src/modules/auth/store/twofa.js +1 -1
  154. package/src/modules/middlewares/client/inputs.validation.js +0 -13
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("../Loader/Loader.vue2.cjs");require("./Button.vue2.cjs");const v=["disabled"],b={key:2,class:"t-semi loading t-black"},m={key:3,class:"error"},y={key:0,class:"button-counter"},k={__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}},emits:["error"],setup(t,{emit:r}){const o=t,i=r,l=e.ref(null),a=e.ref(null),s=e.ref(!1),n=e.ref(!1);async function d(){l.value.style["pointer-events"]="none",a.value=null,s.value=!0;const c=()=>{l.value&&(l.value.classList.replace("bg-second","bg-main"),l.value.style.pointerEvents="auto",s.value=!1,n.value=!1,a.value=null)};try{await o.submit(),l.value.classList.replace("bg-main","bg-second"),s.value=!1,o.showSucces?(n.value=!0,setTimeout(c,500)):c(),o.callback&&setTimeout(()=>o.callback(),o.callbackDelay)}catch(u){i("error",u),l.value.classList.replace("bg-main","bg-fourth-nano"),a.value=o.error,setTimeout(()=>{c(),l.value.classList.replace("bg-fourth-nano","bg-main")},1330)}}return(c,u)=>(e.openBlock(),e.createElementBlock("button",{onClick:e.withModifiers(d,["stop"]),disabled:t.validation,ref_key:"button",ref:l,class:"button"},[e.createVNode(e.Transition,{name:"moveFromTopAbsolute"},{default:e.withCtx(()=>[!s.value&&!a.value&&!n.value||!t.showLoader?e.renderSlot(c.$slots,"default",{key:0}):s.value&&!a.value&&t.showLoader?(e.openBlock(),e.createBlock(f.default,{key:1,class:"pos-relative pos-t-0 pos-l-0 loading"})):n.value&&t.showSucces?(e.openBlock(),e.createElementBlock("span",b,e.toDisplayString(t.text.success),1)):a.value?(e.openBlock(),e.createElementBlock("span",m,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0)]),_:3}),t.counter?(e.openBlock(),e.createElementBlock("p",y,e.toDisplayString(t.counter),1)):e.createCommentVNode("",!0)],8,v))}};exports.default=k;
@@ -1 +1,94 @@
1
-
1
+ import { ref as n, openBlock as c, createElementBlock as r, withModifiers as y, createVNode as k, Transition as h, withCtx as p, renderSlot as g, createBlock as B, toDisplayString as i, createCommentVNode as f } from "vue";
2
+ import w from "../Loader/Loader.vue2.js";
3
+ import "./Button.vue2.js";
4
+ const L = ["disabled"], S = {
5
+ key: 2,
6
+ class: "t-semi loading t-black"
7
+ }, T = {
8
+ key: 3,
9
+ class: "error"
10
+ }, x = {
11
+ key: 0,
12
+ class: "button-counter"
13
+ }, j = {
14
+ __name: "Button",
15
+ props: {
16
+ submit: {
17
+ type: Function,
18
+ default: async () => {
19
+ console.log("Button click.");
20
+ }
21
+ },
22
+ text: {
23
+ type: Object,
24
+ default: (e) => (console.log(e), e = {
25
+ ...e.text,
26
+ success: "✔",
27
+ error: "✖"
28
+ })
29
+ },
30
+ counter: {
31
+ type: Object
32
+ },
33
+ callback: {
34
+ type: Function,
35
+ default: async () => {
36
+ console.log("Button callback.");
37
+ }
38
+ },
39
+ callbackDelay: {
40
+ type: Number,
41
+ default: 750
42
+ },
43
+ showSucces: {
44
+ type: Boolean,
45
+ default: !0
46
+ },
47
+ showLoader: {
48
+ type: Boolean,
49
+ default: !0
50
+ },
51
+ validation: {
52
+ type: Boolean,
53
+ default: !1
54
+ }
55
+ },
56
+ emits: ["error"],
57
+ setup(e, { emit: b }) {
58
+ const l = e, v = b, t = n(null), a = n(null), o = n(!1), u = n(!1);
59
+ async function m() {
60
+ t.value.style["pointer-events"] = "none", a.value = null, o.value = !0;
61
+ const s = () => {
62
+ t.value && (t.value.classList.replace("bg-second", "bg-main"), t.value.style.pointerEvents = "auto", o.value = !1, u.value = !1, a.value = null);
63
+ };
64
+ try {
65
+ await l.submit(), t.value.classList.replace("bg-main", "bg-second"), o.value = !1, l.showSucces ? (u.value = !0, setTimeout(s, 500)) : s(), l.callback && setTimeout(() => l.callback(), l.callbackDelay);
66
+ } catch (d) {
67
+ v("error", d), t.value.classList.replace("bg-main", "bg-fourth-nano"), a.value = l.error, setTimeout(() => {
68
+ s(), t.value.classList.replace("bg-fourth-nano", "bg-main");
69
+ }, 1330);
70
+ }
71
+ }
72
+ return (s, d) => (c(), r("button", {
73
+ onClick: y(m, ["stop"]),
74
+ disabled: e.validation,
75
+ ref_key: "button",
76
+ ref: t,
77
+ class: "button"
78
+ }, [
79
+ k(h, { name: "moveFromTopAbsolute" }, {
80
+ default: p(() => [
81
+ !o.value && !a.value && !u.value || !e.showLoader ? g(s.$slots, "default", { key: 0 }) : o.value && !a.value && e.showLoader ? (c(), B(w, {
82
+ key: 1,
83
+ class: "pos-relative pos-t-0 pos-l-0 loading"
84
+ })) : u.value && e.showSucces ? (c(), r("span", S, i(e.text.success), 1)) : a.value ? (c(), r("span", T, i(a.value), 1)) : f("", !0)
85
+ ]),
86
+ _: 3
87
+ }),
88
+ e.counter ? (c(), r("p", x, i(e.counter), 1)) : f("", !0)
89
+ ], 8, L));
90
+ }
91
+ };
92
+ export {
93
+ j as default
94
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Button.vue.cjs");const f=["disabled"],v={key:1,class:"loading"},b=e.createElementVNode("svg",{class:"i-regular",width:"135",height:"140",viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:"#fff"},null,-1),m=[b],y={key:2,class:"t-semi loading t-black"},k={key:3,class:"error"},g={key:0,class:"button-counter"},h={__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}},emits:["error"],setup(t,{emit:r}){const o=t,i=r,l=e.ref(null),a=e.ref(null),s=e.ref(!1),n=e.ref(!1);async function d(){l.value.style["pointer-events"]="none",a.value=null,s.value=!0;const c=()=>{l.value&&(l.value.classList.replace("bg-second","bg-main"),l.value.style.pointerEvents="auto",s.value=!1,n.value=!1,a.value=null)};try{await o.submit(),l.value.classList.replace("bg-main","bg-second"),s.value=!1,o.showSucces?(n.value=!0,setTimeout(c,500)):c(),o.callback&&setTimeout(()=>o.callback(),o.callbackDelay)}catch(u){i("error",u),l.value.classList.replace("bg-main","bg-fourth-nano"),a.value=o.error,setTimeout(()=>{c(),l.value.classList.replace("bg-fourth-nano","bg-main")},1330)}}return(c,u)=>(e.openBlock(),e.createElementBlock("button",{onClick:e.withModifiers(d,["stop"]),disabled:t.validation,ref_key:"button",ref:l,class:"button"},[e.createVNode(e.Transition,{name:"moveFromTopAbsolute"},{default:e.withCtx(()=>[!s.value&&!a.value&&!n.value||!t.showLoader?e.renderSlot(c.$slots,"default",{key:0}):s.value&&!a.value&&t.showLoader?(e.openBlock(),e.createElementBlock("span",v,m)):n.value&&t.showSucces?(e.openBlock(),e.createElementBlock("span",y,e.toDisplayString(t.text.success),1)):a.value?(e.openBlock(),e.createElementBlock("span",k,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0)]),_:3}),t.counter?(e.openBlock(),e.createElementBlock("p",g,e.toDisplayString(t.counter),1)):e.createCommentVNode("",!0)],8,f))}};exports.default=h;
1
+ "use strict";
@@ -1,102 +1 @@
1
- import { ref as r, openBlock as n, createElementBlock as c, withModifiers as h, createVNode as y, Transition as g, withCtx as k, renderSlot as p, toDisplayString as i, createCommentVNode as f, createElementVNode as w } from "vue";
2
- import "./Button.vue.js";
3
- const B = ["disabled"], L = {
4
- key: 1,
5
- class: "loading"
6
- }, _ = /* @__PURE__ */ w("svg", {
7
- class: "i-regular",
8
- width: "135",
9
- height: "140",
10
- viewBox: "0 0 135 140",
11
- xmlns: "http://www.w3.org/2000/svg",
12
- fill: "#fff"
13
- }, null, -1), S = [
14
- _
15
- ], x = {
16
- key: 2,
17
- class: "t-semi loading t-black"
18
- }, T = {
19
- key: 3,
20
- class: "error"
21
- }, N = {
22
- key: 0,
23
- class: "button-counter"
24
- }, F = {
25
- __name: "Button",
26
- props: {
27
- submit: {
28
- type: Function,
29
- default: async () => {
30
- console.log("Button click.");
31
- }
32
- },
33
- text: {
34
- type: Object,
35
- default: (e) => (console.log(e), e = {
36
- ...e.text,
37
- success: "✔",
38
- error: "✖"
39
- })
40
- },
41
- counter: {
42
- type: Object
43
- },
44
- callback: {
45
- type: Function,
46
- default: async () => {
47
- console.log("Button callback.");
48
- }
49
- },
50
- callbackDelay: {
51
- type: Number,
52
- default: 750
53
- },
54
- showSucces: {
55
- type: Boolean,
56
- default: !0
57
- },
58
- showLoader: {
59
- type: Boolean,
60
- default: !0
61
- },
62
- validation: {
63
- type: Boolean,
64
- default: !1
65
- }
66
- },
67
- emits: ["error"],
68
- setup(e, { emit: v }) {
69
- const l = e, b = v, t = r(null), a = r(null), s = r(!1), u = r(!1);
70
- async function m() {
71
- t.value.style["pointer-events"] = "none", a.value = null, s.value = !0;
72
- const o = () => {
73
- t.value && (t.value.classList.replace("bg-second", "bg-main"), t.value.style.pointerEvents = "auto", s.value = !1, u.value = !1, a.value = null);
74
- };
75
- try {
76
- await l.submit(), t.value.classList.replace("bg-main", "bg-second"), s.value = !1, l.showSucces ? (u.value = !0, setTimeout(o, 500)) : o(), l.callback && setTimeout(() => l.callback(), l.callbackDelay);
77
- } catch (d) {
78
- b("error", d), t.value.classList.replace("bg-main", "bg-fourth-nano"), a.value = l.error, setTimeout(() => {
79
- o(), t.value.classList.replace("bg-fourth-nano", "bg-main");
80
- }, 1330);
81
- }
82
- }
83
- return (o, d) => (n(), c("button", {
84
- onClick: h(m, ["stop"]),
85
- disabled: e.validation,
86
- ref_key: "button",
87
- ref: t,
88
- class: "button"
89
- }, [
90
- y(g, { name: "moveFromTopAbsolute" }, {
91
- default: k(() => [
92
- !s.value && !a.value && !u.value || !e.showLoader ? p(o.$slots, "default", { key: 0 }) : s.value && !a.value && e.showLoader ? (n(), c("span", L, S)) : u.value && e.showSucces ? (n(), c("span", x, i(e.text.success), 1)) : a.value ? (n(), c("span", T, i(a.value), 1)) : f("", !0)
93
- ]),
94
- _: 3
95
- }),
96
- e.counter ? (n(), c("p", N, i(e.counter), 1)) : f("", !0)
97
- ], 8, B));
98
- }
99
- };
100
- export {
101
- F as default
102
- };
1
+
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Field.vue2.cjs");const u=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),r={key:0,class:"t-transp mn-r-small"},c={class:"w-100"},m=["type","value","placeholder","tabindex","disabled"],b=["value","placeholder","tabindex","disabled"],f={key:1,class:"t-transp mn-l-small"},v={key:0,class:"mn-t-thin mn-b-thin mn-b-thin invalid-feedback"},k={__name:"Field",props:{label:null,symbol:null,type:"text",placeholder:"Enter something here",field:null,value:null,validation:!1,disabled:null,tabindex:-1},emits:["update:field","focus","blur"],setup(l,{emit:s}){const a=s,d=l;d.value&&a("update:field",d.value);const i=e.ref(d.field);return(o,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass([[o.$attrs.class,{"bg-fourth-nano":l.validation}],"flex-center flex-nowrap flex"])},[l.label?(e.openBlock(),e.createElementBlock("div",r,[e.createElementVNode("span",null,e.toDisplayString(l.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",c,[l.type!=="textarea"?(e.openBlock(),e.createElementBlock("input",{key:0,onInput:t[0]||(t[0]=n=>i.value=a("update:field",n.target.value)),onFocus:t[1]||(t[1]=n=>a("focus",n)),onBlur:t[2]||(t[2]=n=>a("blur",n)),type:l.type,class:"w-100",value:l.field,placeholder:l.placeholder,tabindex:l.tabindex,disabled:l.disabled},null,40,m)):(e.openBlock(),e.createElementBlock("textarea",{key:1,onInput:t[3]||(t[3]=n=>i.value=a("update:field",n.target.value)),onFocus:t[4]||(t[4]=n=>a("focus",n)),onBlur:t[5]||(t[5]=n=>a("blur",n)),class:"w-100",style:{resize:"vertical"},value:l.field,placeholder:l.placeholder,tabindex:l.tabindex,disabled:l.disabled},null,40,b))]),e.renderSlot(o.$slots,"default",{},void 0,!0),l.symbol?(e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("span",null,e.toDisplayString(l.symbol),1)])):e.createCommentVNode("",!0)],2),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[l.validation?(e.openBlock(),e.createElementBlock("div",v," * "+e.toDisplayString(l.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64))}},y=u.default(k,[["__scopeId","data-v-47c78b3c"]]);exports.default=y;
@@ -1 +1,84 @@
1
-
1
+ import { ref as f, openBlock as n, createElementBlock as d, Fragment as v, createElementVNode as i, normalizeClass as c, toDisplayString as o, createCommentVNode as u, renderSlot as x, createVNode as y, Transition as h, withCtx as k } from "vue";
2
+ import "./Field.vue2.js";
3
+ import g from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const w = {
5
+ key: 0,
6
+ class: "t-transp mn-r-small"
7
+ }, F = { class: "w-100" }, B = ["type", "value", "placeholder", "tabindex", "disabled"], p = ["value", "placeholder", "tabindex", "disabled"], C = {
8
+ key: 1,
9
+ class: "t-transp mn-l-small"
10
+ }, E = {
11
+ key: 0,
12
+ class: "mn-t-thin mn-b-thin mn-b-thin invalid-feedback"
13
+ }, I = {
14
+ __name: "Field",
15
+ props: {
16
+ label: null,
17
+ symbol: null,
18
+ type: "text",
19
+ placeholder: "Enter something here",
20
+ field: null,
21
+ value: null,
22
+ validation: !1,
23
+ disabled: null,
24
+ tabindex: -1
25
+ },
26
+ emits: ["update:field", "focus", "blur"],
27
+ setup(e, { emit: b }) {
28
+ const a = b, s = e;
29
+ s.value && a("update:field", s.value);
30
+ const r = f(s.field);
31
+ return (m, l) => (n(), d(v, null, [
32
+ i("div", {
33
+ class: c([[
34
+ m.$attrs.class,
35
+ {
36
+ "bg-fourth-nano": e.validation
37
+ }
38
+ ], "flex-center flex-nowrap flex"])
39
+ }, [
40
+ e.label ? (n(), d("div", w, [
41
+ i("span", null, o(e.label), 1)
42
+ ])) : u("", !0),
43
+ i("div", F, [
44
+ e.type !== "textarea" ? (n(), d("input", {
45
+ key: 0,
46
+ onInput: l[0] || (l[0] = (t) => r.value = a("update:field", t.target.value)),
47
+ onFocus: l[1] || (l[1] = (t) => a("focus", t)),
48
+ onBlur: l[2] || (l[2] = (t) => a("blur", t)),
49
+ type: e.type,
50
+ class: "w-100",
51
+ value: e.field,
52
+ placeholder: e.placeholder,
53
+ tabindex: e.tabindex,
54
+ disabled: e.disabled
55
+ }, null, 40, B)) : (n(), d("textarea", {
56
+ key: 1,
57
+ onInput: l[3] || (l[3] = (t) => r.value = a("update:field", t.target.value)),
58
+ onFocus: l[4] || (l[4] = (t) => a("focus", t)),
59
+ onBlur: l[5] || (l[5] = (t) => a("blur", t)),
60
+ class: "w-100",
61
+ style: { resize: "vertical" },
62
+ value: e.field,
63
+ placeholder: e.placeholder,
64
+ tabindex: e.tabindex,
65
+ disabled: e.disabled
66
+ }, null, 40, p))
67
+ ]),
68
+ x(m.$slots, "default", {}, void 0, !0),
69
+ e.symbol ? (n(), d("div", C, [
70
+ i("span", null, o(e.symbol), 1)
71
+ ])) : u("", !0)
72
+ ], 2),
73
+ y(h, { name: "fade" }, {
74
+ default: k(() => [
75
+ e.validation ? (n(), d("div", E, " * " + o(e.validation.message), 1)) : u("", !0)
76
+ ]),
77
+ _: 1
78
+ })
79
+ ], 64));
80
+ }
81
+ }, S = /* @__PURE__ */ g(I, [["__scopeId", "data-v-47c78b3c"]]);
82
+ export {
83
+ S as default
84
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Field.vue.cjs");const u=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),r={key:0,class:"t-transp mn-r-small"},c={class:"w-100"},m=["type","value","placeholder","tabindex","disabled"],b=["value","placeholder","tabindex","disabled"],f={key:1,class:"t-transp mn-l-small"},v={key:0,class:"mn-t-thin mn-b-thin mn-b-thin invalid-feedback"},k={__name:"Field",props:{label:null,symbol:null,type:"text",placeholder:"Enter something here",field:null,value:null,validation:!1,disabled:null,tabindex:-1},emits:["update:field","focus","blur"],setup(l,{emit:s}){const a=s,d=l;d.value&&a("update:field",d.value);const i=e.ref(d.field);return(o,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass([[o.$attrs.class,{"bg-fourth-nano":l.validation}],"flex-center flex-nowrap flex"])},[l.label?(e.openBlock(),e.createElementBlock("div",r,[e.createElementVNode("span",null,e.toDisplayString(l.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",c,[l.type!=="textarea"?(e.openBlock(),e.createElementBlock("input",{key:0,onInput:t[0]||(t[0]=n=>i.value=a("update:field",n.target.value)),onFocus:t[1]||(t[1]=n=>a("focus",n)),onBlur:t[2]||(t[2]=n=>a("blur",n)),type:l.type,class:"w-100",value:l.field,placeholder:l.placeholder,tabindex:l.tabindex,disabled:l.disabled},null,40,m)):(e.openBlock(),e.createElementBlock("textarea",{key:1,onInput:t[3]||(t[3]=n=>i.value=a("update:field",n.target.value)),onFocus:t[4]||(t[4]=n=>a("focus",n)),onBlur:t[5]||(t[5]=n=>a("blur",n)),class:"w-100",style:{resize:"vertical"},value:l.field,placeholder:l.placeholder,tabindex:l.tabindex,disabled:l.disabled},null,40,b))]),e.renderSlot(o.$slots,"default",{},void 0,!0),l.symbol?(e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("span",null,e.toDisplayString(l.symbol),1)])):e.createCommentVNode("",!0)],2),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[l.validation?(e.openBlock(),e.createElementBlock("div",v," * "+e.toDisplayString(l.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64))}},y=u.default(k,[["__scopeId","data-v-47c78b3c"]]);exports.default=y;
1
+ "use strict";
@@ -1,84 +1 @@
1
- import { ref as f, openBlock as n, createElementBlock as d, Fragment as v, createElementVNode as i, normalizeClass as c, toDisplayString as o, createCommentVNode as u, renderSlot as x, createVNode as y, Transition as h, withCtx as k } from "vue";
2
- import "./Field.vue.js";
3
- import g from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const w = {
5
- key: 0,
6
- class: "t-transp mn-r-small"
7
- }, F = { class: "w-100" }, B = ["type", "value", "placeholder", "tabindex", "disabled"], p = ["value", "placeholder", "tabindex", "disabled"], C = {
8
- key: 1,
9
- class: "t-transp mn-l-small"
10
- }, E = {
11
- key: 0,
12
- class: "mn-t-thin mn-b-thin mn-b-thin invalid-feedback"
13
- }, I = {
14
- __name: "Field",
15
- props: {
16
- label: null,
17
- symbol: null,
18
- type: "text",
19
- placeholder: "Enter something here",
20
- field: null,
21
- value: null,
22
- validation: !1,
23
- disabled: null,
24
- tabindex: -1
25
- },
26
- emits: ["update:field", "focus", "blur"],
27
- setup(e, { emit: b }) {
28
- const a = b, s = e;
29
- s.value && a("update:field", s.value);
30
- const r = f(s.field);
31
- return (m, l) => (n(), d(v, null, [
32
- i("div", {
33
- class: c([[
34
- m.$attrs.class,
35
- {
36
- "bg-fourth-nano": e.validation
37
- }
38
- ], "flex-center flex-nowrap flex"])
39
- }, [
40
- e.label ? (n(), d("div", w, [
41
- i("span", null, o(e.label), 1)
42
- ])) : u("", !0),
43
- i("div", F, [
44
- e.type !== "textarea" ? (n(), d("input", {
45
- key: 0,
46
- onInput: l[0] || (l[0] = (t) => r.value = a("update:field", t.target.value)),
47
- onFocus: l[1] || (l[1] = (t) => a("focus", t)),
48
- onBlur: l[2] || (l[2] = (t) => a("blur", t)),
49
- type: e.type,
50
- class: "w-100",
51
- value: e.field,
52
- placeholder: e.placeholder,
53
- tabindex: e.tabindex,
54
- disabled: e.disabled
55
- }, null, 40, B)) : (n(), d("textarea", {
56
- key: 1,
57
- onInput: l[3] || (l[3] = (t) => r.value = a("update:field", t.target.value)),
58
- onFocus: l[4] || (l[4] = (t) => a("focus", t)),
59
- onBlur: l[5] || (l[5] = (t) => a("blur", t)),
60
- class: "w-100",
61
- style: { resize: "vertical" },
62
- value: e.field,
63
- placeholder: e.placeholder,
64
- tabindex: e.tabindex,
65
- disabled: e.disabled
66
- }, null, 40, p))
67
- ]),
68
- x(m.$slots, "default", {}, void 0, !0),
69
- e.symbol ? (n(), d("div", C, [
70
- i("span", null, o(e.symbol), 1)
71
- ])) : u("", !0)
72
- ], 2),
73
- y(h, { name: "fade" }, {
74
- default: k(() => [
75
- e.validation ? (n(), d("div", E, " * " + o(e.validation.message), 1)) : u("", !0)
76
- ]),
77
- _: 1
78
- })
79
- ], 64));
80
- }
81
- }, S = /* @__PURE__ */ g(I, [["__scopeId", "data-v-47c78b3c"]]);
82
- export {
83
- S as default
84
- };
1
+
@@ -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"),S={class:"pd-thin radius-extra flex-nowrap flex"},w=["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(s,{emit:y}){const t=s,{t:F,locale:c}=B.useI18n();let r=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(""),o=e.ref(!0),v=null;const g=y;function b(){g("action")}function T(a){g("update:input",a),f.value=a}function m(){r.value=(r.value+1)%t.placeholderTexts[c.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="",h())}function h(){let a=t.placeholderTexts[c.value][r.value],l=0,u=!1;v=setInterval(()=>{o.value=!o.value},200),d.value=setInterval(()=>{i.value&&(u?(n.value=n.value.slice(0,-1),n.value=a.substring(0,l)+(o.value&&l%2?"|":""),l--):(n.value=a.substring(0,l)+(o.value&&l%2?"|":""),l++),l>a.length&&t.loopTyping&&setTimeout(()=>{u=!0,n.value=a.substring(0,l)},333),l===0&&u&&(u=!1,m(),a=t.placeholderTexts[c.value][r.value]))},t.typingSpeed)}return e.onMounted(()=>{t.enableTyping&&h()}),e.watchEffect(()=>{i.value||(clearInterval(d.value),clearInterval(v))}),(a,l)=>(e.openBlock(),e.createElementBlock("div",S,[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:m,onFocus:I,onBlur:x,class:"w-100 p-medium t-regular uppercase pd-small"},null,8,["field","placeholder"]),s.action?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:b,class:"t-medium radius-big uppercase cursor-pointer pd-l-semi pd-r-semi w-max hover-bg-fifth t-semi transition-linear transition-timing-1 t-black bg-main",innerHTML:s.action},null,8,w)):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.vue.cjs"),B=require("vue-i18n"),S={class:"pd-thin radius-extra flex-nowrap flex"},w=["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(s,{emit:y}){const t=s,{t:F,locale:c}=B.useI18n();let r=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(""),o=e.ref(!0),v=null;const g=y;function b(){g("action")}function T(a){g("update:input",a),f.value=a}function m(){r.value=(r.value+1)%t.placeholderTexts[c.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="",h())}function h(){let a=t.placeholderTexts[c.value][r.value],l=0,u=!1;v=setInterval(()=>{o.value=!o.value},200),d.value=setInterval(()=>{i.value&&(u?(n.value=n.value.slice(0,-1),n.value=a.substring(0,l)+(o.value&&l%2?"|":""),l--):(n.value=a.substring(0,l)+(o.value&&l%2?"|":""),l++),l>a.length&&t.loopTyping&&setTimeout(()=>{u=!0,n.value=a.substring(0,l)},333),l===0&&u&&(u=!1,m(),a=t.placeholderTexts[c.value][r.value]))},t.typingSpeed)}return e.onMounted(()=>{t.enableTyping&&h()}),e.watchEffect(()=>{i.value||(clearInterval(d.value),clearInterval(v))}),(a,l)=>(e.openBlock(),e.createElementBlock("div",S,[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:m,onFocus:I,onBlur:x,class:"w-100 p-medium t-regular uppercase pd-small"},null,8,["field","placeholder"]),s.action?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:b,class:"t-medium radius-big uppercase cursor-pointer pd-l-semi pd-r-semi w-max hover-bg-fifth t-semi transition-linear transition-timing-1 t-black bg-main",innerHTML:s.action},null,8,w)):e.createCommentVNode("",!0)]))}};exports.default=_;
@@ -1,5 +1,5 @@
1
1
  import { ref as i, onMounted as S, watchEffect as F, openBlock as T, createElementBlock as b, createVNode as C, unref as v, isRef as H, createCommentVNode as _ } from "vue";
2
- import L from "../Field/Field.vue2.js";
2
+ import L from "../Field/Field.vue.js";
3
3
  import { useI18n as M } from "vue-i18n";
4
4
  const N = { class: "pd-thin radius-extra flex-nowrap flex" }, V = ["innerHTML"], P = {
5
5
  __name: "FieldBig",
@@ -1 +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("./FieldPhone.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:"FieldPhone",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-thin"]),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-nano"},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-6cc570f0"]]);exports.default=Ce;
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("./FieldPhone.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:"FieldPhone",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","change","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("change",u.value.number),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-thin"]),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-nano"},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-550fb753"]]);exports.default=Ce;
@@ -1,4 +1,4 @@
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";
1
+ import { ref as d, reactive as ge, onMounted as Ce, 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
2
  import je from "./click-outside.js";
3
3
  import Ae from "./all-countries.js";
4
4
  import "./FieldPhone.vue2.js";
@@ -72,6 +72,7 @@ const Be = ["tabindex"], Ee = { class: "flex-nowrap flex flex-v-center p-medium
72
72
  },
73
73
  emits: [
74
74
  "update:modelValue",
75
+ "change",
75
76
  "validate",
76
77
  "country-changed",
77
78
  "open",
@@ -84,12 +85,12 @@ const Be = ["tabindex"], Ee = { class: "flex-nowrap flex flex-v-center p-medium
84
85
  setup(l, { emit: W }) {
85
86
  let G = je;
86
87
  const t = l, c = W;
87
- d(5), d(5), Ce({
88
+ d(5), d(5), ge({
88
89
  action: null,
89
90
  amount: null
90
91
  });
91
92
  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
+ Ce(async () => {
93
94
  t.modelValue && (o.value = t.modelValue), ue(), le().then(() => {
94
95
  var e;
95
96
  !o.value && ((e = t.inputOptions) != null && e.showDialCode) && v.value && (o.value = `+${v.value}`), c("validate", u.value);
@@ -97,9 +98,9 @@ const Be = ["tabindex"], Ee = { class: "flex-nowrap flex flex-v-center p-medium
97
98
  J.value = !0;
98
99
  });
99
100
  });
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
+ const g = p(() => T(v.value)), Q = p(() => g.value ? g.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
102
  ({ 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
+ ) : t.allCountries), C = p(() => [...ae(t.preferredCountries).map((n) => ({ ...n, preferred: !0 })), ...F.value]), u = p(() => {
103
104
  var j, q, z;
104
105
  let e = {};
105
106
  ((j = o.value) == null ? void 0 : j[0]) === "+" ? e = H(o.value) || {} : e = H(o.value, v.value) || {};
@@ -109,11 +110,11 @@ const Be = ["tabindex"], Ee = { class: "flex-nowrap flex flex-v-center p-medium
109
110
  ...a,
110
111
  countryCode: e.country,
111
112
  valid: r,
112
- country: C.value,
113
+ country: g.value,
113
114
  formatted: O
114
115
  };
115
116
  }), 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
+ h(g, (e, n) => {
117
118
  if (!e && (n != null && n.iso2)) {
118
119
  v.value = n.iso2;
119
120
  return;
@@ -223,7 +224,7 @@ const Be = ["tabindex"], Ee = { class: "flex-nowrap flex flex-v-center p-medium
223
224
  E.value.setCustomValidity(u.valid ? "" : t.invalidMsg), k(o.value);
224
225
  }
225
226
  function k(e) {
226
- c("update:modelValue", e), u.value.valid ? c("country", u.value.number) : c("country", null);
227
+ c("update:modelValue", e), u.value.valid ? (c("change", u.value.number), c("country", u.value.number)) : c("country", null);
227
228
  }
228
229
  function se() {
229
230
  c("blur");
@@ -244,16 +245,16 @@ const Be = ["tabindex"], Ee = { class: "flex-nowrap flex flex-v-center p-medium
244
245
  f.value = !1;
245
246
  }
246
247
  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
+ e.keyCode === 40 ? (e.preventDefault(), f.value = !0, i.value = i.value === null ? 0 : Math.min(C.value.length - 1, i.value + 1), S(() => {
248
249
  const n = s.value.children[i.value];
249
250
  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
+ })) : e.keyCode === 38 ? (e.preventDefault(), f.value = !0, i.value = i.value === null ? C.value.length - 1 : Math.max(0, i.value - 1), S(() => {
251
252
  const n = s.value.children[i.value];
252
253
  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
+ })) : e.keyCode === 13 ? (e.preventDefault(), i.value !== null && b(C.value[i.value]), f.value = !f.value) : (B.value += e.key, clearTimeout(V), V = setTimeout(() => {
254
255
  B.value = "";
255
256
  }, 700), S(() => {
256
- const n = g.value.slice(t.preferredCountries.length).findIndex((a) => a.name.toLowerCase().startsWith(B.value));
257
+ const n = C.value.slice(t.preferredCountries.length).findIndex((a) => a.name.toLowerCase().startsWith(B.value));
257
258
  if (n >= 0) {
258
259
  i.value = t.preferredCountries.length + n;
259
260
  const a = s.value.children[i.value];
@@ -262,7 +263,7 @@ const Be = ["tabindex"], Ee = { class: "flex-nowrap flex flex-v-center p-medium
262
263
  }));
263
264
  }
264
265
  function me() {
265
- i.value = g.value.map((e) => e.iso2).indexOf(v.value), f.value = !1;
266
+ i.value = C.value.map((e) => e.iso2).indexOf(v.value), f.value = !1;
266
267
  }
267
268
  function he() {
268
269
  const n = window.innerHeight - N.value.getBoundingClientRect().bottom > 200;
@@ -300,7 +301,7 @@ const Be = ["tabindex"], Ee = { class: "flex-nowrap flex flex-v-center p-medium
300
301
  innerHTML: Q.value,
301
302
  class: "mn-r-nano"
302
303
  }, null, 8, Fe)) : x("", !0),
303
- l.dropdownOptions.showDialCodeInSelection ? (y(), m("span", Me, " +" + D(C.value && C.value.dialCode), 1)) : x("", !0)
304
+ l.dropdownOptions.showDialCodeInSelection ? (y(), m("span", Me, " +" + D(g.value && g.value.dialCode), 1)) : x("", !0)
304
305
  ]),
305
306
  M(w("ul", {
306
307
  ref_key: "list",
@@ -308,7 +309,7 @@ const Be = ["tabindex"], Ee = { class: "flex-nowrap flex flex-v-center p-medium
308
309
  class: I(["bs-black radius-small vti__dropdown-list", L.value]),
309
310
  style: A([l.listStyle])
310
311
  }, [
311
- (y(!0), m(K, null, be(g.value, (a, r) => (y(), m("li", {
312
+ (y(!0), m(K, null, be(C.value, (a, r) => (y(), m("li", {
312
313
  class: I(["flex-nowrap flex w-max", ["vti__dropdown-item", oe(r, a.iso2)]]),
313
314
  key: a.iso2 + (a.preferred ? "-preferred" : ""),
314
315
  onClick: (O) => b(a),
@@ -367,7 +368,7 @@ const Be = ["tabindex"], Ee = { class: "flex-nowrap flex flex-v-center p-medium
367
368
  })
368
369
  ], 64));
369
370
  }
370
- }, Ge = /* @__PURE__ */ De(Ne, [["__scopeId", "data-v-6cc570f0"]]);
371
+ }, Ge = /* @__PURE__ */ De(Ne, [["__scopeId", "data-v-550fb753"]]);
371
372
  export {
372
373
  Ge as default
373
374
  };
@@ -1 +1 @@
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.vue2.cjs");const g=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),B={key:0,class:"t-transp mn-r-small"},b={class:"w-100"},w=["onClick"],S={key:0,class:"w-100"},_={key:0,class:"mn-t-thin invalid-feedback"},C={__name:"Select",props:{label:String,placeholder:{type:String,default:"Please select an item"},select:[String,Object],property:String,options:{type:Array,default:()=>[]},validation:Boolean},emits:["update:select","focus","blur"],setup(n,{emit:m}){let f=y.default;const i=m,t=n,a=e.ref(!1),o=e.ref(t.property?d(t.select,t.property,t.options):t.select),v=e.computed(()=>t.select?t.options.filter(l=>l!==t.select):t.options);e.watch(()=>t.select,l=>{o.value=t.property?d(t.select,t.property,t.options):t.select});const u=()=>{a.value=!a.value,i(a.value?"focus":"blur")};function k(){a.value=!1}const h=l=>{o.value=l,u(),t.property?i("update:select",o.value[t.property]):i("update:select",o.value)};function d(l,p,c){for(const s of c)if(s[p]===l||s===l)return s;return null}return(l,p)=>{var c,s;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.withDirectives((e.openBlock(),e.createElementBlock("div",{onClick:e.withModifiers(u,["stop"]),class:e.normalizeClass([l.$attrs.class,"cursor-pointer flex-v-center flex-nowrap flex pos-relative"])},[n.label?(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("span",null,e.toDisplayString(n.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("li",b,[e.createElementVNode("span",null,e.toDisplayString((c=o.value)!=null&&c.name?(s=o.value)==null?void 0:s.name:o.value||n.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(v.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,w))),256))],2),[[e.vShow,a.value]])]),_:1})],2)),[[e.unref(f),k]]),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[n.validation?(e.openBlock(),e.createElementBlock("div",_," * "+e.toDisplayString(n.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64)}}},E=g.default(C,[["__scopeId","data-v-bf25c24d"]]);exports.default=E;
1
+ "use strict";