@ozdao/prometheus-framework 0.2.81 → 0.2.83

Sign up to get free protection for your applications and to get access to all the features.
Files changed (388) hide show
  1. package/dist/auth.server.js +1 -1
  2. package/dist/auth.server.mjs +1 -1
  3. package/dist/community.server.js +3 -3
  4. package/dist/community.server.mjs +3 -3
  5. package/dist/credentials.schema-B-KD_ozQ.js +9 -0
  6. package/dist/credentials.schema-C9dmNy7o.mjs +10 -0
  7. package/dist/credentials.schema-CDZCKfEI.mjs +106 -0
  8. package/dist/credentials.schema-CfhPcsuI.js +105 -0
  9. package/dist/events.server.js +4 -15
  10. package/dist/events.server.mjs +3 -14
  11. package/dist/files.server.js +1 -1
  12. package/dist/files.server.mjs +1 -1
  13. package/dist/gallery.server.js +1 -1
  14. package/dist/gallery.server.mjs +1 -1
  15. package/dist/index-B6a1mPgp.mjs +217 -0
  16. package/dist/index-BCCiEK_u.js +216 -0
  17. package/dist/main-8N2Jmsuk.js +91 -0
  18. package/dist/main-CkeuHuCY.mjs +13619 -0
  19. package/dist/main.css +1 -1
  20. package/dist/metadata.schema-Cu_mPkjE.js +77 -0
  21. package/dist/metadata.schema-cbFgazeK.mjs +78 -0
  22. package/dist/middlewares.server.js +1 -1
  23. package/dist/middlewares.server.mjs +1 -1
  24. package/dist/node_modules/@googlemaps/js-api-loader/dist/index.cjs +1 -0
  25. package/dist/node_modules/@googlemaps/js-api-loader/dist/index.js +238 -0
  26. package/dist/orders.server.js +592 -0
  27. package/dist/orders.server.mjs +593 -0
  28. package/dist/organizations.server.js +295 -131
  29. package/dist/organizations.server.mjs +295 -131
  30. package/dist/products.server.js +2 -2
  31. package/dist/products.server.mjs +2 -2
  32. package/dist/profile.schema-24ZpZQJe.mjs +25 -0
  33. package/dist/profile.schema-CkOhhf37.js +24 -0
  34. package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Address/Address.vue2.js +33 -24
  36. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/components/Block/Block.vue.js +23 -20
  38. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -225
  40. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  41. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +102 -1
  42. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +71 -60
  44. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -84
  46. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  47. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -1
  48. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  50. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +325 -340
  52. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +2 -2
  54. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  55. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +53 -44
  56. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  57. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +41 -40
  58. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  59. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +37 -31
  60. package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +18 -19
  62. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -36
  64. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  65. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +36 -1
  66. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
  68. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  69. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
  70. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  72. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  76. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +30 -30
  78. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  80. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
  82. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  84. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/auth/store/auth.js +26 -26
  86. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +78 -103
  88. package/dist/prometheus-framework/src/modules/chats/components/blocks/ChatMessage.vue.cjs +1 -0
  89. package/dist/prometheus-framework/src/modules/chats/components/blocks/ChatMessage.vue.js +28 -0
  90. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue.cjs +1 -0
  91. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue.js +26 -0
  92. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue2.cjs +1 -0
  93. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue2.js +1 -0
  94. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue.cjs +1 -0
  95. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue.js +77 -0
  96. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue2.cjs +1 -0
  97. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue2.js +1 -0
  98. package/dist/prometheus-framework/src/modules/chats/store/chat.store.cjs +1 -0
  99. package/dist/prometheus-framework/src/modules/chats/store/chat.store.js +40 -0
  100. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  102. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  104. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +15 -15
  106. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  108. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
  109. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
  110. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
  111. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
  112. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +4 -4
  116. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  120. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  122. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  124. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +29 -27
  126. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  128. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  130. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  132. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  134. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +33 -26
  136. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.js +6 -3
  138. package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -0
  139. package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +70 -0
  140. package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.cjs +1 -0
  141. package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.js +28 -0
  142. package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.cjs +1 -0
  143. package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.js +30 -0
  144. package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.cjs +1 -0
  145. package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.js +35 -0
  146. package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.cjs +1 -0
  147. package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.js +28 -0
  148. package/dist/prometheus-framework/src/modules/icons/navigation/IconCheckmark.vue.cjs +1 -0
  149. package/dist/prometheus-framework/src/modules/icons/navigation/IconCheckmark.vue.js +29 -0
  150. package/dist/prometheus-framework/src/modules/icons/placeholders/PlaceholderChat.vue.cjs +1 -0
  151. package/dist/prometheus-framework/src/modules/icons/placeholders/PlaceholderChat.vue.js +30 -0
  152. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +63 -86
  154. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  156. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue.js +121 -1
  158. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue2.cjs +1 -0
  159. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue2.js +1 -0
  160. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +3 -0
  161. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +92 -0
  162. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -0
  163. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +202 -0
  164. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue2.cjs +1 -0
  165. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue2.js +1 -0
  166. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -0
  167. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +127 -0
  168. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue2.cjs +1 -0
  169. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue2.js +1 -0
  170. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  171. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +174 -114
  172. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  173. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +41 -41
  174. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.cjs +1 -0
  175. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.js +89 -0
  176. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue2.cjs +1 -0
  177. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue2.js +1 -0
  178. package/dist/prometheus-framework/src/modules/orders/components/sections/AskToLogin.vue.cjs +1 -0
  179. package/dist/prometheus-framework/src/modules/orders/components/sections/AskToLogin.vue.js +24 -0
  180. package/dist/prometheus-framework/src/modules/orders/components/sections/EmptyState.vue.cjs +1 -0
  181. package/dist/prometheus-framework/src/modules/orders/components/sections/EmptyState.vue.js +13 -0
  182. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -0
  183. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +141 -0
  184. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.cjs +1 -1
  185. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.js +1 -1
  186. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -0
  187. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +77 -0
  188. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  189. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +46 -35
  190. package/dist/prometheus-framework/src/modules/orders/components/sections/Succes.vue.cjs +1 -0
  191. package/dist/prometheus-framework/src/modules/orders/components/sections/Succes.vue.js +25 -0
  192. package/dist/prometheus-framework/src/modules/orders/orders.client.cjs +1 -0
  193. package/dist/prometheus-framework/src/modules/orders/orders.client.js +56 -0
  194. package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -0
  195. package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +58 -0
  196. package/dist/prometheus-framework/src/modules/orders/store/customers.store.cjs +1 -0
  197. package/dist/prometheus-framework/src/modules/orders/store/customers.store.js +5 -0
  198. package/dist/prometheus-framework/src/modules/orders/store/models/customer.cjs +1 -0
  199. package/dist/prometheus-framework/src/modules/orders/store/models/customer.js +30 -0
  200. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  201. package/dist/prometheus-framework/src/modules/orders/store/orders.js +24 -25
  202. package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
  203. package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +5 -1
  204. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  205. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +16 -16
  206. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  207. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
  208. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  209. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +38 -49
  210. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  211. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  212. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  213. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +6 -6
  214. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  215. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +161 -138
  216. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  217. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +198 -78
  218. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  219. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +82 -125
  220. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  221. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  222. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  223. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  224. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  225. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  226. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  227. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +59 -70
  228. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  229. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  230. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  231. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +34 -36
  232. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  233. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +38 -18
  234. package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
  235. package/dist/prometheus-framework/src/modules/organizations/store/invites.js +34 -35
  236. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  237. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  238. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
  239. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +41 -21
  240. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  241. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  242. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  243. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  244. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  245. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  246. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  247. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  248. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  249. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  250. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  251. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  252. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  253. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
  254. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  255. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +3 -3
  256. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  257. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  258. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  259. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  260. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  261. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  262. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  263. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +24 -26
  264. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -0
  265. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +78 -0
  266. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  267. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  268. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  269. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  270. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  271. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  272. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  273. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  274. package/dist/prometheus-framework/src/modules/users/store/users.cjs +1 -1
  275. package/dist/prometheus-framework/src/modules/users/store/users.js +13 -14
  276. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  277. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  278. package/dist/prometheus-framework.cjs.js +1 -1
  279. package/dist/prometheus-framework.es.js +1 -1
  280. package/dist/queryProcessor-BJdKh0Ow.mjs +162 -0
  281. package/dist/queryProcessor-DRMo_GWK.js +161 -0
  282. package/dist/reports.server.js +1 -1
  283. package/dist/reports.server.mjs +1 -1
  284. package/dist/style.css +1 -1
  285. package/dist/users.server.js +58 -47
  286. package/dist/users.server.mjs +58 -47
  287. package/dist/wallet.server.js +2 -2
  288. package/dist/wallet.server.mjs +2 -2
  289. package/dist/web-CtVocufd.js +1 -0
  290. package/dist/web-DNq1tHCE.mjs +54 -0
  291. package/package.json +1 -1
  292. package/src/components/Address/Address.vue +13 -2
  293. package/src/components/Block/Block.vue +3 -2
  294. package/src/components/Button/Button.vue +9 -12
  295. package/src/components/Feed/Feed.vue +28 -6
  296. package/src/components/FieldPhone/FieldPhone.vue +592 -558
  297. package/src/components/LocationMarker/LocationMarker.vue +26 -22
  298. package/src/components/Popup/Popup.vue +22 -23
  299. package/src/components/Select/Select.vue +43 -32
  300. package/src/components/Slider/Slider.vue +3 -4
  301. package/src/modules/auth/components/pages/Invite.vue +7 -7
  302. package/src/modules/auth/store/auth.js +1 -1
  303. package/src/modules/backoffice/components/pages/Dashboard.vue +44 -29
  304. package/src/modules/chats/components/blocks/ChatMessage.vue +1 -1
  305. package/src/modules/community/components/sections/HotPosts.vue +1 -1
  306. package/src/modules/events/components/blocks/CardEvent.vue +4 -3
  307. package/src/modules/events/components/pages/Events.vue +23 -6
  308. package/src/modules/globals/components/sections/SectionPageTitle.vue +19 -7
  309. package/src/modules/globals/controllers/utils/queryProcessor.js +21 -7
  310. package/src/modules/globals/localization/vue-i18n.js +3 -0
  311. package/src/modules/globals/models/credentials.schema.js +7 -0
  312. package/src/modules/globals/models/metadata.schema.js +17 -0
  313. package/src/modules/globals/models/profile.schema.js +23 -0
  314. package/src/modules/globals/models/socials.schema.js +22 -0
  315. package/src/modules/globals/router/routerGuards.js +1 -0
  316. package/src/modules/globals/services/globals.cashe.js +26 -0
  317. package/src/modules/globals/services/globals.crud.js +115 -0
  318. package/src/modules/globals/services/globals.logger.js +41 -0
  319. package/src/modules/globals/services/globals.store.js +114 -0
  320. package/src/modules/icons/entities/IconGallery.vue +14 -0
  321. package/src/modules/icons/entities/IconLeftovers.vue +14 -0
  322. package/src/modules/icons/entities/IconOrders.vue +15 -0
  323. package/src/modules/icons/entities/IconProducts.vue +14 -0
  324. package/src/modules/landing/components/sections/HeroSection.vue +1 -1
  325. package/src/modules/landing/components/sections/MobileApp.vue +4 -4
  326. package/src/modules/landing/router/landing.js +1 -1
  327. package/src/modules/marketplace/components/sections/Filters.vue +3 -3
  328. package/src/modules/middlewares/server/accessors/AccessController.js +33 -0
  329. package/src/modules/middlewares/server/accessors/ReadDepartments.js +101 -0
  330. package/src/modules/middlewares/server/verifyAccesses.js +33 -0
  331. package/src/modules/middlewares/server/verifyInvites.js +4 -4
  332. package/src/modules/orders/components/pages/OrderCreate.vue +2 -2
  333. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +105 -68
  334. package/src/modules/orders/components/pages/Orders.vue +2 -2
  335. package/src/modules/orders/components/sections/FormAddCustomer.vue +152 -0
  336. package/src/modules/orders/components/sections/FormCustomerDetails.vue +67 -0
  337. package/src/modules/orders/components/sections/FormDelivery.vue +17 -3
  338. package/src/modules/orders/controllers/applications.controller.js +2 -0
  339. package/src/modules/orders/controllers/orders.controller.js +77 -52
  340. package/src/modules/orders/models/application.model.js +25 -25
  341. package/src/modules/orders/models/customer.model.js +54 -18
  342. package/src/modules/orders/models/order.model.js +1 -1
  343. package/src/modules/orders/models/testimonial.model.js +22 -23
  344. package/src/modules/orders/orders.client.js +51 -51
  345. package/src/modules/orders/orders.server.js +36 -12
  346. package/src/modules/orders/router/orders.router.js +36 -41
  347. package/src/modules/orders/routes/orders.routes.js +3 -21
  348. package/src/modules/orders/store/customers.store.js +5 -0
  349. package/src/modules/orders/store/models/customer.js +29 -0
  350. package/src/modules/orders/store/orders.js +14 -20
  351. package/src/modules/organizations/components/blocks/CardDepartment.vue +3 -3
  352. package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
  353. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +1 -12
  354. package/src/modules/organizations/components/pages/Department.vue +1 -1
  355. package/src/modules/organizations/components/pages/DepartmentEdit.vue +72 -48
  356. package/src/modules/organizations/components/pages/Members.vue +178 -64
  357. package/src/modules/organizations/components/pages/Organization.vue +1 -41
  358. package/src/modules/organizations/components/sections/MembersAdd.vue +44 -52
  359. package/src/modules/organizations/controllers/departments.controller.js +2 -4
  360. package/src/modules/organizations/controllers/invites.controller.js +24 -23
  361. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  362. package/src/modules/organizations/models/department.model.js +52 -2
  363. package/src/modules/organizations/models/invite.model.js +29 -32
  364. package/src/modules/organizations/models/membership.model.js +2 -0
  365. package/src/modules/organizations/models/organization.model.js +2 -1
  366. package/src/modules/organizations/organizations.client.js +0 -2
  367. package/src/modules/organizations/routes/departments.routes.js +18 -7
  368. package/src/modules/organizations/routes/invites.routes.js +2 -2
  369. package/src/modules/organizations/store/departments.js +22 -1
  370. package/src/modules/organizations/store/invites.js +74 -90
  371. package/src/modules/products/components/blocks/CardProduct.vue +24 -0
  372. package/src/modules/products/components/pages/Products.vue +1 -1
  373. package/src/modules/reports/components/sections/FormReport.vue +40 -40
  374. package/src/modules/spots/components/pages/Spot.vue +1 -1
  375. package/src/modules/spots/components/pages/SpotEdit.vue +1 -1
  376. package/src/modules/users/components/blocks/CardUser.vue +85 -0
  377. package/src/modules/users/controllers/users.controller.js +36 -13
  378. package/src/modules/users/middlewares/visitor.logger.js +66 -0
  379. package/src/modules/users/models/request.model.js +18 -0
  380. package/src/modules/users/models/user.model.js +26 -55
  381. package/src/modules/users/models/visitor.model.js +14 -0
  382. package/src/modules/users/store/users.js +2 -11
  383. package/src/modules/wallet/controllers/routes/payments.routes.js +2 -0
  384. package/src/components/FieldPhone/FieldPhone(script-setup).vue +0 -1646
  385. package/src/components/FieldPhone/FieldPhone2.vue +0 -671
  386. package/src/modules/orders/components/sections/FormClientDetails.vue +0 -61
  387. package/src/modules/organizations/components/blocks/User.vue +0 -69
  388. /package/src/modules/backoffice/components/admin/{User.vue → UserEdit.vue} +0 -0
@@ -1,671 +0,0 @@
1
- <template>
2
- <div
3
- :class="[
4
- rootClass,
5
- classes,
6
- $attrs.class,
7
- { 'bg-fourth-nano': validation },
8
- { disabled: disabled }
9
- ]"
10
- :style="[
11
- rootStyle,
12
- styles
13
- ]"
14
- ref="rootElement"
15
- class="vue3-reactive-tel-input"
16
- >
17
- <div
18
- v-click-outside="clickedOutside"
19
- :class="['vti__dropdown', { open: open }]"
20
- :style="[dropdownStyle]"
21
- :tabindex="dropdownOptions.tabindex"
22
- @keydown="keyboardNav"
23
- @click="toggleDropdown"
24
- @keydown.esc="reset"
25
- class="br-solid br-black-transp br-1px radius-medium"
26
- >
27
- <span class="flex-nowrap flex flex-v-center p-medium vti__selection">
28
- <span v-if="dropdownOptions.showFlags" v-html="activeCountryFlag" class="mn-r-thin" />
29
- <span v-if="dropdownOptions.showDialCodeInSelection" class="vti__country-code">
30
- +{{ activeCountry && activeCountry.dialCode }}
31
- </span>
32
- <!-- <slot name="arrow-icon" :open="open"> -->
33
- <!-- <span class="vti__dropdown-arrow">{{ open ? "▲" : "▼" }}</span> -->
34
- <!-- </slot> -->
35
- </span>
36
- <ul
37
- ref="list"
38
- class="bs-black radius-small vti__dropdown-list"
39
- v-show="open"
40
- :class="dropdownOpenDirection"
41
- :style="[listStyle]"
42
-
43
- >
44
- <li
45
- v-for="(pb, index) in sortedCountries"
46
- class="flex-nowrap flex w-max"
47
- :class="['vti__dropdown-item', getItemClass(index, pb.iso2)]"
48
- :key="pb.iso2 + (pb.preferred ? '-preferred' : '')"
49
- @click="choose(pb)"
50
- @mousemove="selectedIndex = index"
51
- >
52
- <span v-if="dropdownOptions.showFlags" v-html="pb.flag" class="mn-r-thin"/>
53
- <strong>{{ pb.name }}</strong>
54
- <span v-if="dropdownOptions.showDialCodeInList"> +{{ pb.dialCode }} </span>
55
- </li>
56
- </ul>
57
- </div>
58
- <!-- <div :class="[divInputClass]" > -->
59
- <input
60
- v-model="phone"
61
- inputmode="numeric"
62
- pattern="\d*"
63
- ref="input"
64
- :type="inputOptions.type"
65
- :autocomplete="inputOptions.autocomplete"
66
- :autofocus="inputOptions.autofocus"
67
- :class="['vti__input', inputOptions.styleClasses, inputClass, Iclasses]"
68
- :style="[inputStyle, Istyles]"
69
- :disabled="disabled"
70
- :id="inputId !== ''? inputId : inputOptions.id"
71
- :maxlength="inputOptions.maxlength"
72
- :name="inputId !== ''? inputId : inputOptions.name"
73
- :placeholder="parsedPlaceholder"
74
- :readonly="inputOptions.readonly"
75
- :required="inputOptions.required"
76
- :tabindex="inputOptions.tabindex"
77
- @blur="onBlur"
78
- @focus="onFocus"
79
- @input="onInput"
80
- @keyup.enter="onEnter"
81
- @keyup.space="onSpace"
82
- />
83
- <slot></slot> <!-- slot outlet -->
84
- <!-- </div> -->
85
-
86
- </div>
87
- <!-- Validation -->
88
- <transition name="fade">
89
- <div v-if="validation" class="mn-t-thin mn-b-thin invalid-feedback">
90
- * {{validation.message}}
91
- </div>
92
- </transition>
93
- </template>
94
-
95
-
96
- <script setup>
97
- import { ref, reactive, watch, computed, onMounted, nextTick } from 'vue';
98
- import { parsePhoneNumberFromString } from 'libphonenumber-js';
99
-
100
- import clickOutside from './click-outside';
101
- import allCountries from './all-countries';
102
-
103
- let vClickOutside = clickOutside
104
-
105
- const props = defineProps({
106
- modelValue: { type: String, default: '',},
107
- badClass: { type: [String, Array, Object], default: '', },
108
- goodClass: { type: [String, Array, Object], default: '', },
109
- badStyle: { type: [String, Array, Object], default: '', },
110
- goodStyle: { type: [String, Array, Object], default: '', },
111
- badInputClass: { type: [String, Array, Object], default: '', },
112
- goodInputClass: { type: [String, Array, Object], default: '', },
113
- badInputStyle: { type: [String, Array, Object], default: '', },
114
- goodInputStyle: { type: [String, Array, Object], default: '', },
115
- allCountries: { type: Array, default: () => allCountries, },
116
- autoFormat: { type: Boolean, default: () => true, },
117
- validation: { type: [Boolean, Object], default: false, },
118
- customValidate: { type: [Boolean, RegExp], default: () => false, },
119
- defaultCountry: { type: String, default: () => '', },
120
- disabled: { type: Boolean, default: () => false, },
121
- autoDefaultCountry: { type: Boolean, default: () => true },
122
- ignoredCountries: { type: Array, default: () => [], },
123
- invalidMsg: { type: String, default: () => '', },
124
- mode: { type: String, default: () => 'auto', },
125
- onlyCountries: { type: Array, default: () => [], },
126
- preferredCountries: { type: Array, default: () => [], },
127
- validCharactersOnly: { type: Boolean, default: () => false, },
128
- rootClass: { type: [String, Array, Object], default: () => '', },
129
- inputClass: { type: [String, Array, Object], default: () => {return ''}, },
130
- divInputClass: { type: [String, Array, Object], default: () => {return ''}, },
131
- rootStyle: { type: [String, Array, Object], default: () => {return ''}, },
132
- dropdownStyle: { type: [String, Array, Object], default: () => {return ''}, },
133
- listStyle: { type: [String, Array, Object], default: () => {return ''}, },
134
- inputStyle: { type: [String, Array, Object], default: () => {return ''}, },
135
- inputId: { type: [String, Array, Object], default: () => {return ''}, },
136
- Placeholder: { type: [String, Object, Function], default: () => {return ''}, },
137
- dropdownOptions: {
138
- type: Object,
139
- default: () => {
140
- return {
141
- showDialCodeInList: true,
142
- showDialCodeInSelection: false,
143
- showFlags: true,
144
- tabindex: 0
145
- }
146
- }
147
- },
148
- inputOptions: {
149
- type: Object,
150
- default: () => {
151
- return {
152
- autocomplete: 'on',
153
- autofocus: false,
154
- id: '',
155
- maxlength: 25,
156
- name: 'telephone',
157
- placeholder: 'Enter a phone number',
158
- readonly: false,
159
- required: false,
160
- tabindex: 0,
161
- type: 'tel',
162
- styleClasses: ''
163
- }
164
- }
165
- },
166
- });
167
-
168
- const emits = defineEmits([
169
- 'update:modelValue',
170
- 'validate',
171
- 'country-changed',
172
- 'open',
173
- 'close',
174
- 'blur',
175
- 'focus',
176
- 'enter',
177
- 'space'
178
- ]);
179
-
180
- const counter = ref(5);
181
- const initCounter = ref(5);
182
- const message = reactive({
183
- action: null,
184
- amount: null,
185
- });
186
- const phone = ref(props.modelValue ? props.modelValue : '');
187
- const activeCountryCode = ref('');
188
- const open = ref(false);
189
- const finishMounted = ref(false);
190
- const selectedIndex = ref(null);
191
- const typeToFindInput = ref('');
192
- const typeToFindTimer = ref(null);
193
- const dropdownOpenDirection = ref('below');
194
- const parsedPlaceholder = ref(props.Placeholder !== '' ? props.Placeholder : props.inputOptions.placeholder);
195
-
196
- const rootElement = ref(null)
197
- const list = ref(null)
198
- const input = ref(null)
199
-
200
- // Lifecycle hooks
201
- onMounted(async () => {
202
- if (props.modelValue) {
203
- phone.value = props.modelValue;
204
- }
205
-
206
- cleanInvalidCharacters();
207
-
208
- initializeCountry()
209
- .then(() => {
210
- if (!phone.value
211
- && props.inputOptions?.showDialCode
212
- && activeCountryCode.value) {
213
- phone.value = `+${activeCountryCode.value}`;
214
- }
215
- emits('validate', phoneObject.value);
216
- })
217
- .catch(console.error)
218
- .then(() => {
219
- finishMounted.value = true;
220
- });
221
- });
222
-
223
- // Computed properties
224
- const activeCountry = computed(() => {
225
- return findCountry(activeCountryCode.value);
226
- });
227
-
228
- const activeCountryFlag = computed(() => {
229
- return activeCountry.value ? activeCountry.value.flag : null;
230
- });
231
-
232
- const parsedMode = computed(() => {
233
- if (props.mode === 'auto') {
234
- if (!phone.value || phone.value[0] !== '+') {
235
- return 'national';
236
- }
237
- return 'international';
238
- }
239
- if (!['international', 'national'].includes(props.mode)) {
240
- console.error('Invalid value of prop "mode"');
241
- return 'international';
242
- }
243
- return props.mode;
244
- });
245
-
246
- const filteredCountries = computed(() => {
247
- if (props.onlyCountries && props.onlyCountries.length) {
248
- return props.allCountries.filter(({ iso2 }) => props.onlyCountries.includes(iso2.toUpperCase()));
249
- }
250
-
251
- if (props.ignoredCountries && props.ignoredCountries.length) {
252
- return props.allCountries.filter(({ iso2 }) =>
253
- !props.ignoredCountries.includes(iso2.toUpperCase()) && !props.ignoredCountries.includes(iso2.toLowerCase()),
254
- );
255
- }
256
-
257
- return props.allCountries;
258
- });
259
- const sortedCountries = computed(() => {
260
- const preferredCountries = getCountries(props.preferredCountries)
261
- .map(country => ({ ...country, preferred: true }));
262
-
263
- return [...preferredCountries, ...filteredCountries.value];
264
- });
265
-
266
- const phoneObject = computed(() => {
267
- let result = {};
268
-
269
- if (phone.value?.[0] === '+') {
270
- result = parsePhoneNumberFromString(phone.value) || {};
271
- } else {
272
- result = parsePhoneNumberFromString(phone.value, activeCountryCode.value) || {};
273
- }
274
-
275
- const { metadata, ...phoneDetails } = result;
276
-
277
- let valid = result.isValid?.();
278
- let formatted = phone.value;
279
-
280
- if (valid) {
281
- formatted = result.format?.(parsedMode.value.toUpperCase(), { nationalPrefix: false });
282
- }
283
-
284
- if (result.country && (props.ignoredCountries.length || props.onlyCountries.length)) {
285
- if (!findCountry(result.country)) {
286
- valid = false;
287
- result = { ...result, country: null };
288
- }
289
- }
290
-
291
- return {
292
- ...phoneDetails,
293
- countryCode: result.country,
294
- valid,
295
- country: activeCountry.value,
296
- formatted,
297
- };
298
- });
299
-
300
- const classes = computed(() => {
301
- return phoneObject.value.valid === true ? props.goodClass :
302
- phoneObject.value.valid === false ? props.badClass : undefined;
303
- });
304
-
305
- const styles = computed(() => {
306
- return phoneObject.value.valid === true ? props.goodStyle :
307
- phoneObject.value.valid === false ? props.badStyle : undefined;
308
- });
309
-
310
- const Iclasses = computed(() => {
311
- return phoneObject.value.valid === true ? props.goodInputClass :
312
- phoneObject.value.valid === false ? props.badInputClass : undefined;
313
- });
314
-
315
- const Istyles = computed(() => {
316
- return phoneObject.value.valid === true ? props.goodInputStyle :
317
- phoneObject.value.valid === false ? props.badInputStyle : undefined;
318
- });
319
- // ///////////
320
- // Watchers
321
- // ///////////
322
- watch(activeCountry, (newValue, oldValue) => {
323
- if (!newValue && oldValue?.iso2) {
324
- activeCountryCode.value = oldValue.iso2;
325
- return;
326
- }
327
- if (newValue?.iso2) {
328
- emits('country-changed', newValue);
329
- resetPlaceholder();
330
- }
331
- });
332
-
333
- // Следим за изменениями countryCode в phoneObject
334
- watch(() => phoneObject.value.countryCode, (newValue) => {
335
- activeCountryCode.value = newValue;
336
- });
337
-
338
- // Следим за изменениями валидности phoneObject
339
- watch(() => phoneObject.value.valid, () => {
340
- emits('validate', phoneObject.value);
341
- });
342
-
343
- // Следим за изменениями отформатированного номера в phoneObject
344
- watch(() => phoneObject.value.formatted, (newValue) => {
345
- if (!props.autoFormat || props.customValidate) {
346
- return;
347
- }
348
- emitInput(newValue);
349
-
350
- nextTick(() => {
351
- if (newValue && !props.modelValue) {
352
- phone.value = newValue;
353
- }
354
- });
355
- });
356
-
357
- // Следим за изменениями placeholder в inputOptions
358
- watch(() => props.inputOptions.placeholder, () => {
359
- resetPlaceholder();
360
- });
361
-
362
- // Следим за внешними изменениями значения (например, через v-model)
363
- watch(() => props.modelValue, (newValue, oldValue) => {
364
- if (!testCharacters()) {
365
- nextTick(() => {
366
- phone.value = oldValue;
367
- onInput();
368
- });
369
- } else {
370
- phone.value = newValue;
371
- }
372
- });
373
-
374
- // Следим за состоянием открытия/закрытия dropdown
375
- watch(open, (isDropdownOpened) => {
376
- if (isDropdownOpened) {
377
- setDropdownPosition();
378
- emits('open');
379
- } else {
380
- emits('close');
381
- }
382
- });
383
-
384
- // Methods
385
- function getCountry() {
386
- return fetch('https://ip2c.org/s')
387
- .then((response) => response.text())
388
- .then((response) => {
389
- const result = (response || '').toString();
390
-
391
- if (!result || result[0] !== '1') {
392
- throw new Error('unable to fetch the country');
393
- }
394
-
395
- return result.substr(2, 2);
396
- });
397
- }
398
-
399
- function setCaretPosition(ctrl, pos) {
400
- // Modern browsers
401
- if (ctrl.setSelectionRange) {
402
- ctrl.focus();
403
- ctrl.setSelectionRange(pos, pos);
404
-
405
- // IE8 and below
406
- } else if (ctrl.createTextRange) {
407
- const range = ctrl.createTextRange();
408
- range.collapse(true);
409
- range.moveEnd('character', pos);
410
- range.moveStart('character', pos);
411
- range.select();
412
- }
413
- }
414
-
415
- function resetPlaceholder() {
416
- parsedPlaceholder.value = props.inputOptions.placeholder;
417
- }
418
- function initializeCountry() {
419
- return new Promise((resolve) => {
420
- if (phone.value?.[0] === '+') { resolve(); return; }
421
- if (props.defaultCountry) { choose(props.defaultCountry); resolve(); return; }
422
- const fallbackCountry = props.preferredCountries[0] || filteredCountries.value[0];
423
- if (props.autoDefaultCountry) {
424
- getCountry()
425
- .then((res) => { choose(res || activeCountryCode.value); })
426
- .catch((error) => { console.warn(error); choose(fallbackCountry); })
427
- .finally(() => { resolve(); });
428
- } else {
429
- choose(fallbackCountry);
430
- resolve();
431
- }
432
- });
433
- }
434
-
435
- function getCountries(list = []) {
436
- return list.map((countryCode) => findCountry(countryCode)).filter(Boolean);
437
- }
438
-
439
- function findCountry(iso = '') {
440
- return filteredCountries.value.find((country) => country.iso2 === iso.toUpperCase());
441
- }
442
-
443
- function getItemClass(index, iso2) {
444
- const highlighted = selectedIndex.value === index;
445
- const lastPreferred = index === props.preferredCountries.length - 1;
446
- const preferred = props.preferredCountries.some((c) => c.toUpperCase() === iso2);
447
- return { highlighted, 'last-preferred': lastPreferred, preferred };
448
- }
449
-
450
- function choose(country) {
451
- let parsedCountry = typeof country === 'string' ? findCountry(country) : country;
452
- if (!parsedCountry) return;
453
-
454
- if (phone.value?.[0] === '+' && parsedCountry.iso2 && phoneObject.value.nationalNumber) {
455
- activeCountryCode.value = parsedCountry.iso2;
456
- phone.value = parsePhoneNumberFromString(phoneObject.value.nationalNumber, parsedCountry.iso2).formatInternational();
457
- return;
458
- }
459
-
460
- if (props.inputOptions?.showDialCode && parsedCountry) {
461
- phone.value = `+${parsedCountry.dialCode}`;
462
- return;
463
- }
464
-
465
- activeCountryCode.value = parsedCountry.iso2;
466
- emitInput(phone.value);
467
- }
468
-
469
- function cleanInvalidCharacters() {
470
- const currentPhone = phone.value;
471
-
472
- if (props.validCharactersOnly) {
473
- const results = phone.value.match(/[()\-+0-9\s]*/g);
474
- phone.value = results.join('');
475
- }
476
-
477
- if (props.customValidate && props.customValidate instanceof RegExp) {
478
- const results = phone.value.match(props.customValidate);
479
- phone.value = results ? results.join('') : '';
480
- }
481
-
482
- if (currentPhone !== phone.value) {
483
- emitInput(phone.value);
484
- }
485
- }
486
-
487
- function testCharacters() {
488
- if (props.validCharactersOnly) {
489
- const result = /^[()\-+0-9\s]*$/.test(phone.value);
490
- if (!result) return false;
491
- }
492
- if (props.customValidate) {
493
- return testCustomValidate();
494
- }
495
- return true;
496
- }
497
-
498
- function testCustomValidate() {
499
- return props.customValidate instanceof RegExp ? props.customValidate.test(phone.value) : false;
500
- }
501
-
502
- function onInput() {
503
- input.value.setCustomValidity(phoneObject.valid ? '' : props.invalidMsg);
504
-
505
- emitInput(phone.value);
506
- }
507
-
508
- function emitInput(value) {
509
- emits('update:modelValue', value);
510
-
511
- if (phoneObject.value.valid) {
512
- emits('country', phoneObject.value.number);
513
- } else {
514
- emits('country', null);
515
- }
516
- }
517
-
518
- function onBlur() {
519
- emits('blur');
520
- }
521
-
522
- function onFocus() {
523
- setCaretPosition(input.value, phone.value.length);
524
- emits('focus');
525
- }
526
-
527
- function onEnter() {
528
- emits('enter');
529
- }
530
-
531
- function onSpace() {
532
- emits('space');
533
- }
534
-
535
- function focus() {
536
- input.value.focus();
537
- }
538
-
539
- function toggleDropdown() {
540
- if (props.disabled) return;
541
- open.value = !open.value;
542
- }
543
-
544
- function clickedOutside() {
545
- open.value = false;
546
- }
547
-
548
- function keyboardNav(e) {
549
- if (e.keyCode === 40) { // down arrow
550
- e.preventDefault();
551
- open.value = true;
552
- selectedIndex.value = selectedIndex.value === null ? 0 : Math.min(sortedCountries.value.length - 1, selectedIndex.value + 1);
553
- nextTick(() => {
554
- const selEle = list.value.children[selectedIndex.value];
555
- if (selEle.offsetTop + selEle.clientHeight > list.value.scrollTop + list.value.clientHeight) {
556
- list.value.scrollTop = selEle.offsetTop - list.value.clientHeight + selEle.clientHeight;
557
- }
558
- });
559
- } else if (e.keyCode === 38) { // up arrow
560
- e.preventDefault();
561
- open.value = true;
562
- selectedIndex.value = selectedIndex.value === null ? sortedCountries.value.length - 1 : Math.max(0, selectedIndex.value - 1);
563
- nextTick(() => {
564
- const selEle = list.value.children[selectedIndex.value];
565
- if (selEle.offsetTop < list.value.scrollTop) {
566
- list.value.scrollTop = selEle.offsetTop;
567
- }
568
- });
569
- } else if (e.keyCode === 13) { // enter key
570
- e.preventDefault();
571
- if (selectedIndex.value !== null) {
572
- choose(sortedCountries.value[selectedIndex.value]);
573
- }
574
- open.value = !open.value;
575
- } else { // typing a country's name
576
- typeToFindInput.value += e.key;
577
- clearTimeout(typeToFindTimer);
578
- typeToFindTimer = setTimeout(() => {
579
- typeToFindInput.value = '';
580
- }, 700);
581
- nextTick(() => {
582
- const typedCountryI = sortedCountries.value.slice(props.preferredCountries.length).findIndex((c) => c.name.toLowerCase().startsWith(typeToFindInput.value));
583
- if (typedCountryI >= 0) {
584
- selectedIndex.value = props.preferredCountries.length + typedCountryI;
585
- const selEle = list.value.children[selectedIndex.value];
586
- const needToScroll = selEle.offsetTop < list.value.scrollTop || selEle.offsetTop + selEle.clientHeight > list.value.scrollTop + list.value.clientHeight;
587
- if (needToScroll) {
588
- list.value.scrollTop = selEle.offsetTop - list.value.clientHeight / 2;
589
- }
590
- }
591
- });
592
- }
593
- }
594
-
595
- function reset() {
596
- selectedIndex.value = sortedCountries.value.map(c => c.iso2).indexOf(activeCountryCode.value);
597
- open.value = false;
598
- }
599
-
600
- function setDropdownPosition() {
601
- const spaceBelow = window.innerHeight - rootElement.value.getBoundingClientRect().bottom;
602
- const hasEnoughSpaceBelow = spaceBelow > 200;
603
- dropdownOpenDirection.value = hasEnoughSpaceBelow ? 'below' : 'above';
604
- }
605
- </script>
606
-
607
- <style scoped>
608
- .vue3-reactive-tel-input{
609
- display:flex
610
- }
611
- .vue3-reactive-tel-input.disabled .dropdown,.vue3-reactive-tel-input.disabled .selection,.vue3-reactive-tel-input.disabled input{
612
- cursor:no-drop
613
- }
614
- .vti__dropdown{
615
- display:flex;
616
- flex-direction:column;
617
- align-content:center;
618
- justify-content:center;
619
- position:relative;
620
- padding:7px;
621
- cursor:pointer
622
- }
623
- .vti__dropdown.show{
624
- max-height:300px;
625
- overflow:scroll
626
- }
627
- .vti__dropdown-list{
628
- z-index:1;
629
- padding:0;
630
- margin:0;
631
- text-align:left;
632
- list-style:none;
633
- max-height:200px;
634
- overflow-y:scroll;
635
- position:absolute;
636
- left:-1px;
637
- background-color:#fff;
638
- width:fit-content
639
- }
640
- .vti__dropdown-list.below{
641
- top:33px
642
- }
643
- .vti__dropdown-list.above{
644
- top:auto;
645
- bottom:100%
646
- }
647
- .vti__dropdown-arrow{
648
- transform:scaleY(.5);
649
- display:inline-block;
650
- color:#666
651
- }
652
- .vti__dropdown-item{
653
- cursor:pointer;
654
- padding:4px 15px
655
- }
656
- .vti__dropdown-item.last-preferred{
657
- border-bottom:1px solid #cacaca
658
- }
659
- .vti__dropdown-item .vti__flag{
660
- display:inline-block;
661
- margin-right:5px
662
- }
663
- .vti__input{
664
- color: inherit;
665
- border:none;
666
- border-radius:0 2px 2px 0;
667
- width:100%;
668
- outline:0;
669
- padding-left:7px
670
- }
671
- </style>