@ozdao/prometheus-framework 0.2.130 → 0.2.133

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. package/dist/auth.server.js +0 -1
  2. package/dist/auth.server.mjs +0 -1
  3. package/dist/community.server.js +172 -31
  4. package/dist/community.server.mjs +172 -31
  5. package/dist/events.server.js +1 -1
  6. package/dist/events.server.mjs +1 -1
  7. package/dist/files.server.js +38 -4
  8. package/dist/files.server.mjs +38 -4
  9. package/dist/gallery.server.js +1 -1
  10. package/dist/gallery.server.mjs +1 -1
  11. package/dist/main-CI9l9xMs.js +92 -0
  12. package/dist/main-DPg58GOU.mjs +14509 -0
  13. package/dist/main.css +1 -1
  14. package/dist/orders.server.js +1 -1
  15. package/dist/orders.server.mjs +1 -1
  16. package/dist/organizations.server.js +4 -3
  17. package/dist/organizations.server.mjs +4 -3
  18. package/dist/products.server.js +2 -1
  19. package/dist/products.server.mjs +2 -1
  20. package/dist/prometheus-framework/src/components/Address/Address.vue.cjs +1 -0
  21. package/dist/prometheus-framework/src/components/Address/Address.vue.js +89 -0
  22. package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Address/Address.vue2.js +22 -23
  24. package/dist/prometheus-framework/src/components/Block/Block.vue.js +13 -13
  25. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -0
  26. package/dist/prometheus-framework/src/components/Button/Button.vue.js +95 -0
  27. package/dist/prometheus-framework/src/components/Chips/Chips.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/components/Chips/Chips.vue.js +12 -13
  29. package/dist/prometheus-framework/src/components/Chips/Chips.vue2.cjs +1 -0
  30. package/dist/prometheus-framework/src/components/Chips/Chips.vue2.js +26 -0
  31. package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.cjs +1 -1
  32. package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.js +32 -33
  33. package/dist/prometheus-framework/src/components/Draggable/Draggable.vue.cjs +1 -0
  34. package/dist/prometheus-framework/src/components/Draggable/Draggable.vue.js +75 -0
  35. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +14 -15
  37. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -0
  38. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +57 -0
  39. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +93 -87
  41. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -0
  42. package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -0
  43. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +32 -29
  45. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +22 -23
  47. package/dist/prometheus-framework/src/components/FieldTags/FieldTags.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/components/FieldTags/FieldTags.vue.js +39 -39
  49. package/dist/prometheus-framework/src/components/FieldTags/tag-input.vue2.cjs +1 -1
  50. package/dist/prometheus-framework/src/components/FieldTags/tag-input.vue2.js +5 -5
  51. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.cjs +1 -0
  52. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.js +127 -0
  53. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  54. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +46 -47
  55. package/dist/prometheus-framework/src/components/Menu/Menu.vue.cjs +1 -0
  56. package/dist/prometheus-framework/src/components/Menu/Menu.vue.js +13 -0
  57. package/dist/prometheus-framework/src/components/PhotoViewer/PhotoViewer.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/components/PhotoViewer/PhotoViewer.vue.js +22 -23
  59. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -0
  60. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +77 -0
  61. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -0
  62. package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -0
  63. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
  64. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +14 -15
  65. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +9 -10
  67. package/dist/prometheus-framework/src/components/Upload/Upload.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +37 -34
  69. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +30 -30
  70. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +30 -30
  71. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +18 -18
  72. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/auth/store/auth.js +11 -11
  74. package/dist/prometheus-framework/src/modules/community/community.client.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/community/community.client.js +12 -14
  76. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +54 -71
  78. package/dist/prometheus-framework/src/modules/community/components/blocks/FooterBlogpost.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/community/components/blocks/FooterBlogpost.vue.js +57 -29
  80. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +86 -76
  82. package/dist/prometheus-framework/src/modules/community/components/pages/Blog.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/community/components/pages/Blog.vue.js +58 -28
  84. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +71 -80
  86. package/dist/prometheus-framework/src/modules/community/components/sections/Comment.vue.cjs +1 -0
  87. package/dist/prometheus-framework/src/modules/community/components/sections/Comment.vue.js +104 -0
  88. package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.js +99 -54
  90. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +27 -28
  92. package/dist/prometheus-framework/src/modules/community/store/blogposts.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/community/store/blogposts.js +45 -34
  94. package/dist/prometheus-framework/src/modules/constructor/components/elements/Audio.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/constructor/components/elements/Audio.vue.js +31 -29
  96. package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.js +32 -27
  98. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -0
  99. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +67 -0
  100. package/dist/prometheus-framework/src/modules/constructor/components/elements/Video.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/constructor/components/elements/Video.vue.js +16 -16
  102. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +119 -112
  104. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +6 -6
  105. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  107. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  109. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  111. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +22 -22
  113. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +27 -27
  115. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockFilter.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockFilter.vue.js +33 -22
  117. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +16 -16
  118. package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.js +3 -9
  120. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  122. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  124. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +9 -9
  125. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +39 -38
  127. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  129. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  131. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +112 -85
  133. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  134. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +36 -35
  135. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +8 -8
  136. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  138. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  140. package/dist/prometheus-framework/src/modules/organizations/components/sections/Publics.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/organizations/components/sections/Publics.vue.js +17 -17
  142. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  143. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +18 -18
  144. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
  145. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +6 -6
  146. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  147. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +12 -12
  148. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  150. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  152. package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.js +3 -2
  154. package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.js +32 -37
  156. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  158. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +4 -4
  159. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
  160. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +14 -14
  161. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +29 -29
  162. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  163. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +53 -35
  164. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardBalanceReplenished.vue.cjs +1 -0
  165. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardBalanceReplenished.vue.js +30 -0
  166. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardDeposite.vue.cjs +1 -0
  167. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardDeposite.vue.js +42 -0
  168. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CashDeposite.vue.cjs +1 -0
  169. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CashDeposite.vue.js +26 -0
  170. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CryptoDeposite.vue.cjs +1 -0
  171. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CryptoDeposite.vue.js +42 -0
  172. package/dist/prometheus-framework/src/modules/wallet/localization/Wallet.json.cjs +1 -0
  173. package/dist/prometheus-framework/src/modules/wallet/localization/Wallet.json.js +26 -0
  174. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  175. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +154 -77
  176. package/dist/prometheus-framework.cjs.js +1 -1
  177. package/dist/prometheus-framework.es.js +14 -14
  178. package/dist/queryProcessor-DQSFR9YA.mjs +179 -0
  179. package/dist/queryProcessor-iewDZq_f.js +178 -0
  180. package/dist/style.css +1 -1
  181. package/dist/wallet.server.js +80 -27
  182. package/dist/wallet.server.mjs +80 -27
  183. package/dist/web-DZUec7pP.js +1 -0
  184. package/dist/web-krQQeSb6.mjs +54 -0
  185. package/package.json +1 -1
  186. package/src/components/Address/Address.vue +1 -1
  187. package/src/components/Chips/Chips.vue +1 -1
  188. package/src/components/Completion/Completion.vue +1 -4
  189. package/src/components/DatePicker/Calendar.vue +1 -1
  190. package/src/components/Draggable/Draggable.vue +113 -0
  191. package/src/components/Dropdown/Dropdown.vue +1 -1
  192. package/src/components/Feed/Feed.vue +18 -12
  193. package/src/components/FieldBig/FieldBig.vue +11 -1
  194. package/src/components/FieldPhone/FieldPhone.vue +1 -1
  195. package/src/components/FieldTags/FieldTags.vue +2 -1
  196. package/src/components/FieldTags/tag-input.vue +1 -1
  197. package/src/components/LocationMarker/LocationMarker.vue +1 -1
  198. package/src/components/PhotoViewer/PhotoViewer.vue +1 -1
  199. package/src/components/Shader/Shader.vue +2 -2
  200. package/src/components/Slider/Slider.vue +1 -5
  201. package/src/components/Spoiler/Spoiler.vue +1 -1
  202. package/src/components/Text/Text.vue +1 -4
  203. package/src/components/Tooltip/Tooltip.vue +1 -1
  204. package/src/components/Upload/Upload.vue +5 -3
  205. package/src/modules/auth/controllers/auth.controller.js +0 -2
  206. package/src/modules/auth/store/auth.js +2 -2
  207. package/src/modules/community/DOCUMENTATION.MD +4 -0
  208. package/src/modules/community/community.client.js +0 -2
  209. package/src/modules/community/components/blocks/CardBlogpost.vue +6 -2
  210. package/src/modules/community/components/blocks/FooterBlogpost.vue +21 -5
  211. package/src/modules/community/components/layouts/Community.vue +15 -11
  212. package/src/modules/community/components/pages/Blog.vue +25 -32
  213. package/src/modules/community/components/pages/CreateBlogPost.vue +8 -15
  214. package/src/modules/community/components/sections/Comment.vue +123 -0
  215. package/src/modules/community/components/sections/Comments.vue +90 -19
  216. package/src/modules/community/components/sections/HotPosts.vue +3 -6
  217. package/src/modules/community/controllers/blog.controller.js +1 -1
  218. package/src/modules/community/controllers/comments.controller.aggr.js +280 -0
  219. package/src/modules/community/controllers/comments.controller.js +187 -38
  220. package/src/modules/community/controllers/comments.controller.populate.js +180 -0
  221. package/src/modules/community/models/comment.model.js +15 -0
  222. package/src/modules/community/store/blogposts.js +20 -2
  223. package/src/modules/constructor/components/elements/Audio.vue +28 -40
  224. package/src/modules/constructor/components/elements/ImageUpload.vue +12 -7
  225. package/src/modules/constructor/components/elements/Video.vue +10 -18
  226. package/src/modules/constructor/components/sections/Constructor.vue +54 -47
  227. package/src/modules/files/controllers/files.controller.js +2 -0
  228. package/src/modules/files/middlewares/server/middlewareBusboy.js +32 -4
  229. package/src/modules/files/routes/files.routes.js +8 -0
  230. package/src/modules/globals/components/blocks/BlockFilter.vue +17 -7
  231. package/src/modules/globals/components/partials/Header.vue +12 -7
  232. package/src/modules/globals/controllers/utils/queryProcessor.js +1 -0
  233. package/src/modules/icons/logos/Logotype.vue +8 -6
  234. package/src/modules/icons/logos/LogotypeNunito.vue +12 -0
  235. package/src/modules/marketplace/components/layouts/Marketplace.vue +29 -27
  236. package/src/modules/marketplace/store/marketplace.js +2 -8
  237. package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
  238. package/src/modules/organizations/components/pages/Members.vue +1 -1
  239. package/src/modules/organizations/components/pages/Organization.vue +33 -5
  240. package/src/modules/organizations/components/pages/OrganizationEdit.vue +7 -4
  241. package/src/modules/organizations/components/sections/DetailsTab.vue +10 -10
  242. package/src/modules/organizations/components/sections/Publics.vue +2 -2
  243. package/src/modules/organizations/controllers/memberships.controller.js +2 -3
  244. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  245. package/src/modules/organizations/store/memberships.js +4 -1
  246. package/src/modules/products/components/blocks/CardProduct.vue +1 -1
  247. package/src/modules/products/components/sections/HeroRecommendation.vue +11 -8
  248. package/src/modules/products/models/product.model.js +2 -1
  249. package/src/modules/spots/components/layouts/Spots.vue +0 -3
  250. package/src/modules/spots/components/pages/Map.vue +13 -3
  251. package/src/modules/users/components/blocks/CardUser.vue +2 -2
  252. package/src/modules/users/components/pages/ProfileBlogposts.vue +45 -28
  253. package/src/modules/wallet/components/blocks/CardBalanceReplenished.vue +40 -0
  254. package/src/modules/wallet/components/blocks/CardDeposite.vue +55 -0
  255. package/src/modules/wallet/components/blocks/CashDeposite.vue +28 -0
  256. package/src/modules/wallet/components/blocks/CryptoDeposite.vue +55 -0
  257. package/src/modules/wallet/controllers/factories/rewards.factory.aggr.js +181 -0
  258. package/src/modules/wallet/controllers/factories/rewards.factory.js +87 -113
  259. package/src/modules/wallet/controllers/factories/rewards.factory.population.js +213 -0
  260. package/src/modules/wallet/localization/Wallet.json +22 -0
  261. package/src/modules/wallet/views/components/pages/Wallet.vue +153 -53
  262. package/src/styles/base/all.scss +16 -26
  263. package/src/styles/config.scss +70 -34
  264. package/src/styles/typography.scss +5 -5
  265. package/src/modules/community/components/sections/Feed.vue +0 -148
  266. package/src/modules/middlewares/server/accessors/AccessController.js +0 -33
  267. package/src/modules/middlewares/server/accessors/ReadDepartments.js +0 -101
@@ -1,23 +1,23 @@
1
- import { mergeModels as F, useModel as x, ref as f, watch as $, onMounted as N, onUnmounted as P, openBlock as s, createElementBlock as S, Fragment as C, createBlock as g, normalizeClass as b, createCommentVNode as u, createElementVNode as I, createVNode as y, withCtx as k, unref as L, TransitionGroup as T, renderList as D, Transition as G, renderSlot as R } from "vue";
1
+ import { mergeModels as N, useModel as M, ref as g, watch as $, onMounted as T, onUnmounted as P, openBlock as s, createElementBlock as S, Fragment as j, createBlock as m, normalizeClass as y, createCommentVNode as r, createElementVNode as U, createVNode as B, withCtx as k, unref as w, TransitionGroup as C, renderList as G, renderSlot as R } from "vue";
2
2
  import q from "../../modules/icons/skeletons/SkeletonEvent.vue.js";
3
3
  /* empty css */
4
4
  import A from "../EmptyState/EmptyState.vue.js";
5
- import U from "../Dropdown/Dropdown.vue.js";
6
- import H from "../DatePicker/Calendar.vue2.js";
7
- import J from "../BottomSheet/BottomSheet.vue.js";
8
- import K from "../../modules/globals/components/blocks/BlockSearch.vue.js";
9
- import Q from "../../modules/globals/components/blocks/BlockSorting.vue.js";
10
- import W from "../../modules/globals/components/blocks/BlockFilter.vue.js";
11
- import X from "../../modules/globals/components/elements/ButtonSort.vue.js";
12
- import Y from "../../modules/globals/components/elements/ButtonDate.vue.js";
13
- import Z from "../../modules/icons/navigation/IconFilter.vue.js";
5
+ import z from "../Dropdown/Dropdown.vue.js";
6
+ import D from "../DatePicker/Calendar.vue2.js";
7
+ import H from "../BottomSheet/BottomSheet.vue.js";
8
+ import J from "../../modules/globals/components/blocks/BlockSearch.vue.js";
9
+ import K from "../../modules/globals/components/blocks/BlockSorting.vue.js";
10
+ import Q from "../../modules/globals/components/blocks/BlockFilter.vue.js";
11
+ import W from "../../modules/globals/components/elements/ButtonSort.vue.js";
12
+ import X from "../../modules/globals/components/elements/ButtonDate.vue.js";
13
+ import Y from "../../modules/icons/navigation/IconFilter.vue.js";
14
14
  /* empty css */
15
- const _ = {
15
+ const Z = {
16
16
  key: 0,
17
- class: "flex-nowrap flex gap-thin mn-b-thin"
18
- }, V = { class: "flex-center flex pd-thin bg-light radius-extra aspect-1x1 h-100" }, pe = {
17
+ class: "flex-nowrap flex gap-thin"
18
+ }, ve = {
19
19
  __name: "Feed",
20
- props: /* @__PURE__ */ F({
20
+ props: /* @__PURE__ */ N({
21
21
  showLoadMore: {
22
22
  type: Boolean,
23
23
  default: !0
@@ -73,39 +73,39 @@ const _ = {
73
73
  itemsModifiers: {}
74
74
  }),
75
75
  emits: ["update:search", "update:sort", "update:filter", "update:date", "update:items"],
76
- setup(r) {
77
- const h = x(r, "search"), a = x(r, "sort"), i = x(r, "filter"), l = x(r, "date"), w = x(r, "items"), o = r, n = f(w.value || []), v = f(!1);
78
- let M = f(!0), j = f(null), d = f(o.options.skip ? o.options.skip : 0), m = f(o.options.limit ? o.options.limit : 10), B = f("");
79
- function z(e) {
80
- B.value = e, d.value = 0, m.value = 10, p();
76
+ setup(u) {
77
+ const h = M(u, "search"), a = M(u, "sort"), i = M(u, "filter"), l = M(u, "date"), x = M(u, "items"), o = u, n = g(x.value || []), v = g(!1);
78
+ let b = g(!0), E = g(null), d = g(o.options.skip ? o.options.skip : 0), f = g(o.options.limit ? o.options.limit : 10), O = g("");
79
+ function F(e) {
80
+ O.value = e, d.value = 0, f.value = 10, p();
81
81
  }
82
- const E = async () => {
82
+ const I = async () => {
83
83
  if (v.value) {
84
- d.value += m.value;
84
+ d.value += f.value;
85
85
  const e = await o.store.read({
86
86
  skip: d.value,
87
- limit: m.value,
88
- search: B.value,
87
+ limit: f.value,
88
+ search: O.value,
89
89
  dateStart: l.value ? l.value.start : null,
90
90
  dateEnd: l.value ? l.value.end : null,
91
91
  sortParam: a.value ? a.value.param : null,
92
92
  sortOrder: a.value ? a.value.order : null,
93
93
  ...o.options
94
94
  });
95
- e.length === 0 || e.length < m.value ? v.value = !1 : v.value = !0, n.value = [...n.value, ...e], w.value && (w.value = n.value);
95
+ e.length === 0 || e.length < f.value ? v.value = !1 : v.value = !0, n.value = [...n.value, ...e], x.value && (x.value = n.value);
96
96
  }
97
97
  }, p = async () => {
98
98
  const e = await o.store.read({
99
99
  skip: d.value,
100
- limit: m.value,
100
+ limit: f.value,
101
101
  dateStart: l.value ? l.value.start : null,
102
102
  dateEnd: l.value ? l.value.end : null,
103
103
  sortParam: a.value ? a.value.param : null,
104
104
  sortOrder: a.value ? a.value.order : null,
105
- search: B.value,
105
+ search: O.value,
106
106
  ...o.options
107
107
  });
108
- e.length === 0 || e.length < m.value ? v.value = !1 : v.value = !0, n.value = e, w.value && (w.value = n.value), M.value = !1;
108
+ e.length === 0 || e.length < f.value ? v.value = !1 : v.value = !0, n.value = e, x.value && (x.value = n.value), b.value = !1;
109
109
  };
110
110
  $(() => o.external, (e, t) => {
111
111
  e !== t && (d.value = 0, p());
@@ -116,47 +116,49 @@ const _ = {
116
116
  return (e = a.value) == null ? void 0 : e.order;
117
117
  }, (e, t) => {
118
118
  e !== t && (d.value = 0, p());
119
- }, { deep: !0 }), $(() => {
119
+ }), $(() => {
120
120
  var e;
121
121
  return (e = a.value) == null ? void 0 : e.param;
122
122
  }, (e, t) => {
123
123
  e !== t && (d.value = 0, p());
124
- }, { deep: !0 }), $(() => o.options, (e, t) => {
125
- (e.organization !== t.organization || e.categories !== t.categories || e.prices !== t.prices || e.delivery !== t.delivery || e.search !== t.search || e.status !== t.status || e.hidden !== t.hidden || e.type !== t.type || e.tags !== t.tags) && (d.value = 0, p());
124
+ }), $(() => o.options, (e, t) => {
125
+ (e.organization !== t.organization || e.categories !== t.categories || e.prices !== t.prices || e.delivery !== t.delivery || e.search !== t.search || e.status !== t.status || e.hidden !== t.hidden || e.type !== t.type || e.tags !== t.tags || e.following !== t.following) && (d.value = 0, p());
126
126
  }, { deep: !0 });
127
- let O = null;
128
- return N(async () => {
129
- await p(), typeof window < "u" && !o.showLoadMore && (O = new IntersectionObserver((e) => {
130
- e.some((t) => t.isIntersecting) && E();
131
- }), O.observe(j.value));
127
+ let L = null;
128
+ return T(async () => {
129
+ await p(), typeof window < "u" && !o.showLoadMore && (L = new IntersectionObserver((e) => {
130
+ e.some((t) => t.isIntersecting) && I();
131
+ }), L.observe(E.value));
132
132
  }), P(() => {
133
- O && O.disconnect();
134
- }), (e, t) => (s(), S(C, null, [
135
- h.value || l.value || a.value ? (s(), S("div", _, [
136
- h.value ? (s(), g(K, {
133
+ L && L.disconnect();
134
+ }), (e, t) => (s(), S(j, null, [
135
+ h.value || l.value || a.value && !a.value.hideButton ? (s(), S("div", Z, [
136
+ h.value ? (s(), m(J, {
137
137
  key: 0,
138
138
  placeholder: h.value.placeholder || "Search...",
139
- class: b(h.value.class || "bg-light"),
140
- onSearch: z
141
- }, null, 8, ["placeholder", "class"])) : u("", !0),
142
- i.value ? (s(), S(C, { key: 1 }, [
143
- I("div", V, [
144
- y(Z, {
139
+ class: y(h.value.class || "bg-light"),
140
+ onSearch: F
141
+ }, null, 8, ["placeholder", "class"])) : r("", !0),
142
+ i.value ? (s(), S(j, { key: 1 }, [
143
+ U("div", {
144
+ class: y([i.value.class || "bg-light", "flex-center flex pd-thin bg-light radius-extra aspect-1x1 h-100"])
145
+ }, [
146
+ B(Y, {
145
147
  onClick: t[0] || (t[0] = () => i.value.active = !i.value.active),
146
148
  class: "w-1r h-auto"
147
149
  })
148
- ]),
149
- i.value.active ? (s(), g(J, {
150
+ ], 2),
151
+ i.value.active ? (s(), m(H, {
150
152
  key: 0,
151
153
  show: i.value.active,
152
154
  onToggle: t[2] || (t[2] = () => i.value.active = !1),
153
- class: b(["z-index-10 pos-fixed pos-t-0 pos-r-0", {
155
+ class: y(["z-index-10 pos-fixed pos-t-0 pos-r-0", {
154
156
  "pos-t-0": i.value.active,
155
157
  "pos-t-100": !i.value.active
156
158
  }])
157
159
  }, {
158
160
  default: k(() => [
159
- y(W, {
161
+ B(Q, {
160
162
  filter: i.value,
161
163
  "onUpdate:filter": t[1] || (t[1] = (c) => i.value = c),
162
164
  options: i.value.options,
@@ -164,19 +166,19 @@ const _ = {
164
166
  }, null, 8, ["filter", "options"])
165
167
  ]),
166
168
  _: 1
167
- }, 8, ["show", "class"])) : u("", !0)
168
- ], 64)) : u("", !0),
169
- l.value ? (s(), g(U, {
169
+ }, 8, ["show", "class"])) : r("", !0)
170
+ ], 64)) : r("", !0),
171
+ l.value ? (s(), m(z, {
170
172
  key: 2,
171
173
  label: {
172
- component: Y,
174
+ component: X,
173
175
  props: { date: l.value }
174
176
  },
175
- class: b([l.value.class || "bg-light", "flex-child flex-child-shrink-0 pd-r-small pd-l-small pd-thin bg-light radius-big"]),
177
+ class: y([l.value.class || "bg-light", "flex-child flex-child-shrink-0 pd-r-small pd-l-small pd-thin bg-light radius-big"]),
176
178
  align: h.value ? "right" : "left"
177
179
  }, {
178
180
  default: k(() => [
179
- y(H, {
181
+ B(D, {
180
182
  date: l.value,
181
183
  "onUpdate:date": t[3] || (t[3] = (c) => l.value = c),
182
184
  locale: e.$i18n.locale,
@@ -185,19 +187,19 @@ const _ = {
185
187
  }, null, 8, ["date", "locale"])
186
188
  ]),
187
189
  _: 1
188
- }, 8, ["label", "class", "align"])) : u("", !0),
189
- a.value ? (s(), g(U, {
190
+ }, 8, ["label", "class", "align"])) : r("", !0),
191
+ a.value && !a.value.hideButton ? (s(), m(z, {
190
192
  key: 3,
191
193
  label: {
192
- component: X,
194
+ component: W,
193
195
  props: { order: a.value.order },
194
196
  class: "w-1r"
195
197
  },
196
- class: b([a.value.class || "bg-light", "radius-extra aspect-1x1 h-100"]),
198
+ class: y([a.value.class || "bg-light", "radius-extra aspect-1x1 h-100"]),
197
199
  align: h.value ? "right" : "left"
198
200
  }, {
199
201
  default: k(() => [
200
- y(Q, {
202
+ B(K, {
201
203
  param: a.value.param,
202
204
  "onUpdate:param": t[4] || (t[4] = (c) => a.value.param = c),
203
205
  order: a.value.order,
@@ -207,53 +209,57 @@ const _ = {
207
209
  }, null, 8, ["param", "order", "options"])
208
210
  ]),
209
211
  _: 1
210
- }, 8, ["label", "class", "align"])) : u("", !0)
211
- ])) : u("", !0),
212
- L(M) ? (s(), g(T, {
212
+ }, 8, ["label", "class", "align"])) : r("", !0)
213
+ ])) : r("", !0),
214
+ w(b) ? (s(), m(C, {
213
215
  key: 1,
214
216
  tag: "ul",
215
- name: "scaleTransition",
216
- class: b(["o-hidden bg-light radius-big", e.$attrs.class])
217
+ name: "scaleTransition"
217
218
  }, {
218
219
  default: k(() => [
219
- L(M) ? (s(!0), S(C, { key: 0 }, D(L(m), (c) => (s(), g(q, {
220
- key: "skeleton-" + c
221
- }))), 128)) : u("", !0)
220
+ w(b) ? (s(!0), S(j, { key: 0 }, G(w(f), (c) => (s(), m(q, {
221
+ key: "skeleton-" + c,
222
+ class: "mn-b-small radius-big o-hidden d-block"
223
+ }))), 128)) : r("", !0)
222
224
  ]),
223
225
  _: 1
224
- }, 8, ["class"])) : u("", !0),
225
- y(G, { name: "scaleTransition" }, {
226
+ })) : r("", !0),
227
+ !w(b) && n.value.length < 1 ? (s(), m(C, {
228
+ key: 2,
229
+ tag: "ul",
230
+ name: "feed"
231
+ }, {
226
232
  default: k(() => [
227
- !L(M) && n.value.length < 1 ? (s(), g(A, {
233
+ !w(b) && n.value.length < 1 ? (s(), m(A, {
228
234
  key: 0,
229
- title: r.states.empty.title,
230
- description: r.states.empty.description,
231
- action: r.states.empty.action,
232
- callback: r.states.empty.callback,
235
+ title: u.states.empty.title,
236
+ description: u.states.empty.description,
237
+ action: u.states.empty.action,
238
+ callback: u.states.empty.callback,
233
239
  class: "pd-medium mn-b-thin bg-light radius-big"
234
- }, null, 8, ["title", "description", "action", "callback"])) : u("", !0)
240
+ }, null, 8, ["title", "description", "action", "callback"])) : r("", !0)
235
241
  ]),
236
242
  _: 1
237
- }),
238
- y(T, {
243
+ })) : r("", !0),
244
+ B(C, {
239
245
  tag: "ul",
240
246
  name: "feed",
241
- class: b(e.$attrs.class)
247
+ class: y(e.$attrs.class)
242
248
  }, {
243
249
  default: k(() => [
244
- !L(M) && n.value.length > 0 ? R(e.$slots, "default", {
250
+ !w(b) && n.value.length > 0 ? R(e.$slots, "default", {
245
251
  key: 0,
246
252
  items: n.value
247
- }) : u("", !0),
248
- r.showLoadMore && v.value && n.value.length > 0 ? (s(), S("button", {
253
+ }) : r("", !0),
254
+ u.showLoadMore && v.value && n.value.length > 0 ? (s(), S("button", {
249
255
  key: 1,
250
- onClick: E,
256
+ onClick: I,
251
257
  class: "col-w-100 w-100 bg-main button"
252
- }, " Load More ")) : u("", !0),
253
- I("div", {
258
+ }, " Load More ")) : r("", !0),
259
+ U("div", {
254
260
  key: "sentinel",
255
261
  ref_key: "sentinel",
256
- ref: j,
262
+ ref: E,
257
263
  class: "sentinel"
258
264
  }, null, 512)
259
265
  ]),
@@ -263,5 +269,5 @@ const _ = {
263
269
  }
264
270
  };
265
271
  export {
266
- pe as default
272
+ ve as default
267
273
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */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;
@@ -0,0 +1,84 @@
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
+ /* empty css */
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"),k=require("../Field/Field.vue2.cjs"),B=require("vue-i18n"),w={class:"pd-thin radius-extra flex-nowrap flex"},S=["innerHTML"],_={__name:"FieldBig",props:{input:String,placeholder:{type:String},action:{type:String,default:"Action"},placeholderTexts:{type:Object,default:()=>({en:["Lowest THC, please!","Something with banana flavors?","I'm in the mood for trippy vibes."],ru:["Я хочу самый низкий THC","Я хочу чего-нибудь бананового","Я хочу курнуть хейза"]})},typingSpeed:{type:Number,default:200},loopTyping:{type:Boolean,default:!1},enableTyping:{type:Boolean,default:!1}},emits:["update:input","action"],setup(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",w,[e.createVNode(k.default,{field:e.unref(n),"onUpdate:field":[l[0]||(l[0]=u=>e.isRef(n)?n.value=u:n=u),T],placeholder:e.unref(i)?" ":e.unref(p),onInput: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-nowrap 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,S)):e.createCommentVNode("",!0)]))}};exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../Field/Field.vue2.cjs"),k=require("../../modules/icons/navigation/IconArrow.vue.cjs"),B=require("vue-i18n"),S={class:"pd-thin radius-extra flex-nowrap flex"},F={__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:N,locale:c}=B.useI18n();let r=e.ref(0),a=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 m=y;function b(){m("action")}function T(n){m("update:input",n),f.value=n}function g(){r.value=(r.value+1)%t.placeholderTexts[c.value].length}function I(){i.value=!1,clearInterval(d.value),p.value=t.placeholder,f.value||(a.value="")}function x(){!f.value&&t.enableTyping&&(i.value=!0,p.value="",h())}function h(){let n=t.placeholderTexts[c.value][r.value],l=0,u=!1;v=setInterval(()=>{o.value=!o.value},200),d.value=setInterval(()=>{i.value&&(u?(a.value=a.value.slice(0,-1),a.value=n.substring(0,l)+(o.value&&l%2?"|":""),l--):(a.value=n.substring(0,l)+(o.value&&l%2?"|":""),l++),l>n.length&&t.loopTyping&&setTimeout(()=>{u=!0,a.value=n.substring(0,l)},333),l===0&&u&&(u=!1,g(),n=t.placeholderTexts[c.value][r.value]))},t.typingSpeed)}return e.onMounted(()=>{t.enableTyping&&h()}),e.watchEffect(()=>{i.value||(clearInterval(d.value),clearInterval(v))}),(n,l)=>(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(w.default,{field:e.unref(a),"onUpdate:field":[l[0]||(l[0]=u=>e.isRef(a)?a.value=u:a=u),T],placeholder:e.unref(i)?" ":e.unref(p),onInput:g,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-nowrap t-medium radius-big uppercase cursor-pointer flex flex-v-center pd-r-small pd-l-small w-max hover-bg-fifth t-semi transition-linear transition-timing-1 t-black bg-main"},[e.createElementVNode("span",null,e.toDisplayString(s.action),1),e.createVNode(k.default,{class:"mn-l-thin radius-extra bg-white i-medium"})])):e.createCommentVNode("",!0)]))}};exports.default=F;
@@ -1,7 +1,8 @@
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";
3
- import { useI18n as M } from "vue-i18n";
4
- const N = { class: "pd-thin radius-extra flex-nowrap flex" }, V = ["innerHTML"], P = {
1
+ import { ref as i, onMounted as F, watchEffect as C, openBlock as b, createElementBlock as x, createVNode as T, unref as v, isRef as N, createElementVNode as V, toDisplayString as _, createCommentVNode as E } from "vue";
2
+ import A from "../Field/Field.vue2.js";
3
+ import H from "../../modules/icons/navigation/IconArrow.vue.js";
4
+ import { useI18n as j } from "vue-i18n";
5
+ const D = { class: "pd-thin radius-extra flex-nowrap flex" }, U = {
5
6
  __name: "FieldBig",
6
7
  props: {
7
8
  input: String,
@@ -42,60 +43,62 @@ const N = { class: "pd-thin radius-extra flex-nowrap flex" }, V = ["innerHTML"],
42
43
  },
43
44
  emits: ["update:input", "action"],
44
45
  setup(p, { emit: I }) {
45
- const l = p, { t: A, locale: s } = M();
46
- let o = i(0), t = i(l.input), c = i(l.placeholder), u = i(l.enableTyping), d = i(null), f = i(""), r = i(!0), m = null;
46
+ const l = p, { t: L, locale: s } = j();
47
+ let r = i(0), t = i(l.input), c = i(l.placeholder), u = i(l.enableTyping), d = i(null), f = i(""), o = i(!0), m = null;
47
48
  const g = I;
48
- function x() {
49
+ function w() {
49
50
  g("action");
50
51
  }
51
- function w(a) {
52
+ function k(a) {
52
53
  g("update:input", a), f.value = a;
53
54
  }
54
55
  function h() {
55
- o.value = (o.value + 1) % l.placeholderTexts[s.value].length;
56
+ r.value = (r.value + 1) % l.placeholderTexts[s.value].length;
56
57
  }
57
- function k() {
58
+ function B() {
58
59
  u.value = !1, clearInterval(d.value), c.value = l.placeholder, f.value || (t.value = "");
59
60
  }
60
- function B() {
61
+ function S() {
61
62
  !f.value && l.enableTyping && (u.value = !0, c.value = "", y());
62
63
  }
63
64
  function y() {
64
- let a = l.placeholderTexts[s.value][o.value], e = 0, n = !1;
65
+ let a = l.placeholderTexts[s.value][r.value], e = 0, n = !1;
65
66
  m = setInterval(() => {
66
- r.value = !r.value;
67
+ o.value = !o.value;
67
68
  }, 200), d.value = setInterval(() => {
68
- u.value && (n ? (t.value = t.value.slice(0, -1), t.value = a.substring(0, e) + (r.value && e % 2 ? "|" : ""), e--) : (t.value = a.substring(0, e) + (r.value && e % 2 ? "|" : ""), e++), e > a.length && l.loopTyping && setTimeout(() => {
69
+ u.value && (n ? (t.value = t.value.slice(0, -1), t.value = a.substring(0, e) + (o.value && e % 2 ? "|" : ""), e--) : (t.value = a.substring(0, e) + (o.value && e % 2 ? "|" : ""), e++), e > a.length && l.loopTyping && setTimeout(() => {
69
70
  n = !0, t.value = a.substring(0, e);
70
- }, 333), e === 0 && n && (n = !1, h(), a = l.placeholderTexts[s.value][o.value]));
71
+ }, 333), e === 0 && n && (n = !1, h(), a = l.placeholderTexts[s.value][r.value]));
71
72
  }, l.typingSpeed);
72
73
  }
73
- return S(() => {
74
+ return F(() => {
74
75
  l.enableTyping && y();
75
- }), F(() => {
76
+ }), C(() => {
76
77
  u.value || (clearInterval(d.value), clearInterval(m));
77
- }), (a, e) => (T(), b("div", N, [
78
- C(L, {
78
+ }), (a, e) => (b(), x("div", D, [
79
+ T(A, {
79
80
  field: v(t),
80
81
  "onUpdate:field": [
81
- e[0] || (e[0] = (n) => H(t) ? t.value = n : t = n),
82
- w
82
+ e[0] || (e[0] = (n) => N(t) ? t.value = n : t = n),
83
+ k
83
84
  ],
84
85
  placeholder: v(u) ? " " : v(c),
85
86
  onInput: h,
86
- onFocus: k,
87
- onBlur: B,
87
+ onFocus: B,
88
+ onBlur: S,
88
89
  class: "w-100 p-medium t-regular uppercase pd-small"
89
90
  }, null, 8, ["field", "placeholder"]),
90
- p.action ? (T(), b("button", {
91
+ p.action ? (b(), x("button", {
91
92
  key: 0,
92
- onClick: x,
93
- class: "t-nowrap 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",
94
- innerHTML: p.action
95
- }, null, 8, V)) : _("", !0)
93
+ onClick: w,
94
+ class: "t-nowrap t-medium radius-big uppercase cursor-pointer flex flex-v-center pd-r-small pd-l-small w-max hover-bg-fifth t-semi transition-linear transition-timing-1 t-black bg-main"
95
+ }, [
96
+ V("span", null, _(p.action), 1),
97
+ T(H, { class: "mn-l-thin radius-extra bg-white i-medium" })
98
+ ])) : E("", !0)
96
99
  ]));
97
100
  }
98
101
  };
99
102
  export {
100
- P as default
103
+ U as default
101
104
  };
@@ -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");;/* empty css */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
+ "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");;/* empty css */const w=require("../../../node_modules/libphonenumber-js/min/exports/parsePhoneNumber.cjs"),ue=["tabindex"],ie={class:"flex-nowrap flex flex-v-center p-medium vti__selection"},se=["innerHTML"],de={key:1,class:"vti__country-code"},ce=["onClick","onMousemove"],fe=["innerHTML"],ve={key:1},pe=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex"],ye={key:0,class:"mn-t-thin mn-b-thin invalid-feedback"},me={__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(""),T=e.ref(null),x=e.ref("below"),B=e.ref(n.Placeholder!==""?n.Placeholder:n.inputOptions.placeholder),I=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),z=e.computed(()=>u.value.valid===!0?n.goodStyle:u.value.valid===!1?n.badStyle:void 0),q=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(){B.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(T),T=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-I.value.getBoundingClientRect().bottom>200;x.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,z.value]),ref_key:"rootElement",ref:I},[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",ie,[a.dropdownOptions.showFlags?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:M.value,class:"mn-r-nano"},null,8,se)):e.createCommentVNode("",!0),a.dropdownOptions.showDialCodeInSelection?(e.openBlock(),e.createElementBlock("span",de," +"+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",x.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,fe)):e.createCommentVNode("",!0),e.createElementVNode("strong",null,e.toDisplayString(o.name),1),a.dropdownOptions.showDialCodeInList?(e.openBlock(),e.createElementBlock("span",ve," +"+e.toDisplayString(o.dialCode),1)):e.createCommentVNode("",!0)],42,ce))),128))],6),[[e.vShow,f.value]])],46,ue)),[[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,q.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:B.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,pe),[[e.vModelDynamic,r.value]]),e.renderSlot(t.$slots,"default")],6),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[a.validation?(e.openBlock(),e.createElementBlock("div",ye," * "+e.toDisplayString(a.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64))}};exports.default=me;