@ozdao/martyrs 0.2.541 → 0.2.543

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. package/dist/_virtual/index.cjs +4 -4
  2. package/dist/_virtual/index.js +4 -4
  3. package/dist/_virtual/index2.cjs +3 -6
  4. package/dist/_virtual/index2.cjs.map +1 -1
  5. package/dist/_virtual/index2.js +2 -5
  6. package/dist/_virtual/index2.js.map +1 -1
  7. package/dist/main-BNdv8Ji-.cjs +11 -0
  8. package/dist/{main-BpBtIUcJ.js → main-DUwlesGq.js} +3135 -3555
  9. package/dist/martyrs/src/components/Button/{Button.vue.cjs → Button.vue2.cjs} +2 -2
  10. package/dist/martyrs/src/components/Button/Button.vue2.cjs.map +1 -0
  11. package/dist/martyrs/src/components/Button/{Button.vue.js → Button.vue2.js} +2 -2
  12. package/dist/martyrs/src/components/Button/{Button.vue.cjs.map → Button.vue2.js.map} +1 -1
  13. package/dist/martyrs/src/components/EditImages/EditImages.vue.cjs +93 -0
  14. package/dist/martyrs/src/components/EditImages/EditImages.vue.cjs.map +1 -1
  15. package/dist/martyrs/src/components/EditImages/EditImages.vue.js +94 -1
  16. package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +1 -1
  17. package/dist/martyrs/src/components/EditImages/EditImages.vue2.cjs +0 -93
  18. package/dist/martyrs/src/components/EditImages/EditImages.vue2.cjs.map +1 -1
  19. package/dist/martyrs/src/components/EditImages/EditImages.vue2.js +1 -94
  20. package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +1 -1
  21. package/dist/martyrs/src/components/Feed/Carousel.vue.cjs +4 -2
  22. package/dist/martyrs/src/components/Feed/Carousel.vue.cjs.map +1 -1
  23. package/dist/martyrs/src/components/Feed/Carousel.vue.js +5 -3
  24. package/dist/martyrs/src/components/Feed/Carousel.vue.js.map +1 -1
  25. package/dist/martyrs/src/components/Feed/Feed.vue.cjs +5 -3
  26. package/dist/martyrs/src/components/Feed/Feed.vue.cjs.map +1 -1
  27. package/dist/martyrs/src/components/Feed/Feed.vue.js +5 -3
  28. package/dist/martyrs/src/components/Feed/Feed.vue.js.map +1 -1
  29. package/dist/martyrs/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  30. package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
  31. package/dist/martyrs/src/components/FieldTags/BlockTags.vue.cjs +30 -21
  32. package/dist/martyrs/src/components/FieldTags/BlockTags.vue.cjs.map +1 -1
  33. package/dist/martyrs/src/components/FieldTags/BlockTags.vue.js +32 -23
  34. package/dist/martyrs/src/components/FieldTags/BlockTags.vue.js.map +1 -1
  35. package/dist/martyrs/src/components/FieldTags/FieldTags.vue2.cjs +235 -0
  36. package/dist/martyrs/src/components/FieldTags/FieldTags.vue2.cjs.map +1 -0
  37. package/dist/martyrs/src/components/FieldTags/FieldTags.vue2.js +235 -0
  38. package/dist/martyrs/src/components/FieldTags/FieldTags.vue2.js.map +1 -0
  39. package/dist/martyrs/src/components/Marquee/Marquee.vue.cjs +17 -8
  40. package/dist/martyrs/src/components/Marquee/Marquee.vue.cjs.map +1 -1
  41. package/dist/martyrs/src/components/Marquee/Marquee.vue.js +17 -8
  42. package/dist/martyrs/src/components/Marquee/Marquee.vue.js.map +1 -1
  43. package/dist/martyrs/src/components/Tab/Tab.vue.cjs +3 -1
  44. package/dist/martyrs/src/components/Tab/Tab.vue.cjs.map +1 -1
  45. package/dist/martyrs/src/components/Tab/Tab.vue.js +4 -2
  46. package/dist/martyrs/src/components/Tab/Tab.vue.js.map +1 -1
  47. package/dist/martyrs/src/components/UploadImage/UploadImage.vue2.cjs +219 -0
  48. package/dist/martyrs/src/components/UploadImage/UploadImage.vue2.cjs.map +1 -0
  49. package/dist/martyrs/src/components/UploadImage/UploadImage.vue2.js +219 -0
  50. package/dist/martyrs/src/components/UploadImage/UploadImage.vue2.js.map +1 -0
  51. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +1 -1
  52. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +1 -1
  53. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.cjs +1 -1
  54. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
  55. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +1 -1
  56. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +1 -1
  57. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.cjs +1 -1
  58. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +1 -1
  59. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.cjs +2 -2
  60. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +4 -4
  61. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +1 -1
  62. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +1 -1
  63. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.cjs +1 -1
  64. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +1 -1
  65. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.cjs +1 -1
  66. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +1 -1
  67. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.cjs +1 -1
  68. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +1 -1
  69. package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.cjs +2 -7
  70. package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.cjs.map +1 -1
  71. package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.js +2 -7
  72. package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.js.map +1 -1
  73. package/dist/martyrs/src/modules/community/components/blocks/FooterBlogpost.vue.cjs +2 -13
  74. package/dist/martyrs/src/modules/community/components/blocks/FooterBlogpost.vue.cjs.map +1 -1
  75. package/dist/martyrs/src/modules/community/components/blocks/FooterBlogpost.vue.js +2 -13
  76. package/dist/martyrs/src/modules/community/components/blocks/FooterBlogpost.vue.js.map +1 -1
  77. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.cjs +1 -1
  78. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
  79. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -4
  80. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.cjs.map +1 -1
  81. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -4
  82. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js.map +1 -1
  83. package/dist/martyrs/src/modules/constructor/components/elements/Card.vue.cjs +1 -1
  84. package/dist/martyrs/src/modules/constructor/components/elements/Card.vue.js +2 -2
  85. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  86. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  87. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  88. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  89. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +3 -3
  90. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +22 -22
  91. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  92. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  93. package/dist/martyrs/src/modules/events/components/pages/Event.vue.cjs +1 -1
  94. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
  95. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +2 -2
  96. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  97. package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.cjs +1 -1
  98. package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.js +1 -1
  99. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +1 -1
  100. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +1 -1
  101. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupAuth.vue.cjs +1 -1
  102. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupAuth.vue.js +1 -1
  103. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs +1 -1
  104. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js +1 -1
  105. package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
  106. package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +1 -1
  107. package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.cjs +1 -1
  108. package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.js +1 -1
  109. package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.cjs +1 -1
  110. package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.js +1 -1
  111. package/dist/martyrs/src/modules/globals/views/components/sections/{Filters.vue2.cjs → Filters.vue.cjs} +2 -2
  112. package/dist/martyrs/src/modules/globals/views/components/sections/{Filters.vue2.js.map → Filters.vue.cjs.map} +1 -1
  113. package/dist/martyrs/src/modules/globals/views/components/sections/{Filters.vue2.js → Filters.vue.js} +2 -2
  114. package/dist/martyrs/src/modules/globals/views/components/sections/Filters.vue.js.map +1 -0
  115. package/dist/martyrs/src/modules/globals/views/plugins/alert.plugin.cjs +1 -0
  116. package/dist/martyrs/src/modules/globals/views/plugins/alert.plugin.cjs.map +1 -1
  117. package/dist/martyrs/src/modules/globals/views/plugins/alert.plugin.js +1 -0
  118. package/dist/martyrs/src/modules/globals/views/plugins/alert.plugin.js.map +1 -1
  119. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.cjs +1 -1
  120. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +1 -1
  121. package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.cjs +1 -1
  122. package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
  123. package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.cjs +1 -1
  124. package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
  125. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.cjs +1 -1
  126. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +1 -1
  127. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.cjs +1 -1
  128. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
  129. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.cjs +1 -1
  130. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
  131. package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.cjs +1 -1
  132. package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
  133. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.cjs +1 -1
  134. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
  135. package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.cjs +1 -1
  136. package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
  137. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.cjs +2 -2
  138. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +11 -11
  139. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.cjs +2 -2
  140. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +12 -12
  141. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.cjs +2 -2
  142. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +16 -16
  143. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.cjs +1 -1
  144. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
  145. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.cjs +2 -2
  146. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +16 -16
  147. package/dist/martyrs/src/modules/music/components/pages/Album.vue.cjs +1 -1
  148. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
  149. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.cjs +1 -1
  150. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
  151. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.cjs +1 -1
  152. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
  153. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.cjs +1 -1
  154. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
  155. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.cjs +1 -1
  156. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
  157. package/dist/martyrs/src/modules/music/components/pages/Track.vue.cjs +1 -1
  158. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
  159. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.cjs +1 -1
  160. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
  161. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.cjs +1 -1
  162. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
  163. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.cjs +1 -1
  164. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
  165. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.cjs +1 -1
  166. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +1 -1
  167. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.cjs +1 -1
  168. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -1
  169. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  170. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  171. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
  172. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
  173. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  174. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  175. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.cjs +1 -1
  176. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
  177. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.cjs +1 -1
  178. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
  179. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  180. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  181. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +3 -4
  182. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.cjs.map +1 -1
  183. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +3 -4
  184. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js.map +1 -1
  185. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  186. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  187. package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.cjs +1 -1
  188. package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
  189. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.cjs +2 -2
  190. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +20 -20
  191. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.cjs +1 -1
  192. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
  193. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.cjs +3 -4
  194. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.cjs.map +1 -1
  195. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +3 -4
  196. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js.map +1 -1
  197. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +4 -5
  198. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs.map +1 -1
  199. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +4 -5
  200. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js.map +1 -1
  201. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs +3 -4
  202. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs.map +1 -1
  203. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +3 -4
  204. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js.map +1 -1
  205. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +2 -2
  206. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +6 -6
  207. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  208. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  209. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  210. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  211. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  212. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  213. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
  214. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
  215. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
  216. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  217. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +1 -1
  218. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
  219. package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.cjs +11 -5
  220. package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.cjs.map +1 -1
  221. package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.js +12 -6
  222. package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.js.map +1 -1
  223. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs +5 -2
  224. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs.map +1 -1
  225. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +5 -2
  226. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
  227. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +49 -41
  228. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs.map +1 -1
  229. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +54 -46
  230. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
  231. package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +1 -1
  232. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -1
  233. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +2 -2
  234. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  235. package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs +5 -5
  236. package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs.map +1 -1
  237. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +5 -5
  238. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
  239. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.cjs +1 -1
  240. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
  241. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.cjs +1 -1
  242. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +1 -1
  243. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.cjs +2 -2
  244. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +2 -2
  245. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.cjs +1 -1
  246. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
  247. package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.cjs +1 -1
  248. package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
  249. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  250. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  251. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.cjs +1 -1
  252. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
  253. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  254. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  255. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.cjs +1 -1
  256. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
  257. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +2 -2
  258. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +11 -11
  259. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs +1 -1
  260. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +1 -1
  261. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  262. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
  263. package/dist/martyrs.cjs.js +1 -1
  264. package/dist/martyrs.css +1 -1
  265. package/dist/martyrs.es.js +1 -1
  266. package/dist/node_modules/.pnpm/lodash.merge@4.6.2/node_modules/lodash.merge/index.cjs +1 -1
  267. package/dist/node_modules/.pnpm/lodash.merge@4.6.2/node_modules/lodash.merge/index.js +1 -1
  268. package/dist/style.css +133 -133
  269. package/dist/{web-DsdyXC8n.js → web-C6njYH1C.js} +1 -1
  270. package/dist/{web-C9bVm6Nw.cjs → web-CVdyxtLD.cjs} +1 -1
  271. package/package.json +1 -1
  272. package/src/components/Feed/Carousel.vue +3 -0
  273. package/src/components/Feed/Feed.vue +3 -0
  274. package/src/components/FieldTags/BlockTags.vue +28 -16
  275. package/src/components/FieldTags/FieldTags.vue +327 -508
  276. package/src/components/Marquee/Marquee.vue +25 -14
  277. package/src/components/Tab/Tab.vue +2 -0
  278. package/src/components/UploadImage/UploadImage.vue +192 -18
  279. package/src/modules/community/components/blocks/CardBlogpost.vue +2 -7
  280. package/src/modules/community/components/blocks/FooterBlogpost.vue +2 -13
  281. package/src/modules/community/components/pages/CreateBlogPost.vue +0 -1
  282. package/src/modules/globals/TASK.MD +105 -1
  283. package/src/modules/globals/views/plugins/alert.plugin.js +1 -0
  284. package/src/modules/products/components/blocks/CardCategory.vue +6 -0
  285. package/src/modules/products/components/pages/Categories.vue +4 -1
  286. package/src/modules/products/components/pages/CategoryEdit.vue +53 -39
  287. package/src/modules/products/components/pages/Products.vue +1 -1
  288. package/dist/_virtual/index3.cjs +0 -5
  289. package/dist/_virtual/index3.cjs.map +0 -1
  290. package/dist/_virtual/index3.js +0 -5
  291. package/dist/_virtual/index3.js.map +0 -1
  292. package/dist/main-7IA3UHca.cjs +0 -11
  293. package/dist/martyrs/src/components/Button/Button.vue.js.map +0 -1
  294. package/dist/martyrs/src/components/FieldTags/FieldTags.vue.cjs +0 -480
  295. package/dist/martyrs/src/components/FieldTags/FieldTags.vue.cjs.map +0 -1
  296. package/dist/martyrs/src/components/FieldTags/FieldTags.vue.js +0 -480
  297. package/dist/martyrs/src/components/FieldTags/FieldTags.vue.js.map +0 -1
  298. package/dist/martyrs/src/components/FieldTags/create-tags.cjs +0 -52
  299. package/dist/martyrs/src/components/FieldTags/create-tags.cjs.map +0 -1
  300. package/dist/martyrs/src/components/FieldTags/create-tags.js +0 -52
  301. package/dist/martyrs/src/components/FieldTags/create-tags.js.map +0 -1
  302. package/dist/martyrs/src/components/FieldTags/tag-input.vue2.cjs +0 -32
  303. package/dist/martyrs/src/components/FieldTags/tag-input.vue2.cjs.map +0 -1
  304. package/dist/martyrs/src/components/FieldTags/tag-input.vue2.js +0 -32
  305. package/dist/martyrs/src/components/FieldTags/tag-input.vue2.js.map +0 -1
  306. package/dist/martyrs/src/components/FieldTags/vue-tags-input.props.cjs +0 -329
  307. package/dist/martyrs/src/components/FieldTags/vue-tags-input.props.cjs.map +0 -1
  308. package/dist/martyrs/src/components/FieldTags/vue-tags-input.props.js +0 -329
  309. package/dist/martyrs/src/components/FieldTags/vue-tags-input.props.js.map +0 -1
  310. package/dist/martyrs/src/components/UploadImage/UploadImage.vue.cjs +0 -100
  311. package/dist/martyrs/src/components/UploadImage/UploadImage.vue.cjs.map +0 -1
  312. package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js +0 -100
  313. package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js.map +0 -1
  314. package/dist/martyrs/src/modules/globals/views/components/sections/Filters.vue2.cjs.map +0 -1
  315. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.cjs +0 -39
  316. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.cjs.map +0 -1
  317. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +0 -39
  318. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js.map +0 -1
  319. package/src/components/FieldTags/FieldTagsNew.vue +0 -366
  320. package/src/components/FieldTags/README.md +0 -513
  321. package/src/components/FieldTags/create-tags.js +0 -97
  322. package/src/components/FieldTags/tag-input.vue +0 -55
  323. package/src/components/FieldTags/vue-tags-input.props.js +0 -342
  324. package/src/components/FieldTags/vue-tags-input.scss +0 -149
@@ -1,480 +0,0 @@
1
- import { ref, shallowRef, computed, watch, onMounted, onBeforeUnmount, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, renderSlot, createCommentVNode, Fragment, renderList, createBlock, toDisplayString, withDirectives, withModifiers, vShow, withKeys, unref, nextTick } from "vue";
2
- import equal from "../../../../_virtual/index.js";
3
- import { createTag, createClasses, createTags, clone } from "./create-tags.js";
4
- import TagInput from "./tag-input.vue2.js";
5
- import props from "./vue-tags-input.props.js";
6
- /* empty css */
7
- const _hoisted_1 = { class: "ti-input" };
8
- const _hoisted_2 = {
9
- key: 0,
10
- class: "ti-tags"
11
- };
12
- const _hoisted_3 = ["onClick"];
13
- const _hoisted_4 = { class: "ti-content" };
14
- const _hoisted_5 = {
15
- key: 0,
16
- class: "ti-tag-left"
17
- };
18
- const _hoisted_6 = ["onClick"];
19
- const _hoisted_7 = {
20
- key: 1,
21
- class: "ti-tag-right"
22
- };
23
- const _hoisted_8 = { class: "ti-actions" };
24
- const _hoisted_9 = ["onClick"];
25
- const _hoisted_10 = ["onClick"];
26
- const _hoisted_11 = { class: "ti-new-tag-input-wrapper" };
27
- const _hoisted_12 = ["placeholder", "value", "maxlength", "disabled"];
28
- const _hoisted_13 = ["onMouseenter"];
29
- const _hoisted_14 = ["onClick"];
30
- const _sfc_main = {
31
- __name: "FieldTags",
32
- props,
33
- emits: [
34
- "adding-duplicate",
35
- "before-adding-tag",
36
- "before-deleting-tag",
37
- "before-editing-tag",
38
- "before-saving-tag",
39
- "max-tags-reached",
40
- "saving-duplicate",
41
- "tags-changed",
42
- "tag-clicked",
43
- "update:modelValue",
44
- "update:tags"
45
- ],
46
- setup(__props, { expose: __expose, emit: __emit }) {
47
- const propsObj = __props;
48
- const emit = __emit;
49
- const tagCenterRefs = ref(/* @__PURE__ */ new Map());
50
- const newTag = ref(propsObj.modelValue || "");
51
- const tagsCopy = shallowRef([]);
52
- const tagsEditStatus = ref([]);
53
- const deletionMark = ref(null);
54
- const deletionMarkTimer = ref(null);
55
- const selectedItem = ref(null);
56
- const focused = ref(false);
57
- const newTagInputRef = ref(null);
58
- const autocompleteOpen = computed(() => {
59
- if (propsObj.autocompleteAlwaysOpen) return true;
60
- return newTag.value !== null && newTag.value.length >= propsObj.autocompleteMinLength && filteredAutocompleteItems.value.length > 0 && focused.value;
61
- });
62
- const filteredAutocompleteItems = computed(() => {
63
- const items = propsObj.autocompleteItems.map(
64
- (i) => createTag(i, propsObj.tags, propsObj.validation, propsObj.isDuplicate)
65
- );
66
- if (!propsObj.autocompleteFilterDuplicates) return items;
67
- return items.filter(duplicateFilter);
68
- });
69
- const getSelectedIndex = (method) => {
70
- const items = filteredAutocompleteItems.value;
71
- const current = selectedItem.value;
72
- const lastItem = items.length - 1;
73
- if (items.length === 0) return;
74
- if (current === null) return 0;
75
- if (method === "before" && current === 0) return lastItem;
76
- if (method === "after" && current === lastItem) return 0;
77
- return method === "after" ? current + 1 : current - 1;
78
- };
79
- const selectDefaultItem = () => {
80
- selectedItem.value = propsObj.addOnlyFromAutocomplete && filteredAutocompleteItems.value.length > 0 ? 0 : null;
81
- };
82
- const selectItem = (method) => {
83
- selectedItem.value = getSelectedIndex(method);
84
- };
85
- const isSelected = (index) => selectedItem.value === index;
86
- const isMarked = (index) => deletionMark.value === index;
87
- const setTagCenter = (el, index) => {
88
- if (el) {
89
- tagCenterRefs.value.set(index, el);
90
- } else {
91
- tagCenterRefs.value.delete(index);
92
- }
93
- };
94
- const invokeDelete = () => {
95
- if (!propsObj.deleteOnBackspace || newTag.value.length > 0) return;
96
- const lastIndex = tagsCopy.value.length - 1;
97
- if (deletionMark.value === null) {
98
- clearTimeout(deletionMarkTimer.value);
99
- deletionMarkTimer.value = setTimeout(() => deletionMark.value = null, 1e3);
100
- deletionMark.value = lastIndex;
101
- } else {
102
- performDeleteTag(lastIndex);
103
- }
104
- };
105
- const addTagsFromPaste = () => {
106
- if (!propsObj.addFromPaste) return;
107
- setTimeout(() => performAddTags(newTag.value), 10);
108
- };
109
- const performEditTag = (index) => {
110
- if (!propsObj.allowEditTags) return;
111
- if (!propsObj.onBeforeEditingTag) {
112
- editTag(index);
113
- } else {
114
- emit("before-editing-tag", {
115
- index,
116
- tag: tagsCopy.value[index],
117
- editTag: () => editTag(index)
118
- });
119
- }
120
- };
121
- const editTag = (index) => {
122
- if (!propsObj.allowEditTags) return;
123
- toggleEditMode(index);
124
- focus(index);
125
- };
126
- const toggleEditMode = (index) => {
127
- if (!propsObj.allowEditTags || propsObj.disabled) return;
128
- tagsEditStatus.value[index] = !tagsEditStatus.value[index];
129
- };
130
- const createChangedTag = (index, event) => {
131
- const tag = tagsCopy.value[index];
132
- tag.text = event ? event.target.value : tagsCopy.value[index].text;
133
- const newTags = [...tagsCopy.value];
134
- newTags[index] = createTag(tag, tagsCopy.value, propsObj.validation, propsObj.isDuplicate);
135
- tagsCopy.value = newTags;
136
- };
137
- const focus = (index) => {
138
- nextTick(() => {
139
- const el = tagCenterRefs.value.get(index)?.querySelector("input.ti-tag-input");
140
- if (el) el.focus();
141
- });
142
- };
143
- const quote = (regex) => regex.replace(/([()[{*+.$^\\|?])/g, "\\$1");
144
- const cancelEdit = (index) => {
145
- if (!propsObj.tags[index]) return;
146
- const newTags = [...tagsCopy.value];
147
- newTags[index] = clone(createTag(propsObj.tags[index], propsObj.tags, propsObj.validation, propsObj.isDuplicate));
148
- tagsCopy.value = newTags;
149
- tagsEditStatus.value[index] = false;
150
- };
151
- const hasForbiddingAddRule = (tiClasses) => {
152
- return tiClasses.some((type) => {
153
- const rule = propsObj.validation.find((rule2) => type === rule2.classes);
154
- return rule ? rule.disableAdd : false;
155
- });
156
- };
157
- const createTagTexts = (string) => {
158
- const regex = new RegExp(propsObj.separators.map((s) => quote(s)).join("|"));
159
- return string.split(regex).map((text) => ({ text }));
160
- };
161
- const performDeleteTag = (index) => {
162
- if (!propsObj.onBeforeDeletingTag) {
163
- deleteTag(index);
164
- } else {
165
- emit("before-deleting-tag", {
166
- index,
167
- tag: tagsCopy.value[index],
168
- deleteTag: () => deleteTag(index)
169
- });
170
- }
171
- };
172
- const deleteTag = (index) => {
173
- if (propsObj.disabled) return;
174
- deletionMark.value = null;
175
- clearTimeout(deletionMarkTimer.value);
176
- const newTags = [...tagsCopy.value];
177
- newTags.splice(index, 1);
178
- tagsCopy.value = newTags;
179
- tagsEditStatus.value.splice(index, 1);
180
- emit("update:tags", tagsCopy.value);
181
- emit("tags-changed", tagsCopy.value);
182
- };
183
- const noTriggerKey = (event, category) => {
184
- const triggerKey = propsObj[category].indexOf(event.keyCode) !== -1 || propsObj[category].indexOf(event.key) !== -1;
185
- if (triggerKey) event.preventDefault();
186
- return !triggerKey;
187
- };
188
- const performAddTags = (tag, event, source) => {
189
- if (propsObj.disabled || event && noTriggerKey(event, "addOnKey")) return;
190
- let tags = [];
191
- if (typeof tag === "object") tags = [tag];
192
- if (typeof tag === "string") tags = createTagTexts(tag);
193
- tags = tags.filter((tag2) => tag2.text.trim().length > 0);
194
- tags.forEach((tag2) => {
195
- tag2 = createTag(tag2, propsObj.tags, propsObj.validation, propsObj.isDuplicate);
196
- if (!propsObj.onBeforeAddingTag) {
197
- addTag(tag2, source);
198
- } else {
199
- emit("before-adding-tag", {
200
- tag: tag2,
201
- addTag: () => addTag(tag2, source)
202
- });
203
- }
204
- });
205
- };
206
- const duplicateFilter = (tag) => {
207
- return propsObj.isDuplicate ? !propsObj.isDuplicate(tagsCopy.value, tag) : !tagsCopy.value.find((t) => t.text === tag.text);
208
- };
209
- const addTag = (tag, source = "new-tag-input") => {
210
- const options = filteredAutocompleteItems.value.map((i) => i.text);
211
- if (propsObj.addOnlyFromAutocomplete && options.indexOf(tag.text) === -1) return;
212
- nextTick(() => {
213
- const maximumReached = propsObj.maxTags && propsObj.maxTags <= tagsCopy.value.length;
214
- if (maximumReached) return emit("max-tags-reached", tag);
215
- const dup = propsObj.avoidAddingDuplicates && !duplicateFilter(tag);
216
- if (dup) return emit("adding-duplicate", tag);
217
- if (hasForbiddingAddRule(tag.tiClasses)) return;
218
- newTag.value = "";
219
- tagsCopy.value = [...tagsCopy.value, tag];
220
- tagsEditStatus.value.push(false);
221
- emit("update:tags", tagsCopy.value);
222
- if (source === "autocomplete") newTagInputRef.value?.focus();
223
- emit("tags-changed", tagsCopy.value);
224
- });
225
- };
226
- const performSaveTag = (index, event) => {
227
- const tag = tagsCopy.value[index];
228
- if (propsObj.disabled || event && noTriggerKey(event, "addOnKey")) return;
229
- if (tag.text.trim().length === 0) return;
230
- if (!propsObj["onBeforeSavingTag"]) {
231
- saveTag(index, tag);
232
- } else {
233
- emit("before-saving-tag", {
234
- index,
235
- tag,
236
- saveTag: () => saveTag(index, tag)
237
- });
238
- }
239
- };
240
- const saveTag = (index, tag) => {
241
- if (propsObj.avoidAddingDuplicates) {
242
- const tagsDiff = clone(tagsCopy.value);
243
- const inputTag = tagsDiff.splice(index, 1)[0];
244
- const dup = propsObj.isDuplicate ? propsObj.isDuplicate(tagsDiff, inputTag) : tagsDiff.map((t) => t.text).indexOf(inputTag.text) !== -1;
245
- if (dup) return emit("saving-duplicate", tag);
246
- }
247
- if (hasForbiddingAddRule(tag.tiClasses)) return;
248
- const newTags = [...tagsCopy.value];
249
- newTags[index] = tag;
250
- tagsCopy.value = newTags;
251
- toggleEditMode(index);
252
- emit("update:tags", tagsCopy.value);
253
- emit("tags-changed", tagsCopy.value);
254
- };
255
- const tagsEqual = () => {
256
- return !tagsCopy.value.some((t, i) => !equal(t, propsObj.tags[i]));
257
- };
258
- const updateNewTag = (event) => {
259
- const value = event.target.value;
260
- newTag.value = value;
261
- emit("update:modelValue", value);
262
- };
263
- const initTags = () => {
264
- tagsCopy.value = createTags(propsObj.tags, propsObj.validation, propsObj.isDuplicate);
265
- tagsEditStatus.value = new Array(propsObj.tags.length).fill(false);
266
- if (!tagsEqual()) {
267
- emit("update:tags", tagsCopy.value);
268
- }
269
- };
270
- const blurredOnClick = (e) => {
271
- const el = e.currentTarget;
272
- if (el?.contains(e.target) || el?.contains(document.activeElement)) return;
273
- performBlur();
274
- };
275
- const performBlur = () => {
276
- if (propsObj.addOnBlur && focused.value) performAddTags(newTag.value);
277
- focused.value = false;
278
- };
279
- const handleKeyDown = (event) => {
280
- const item = filteredAutocompleteItems.value[selectedItem.value] || newTag.value;
281
- performAddTags(item, event);
282
- };
283
- watch(() => propsObj.modelValue, (newValue) => {
284
- if (!propsObj.addOnlyFromAutocomplete) selectedItem.value = null;
285
- newTag.value = newValue;
286
- });
287
- watch(() => propsObj.tags, () => {
288
- initTags();
289
- }, { deep: true });
290
- watch(autocompleteOpen, selectDefaultItem);
291
- initTags();
292
- onMounted(() => {
293
- selectDefaultItem();
294
- document.addEventListener("click", blurredOnClick);
295
- });
296
- onBeforeUnmount(() => {
297
- document.removeEventListener("click", blurredOnClick);
298
- clearTimeout(deletionMarkTimer.value);
299
- });
300
- __expose({
301
- createClasses
302
- });
303
- return (_ctx, _cache) => {
304
- return openBlock(), createElementBlock("div", {
305
- class: normalizeClass(["vue-tags-input pos-relative", [{ "ti-disabled": _ctx.disabled }, { "ti-focus": focused.value }, _ctx.$attrs.class]]),
306
- style: normalizeStyle(_ctx.$attrs.style)
307
- }, [
308
- createElementVNode("div", _hoisted_1, [
309
- tagsCopy.value.length || !_ctx.disabled ? (openBlock(), createElementBlock("ul", _hoisted_2, [
310
- (openBlock(true), createElementBlock(Fragment, null, renderList(tagsCopy.value, (tag, index) => {
311
- return openBlock(), createElementBlock("li", {
312
- key: `tag-${index}-${tag.text}`,
313
- style: normalizeStyle(tag.style),
314
- class: normalizeClass([[
315
- { "ti-editing": tagsEditStatus.value[index] },
316
- tag.tiClasses,
317
- tag.classes,
318
- { "ti-deletion-mark": isMarked(index) }
319
- ], "ti-tag t-medium"]),
320
- tabindex: "0",
321
- onClick: ($event) => emit("tag-clicked", { tag, index })
322
- }, [
323
- createElementVNode("div", _hoisted_4, [
324
- _ctx.$slots["tag-left"] ? (openBlock(), createElementBlock("div", _hoisted_5, [
325
- renderSlot(_ctx.$slots, "tag-left", {
326
- tag,
327
- index,
328
- edit: tagsEditStatus.value[index],
329
- performSaveEdit: performSaveTag,
330
- performDelete: performDeleteTag,
331
- performCancelEdit: cancelEdit,
332
- performOpenEdit: performEditTag,
333
- deletionMark: isMarked(index)
334
- })
335
- ])) : createCommentVNode("", true),
336
- createElementVNode("div", {
337
- ref_for: true,
338
- ref: (el) => setTagCenter(el, index),
339
- class: "ti-tag-center"
340
- }, [
341
- !_ctx.$slots["tag-center"] ? (openBlock(), createElementBlock("span", {
342
- key: 0,
343
- class: normalizeClass({ "ti-hidden": tagsEditStatus.value[index] }),
344
- onClick: ($event) => performEditTag(index)
345
- }, toDisplayString(tag.text), 11, _hoisted_6)) : createCommentVNode("", true),
346
- !_ctx.$slots["tag-center"] ? (openBlock(), createBlock(TagInput, {
347
- key: 1,
348
- scope: {
349
- edit: tagsEditStatus.value[index],
350
- maxlength: _ctx.maxlength,
351
- tag,
352
- index,
353
- validateTag: createChangedTag,
354
- performCancelEdit: cancelEdit,
355
- performSaveEdit: performSaveTag
356
- }
357
- }, null, 8, ["scope"])) : createCommentVNode("", true),
358
- renderSlot(_ctx.$slots, "tag-center", {
359
- tag,
360
- index,
361
- maxlength: _ctx.maxlength,
362
- edit: tagsEditStatus.value[index],
363
- performSaveEdit: performSaveTag,
364
- performDelete: performDeleteTag,
365
- performCancelEdit: cancelEdit,
366
- validateTag: createChangedTag,
367
- performOpenEdit: performEditTag,
368
- deletionMark: isMarked(index)
369
- })
370
- ], 512),
371
- _ctx.$slots["tag-right"] ? (openBlock(), createElementBlock("div", _hoisted_7, [
372
- renderSlot(_ctx.$slots, "tag-right", {
373
- tag,
374
- index,
375
- edit: tagsEditStatus.value[index],
376
- performSaveEdit: performSaveTag,
377
- performDelete: performDeleteTag,
378
- performCancelEdit: cancelEdit,
379
- performOpenEdit: performEditTag,
380
- deletionMark: isMarked(index)
381
- })
382
- ])) : createCommentVNode("", true)
383
- ]),
384
- createElementVNode("div", _hoisted_8, [
385
- !_ctx.$slots["tag-actions"] ? withDirectives((openBlock(), createElementBlock("i", {
386
- key: 0,
387
- class: "ti-icon-undo",
388
- onClick: withModifiers(($event) => cancelEdit(index), ["stop"])
389
- }, null, 8, _hoisted_9)), [
390
- [vShow, tagsEditStatus.value[index]]
391
- ]) : createCommentVNode("", true),
392
- !_ctx.$slots["tag-actions"] ? withDirectives((openBlock(), createElementBlock("i", {
393
- key: 1,
394
- class: "ti-icon-close",
395
- onClick: withModifiers(($event) => performDeleteTag(index), ["stop"])
396
- }, null, 8, _hoisted_10)), [
397
- [vShow, !tagsEditStatus.value[index]]
398
- ]) : createCommentVNode("", true),
399
- _ctx.$slots["tag-actions"] ? renderSlot(_ctx.$slots, "tag-actions", {
400
- key: 2,
401
- tag,
402
- index,
403
- edit: tagsEditStatus.value[index],
404
- performSaveEdit: performSaveTag,
405
- performDelete: performDeleteTag,
406
- performCancelEdit: cancelEdit,
407
- performOpenEdit: performEditTag,
408
- deletionMark: isMarked(index)
409
- }) : createCommentVNode("", true)
410
- ])
411
- ], 14, _hoisted_3);
412
- }), 128)),
413
- createElementVNode("li", _hoisted_11, [
414
- createElementVNode("input", {
415
- ref_key: "newTagInputRef",
416
- ref: newTagInputRef,
417
- class: normalizeClass([[unref(createClasses)(newTag.value, _ctx.tags, _ctx.validation, _ctx.isDuplicate)], "ti-new-tag-input"]),
418
- placeholder: _ctx.placeholder,
419
- value: newTag.value,
420
- maxlength: _ctx.maxlength,
421
- disabled: _ctx.disabled,
422
- type: "text",
423
- size: "1",
424
- onKeydown: [
425
- handleKeyDown,
426
- withKeys(invokeDelete, ["delete"]),
427
- withKeys(performBlur, ["tab"]),
428
- _cache[0] || (_cache[0] = withKeys(withModifiers(($event) => selectItem("before"), ["prevent"]), ["up"])),
429
- _cache[1] || (_cache[1] = withKeys(withModifiers(($event) => selectItem("after"), ["prevent"]), ["down"]))
430
- ],
431
- onPaste: addTagsFromPaste,
432
- onInput: updateNewTag,
433
- onFocus: _cache[2] || (_cache[2] = ($event) => focused.value = true),
434
- onClick: _cache[3] || (_cache[3] = ($event) => !_ctx.addOnlyFromAutocomplete && (selectedItem.value = null))
435
- }, null, 42, _hoisted_12)
436
- ])
437
- ])) : createCommentVNode("", true)
438
- ]),
439
- renderSlot(_ctx.$slots, "between-elements"),
440
- autocompleteOpen.value ? (openBlock(), createElementBlock("div", {
441
- key: 0,
442
- class: normalizeClass(["ti-autocomplete", _ctx.$attrs.class]),
443
- onMouseleave: _cache[4] || (_cache[4] = ($event) => selectedItem.value = null)
444
- }, [
445
- renderSlot(_ctx.$slots, "autocomplete-header"),
446
- createElementVNode("ul", null, [
447
- (openBlock(true), createElementBlock(Fragment, null, renderList(filteredAutocompleteItems.value, (item, index) => {
448
- return openBlock(), createElementBlock("li", {
449
- key: `autocomplete-${index}-${item.text}`,
450
- style: normalizeStyle(item.style),
451
- class: normalizeClass([[
452
- item.tiClasses,
453
- item.classes,
454
- { "ti-selected-item": isSelected(index) }
455
- ], "ti-item"]),
456
- onMouseenter: ($event) => !_ctx.disabled && (selectedItem.value = index)
457
- }, [
458
- !_ctx.$slots["autocomplete-item"] ? (openBlock(), createElementBlock("div", {
459
- key: 0,
460
- onClick: ($event) => performAddTags(item, void 0, "autocomplete")
461
- }, toDisplayString(item.text), 9, _hoisted_14)) : renderSlot(_ctx.$slots, "autocomplete-item", {
462
- key: 1,
463
- item,
464
- index,
465
- performAdd: (item2) => performAddTags(item2, void 0, "autocomplete"),
466
- selected: isSelected(index)
467
- })
468
- ], 46, _hoisted_13);
469
- }), 128))
470
- ]),
471
- renderSlot(_ctx.$slots, "autocomplete-footer")
472
- ], 34)) : createCommentVNode("", true)
473
- ], 6);
474
- };
475
- }
476
- };
477
- export {
478
- _sfc_main as default
479
- };
480
- //# sourceMappingURL=FieldTags.vue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldTags.vue.js","sources":["../../../../../src/components/FieldTags/FieldTags.vue"],"sourcesContent":["<template>\n <div\n class=\"vue-tags-input pos-relative\"\n :class=\"[{ 'ti-disabled': disabled }, { 'ti-focus': focused }, $attrs.class]\"\n :style=\"$attrs.style\"\n >\n <div class=\"ti-input\">\n <ul v-if=\"tagsCopy.length || !disabled\" class=\"ti-tags\">\n <li\n v-for=\"(tag, index) in tagsCopy\"\n :key=\"`tag-${index}-${tag.text}`\"\n :style=\"tag.style\"\n :class=\"[\n { 'ti-editing': tagsEditStatus[index] },\n tag.tiClasses,\n tag.classes,\n { 'ti-deletion-mark': isMarked(index) }\n ]\"\n tabindex=\"0\"\n class=\"ti-tag t-medium\"\n @click=\"emit('tag-clicked', { tag, index })\"\n >\n <div class=\"ti-content\">\n <div\n v-if=\"$slots['tag-left']\"\n class=\"ti-tag-left\"\n >\n <slot\n name=\"tag-left\"\n :tag=\"tag\"\n :index=\"index\"\n :edit=\"tagsEditStatus[index]\"\n :perform-save-edit=\"performSaveTag\"\n :perform-delete=\"performDeleteTag\"\n :perform-cancel-edit=\"cancelEdit\"\n :perform-open-edit=\"performEditTag\"\n :deletion-mark=\"isMarked(index)\"\n />\n </div>\n <div :ref=\"el => setTagCenter(el, index)\" class=\"ti-tag-center\">\n <span\n v-if=\"!$slots['tag-center']\"\n :class=\"{ 'ti-hidden': tagsEditStatus[index] }\"\n @click=\"performEditTag(index)\"\n >{{ tag.text }}</span>\n <tag-input\n v-if=\"!$slots['tag-center']\"\n :scope=\"{\n edit: tagsEditStatus[index],\n maxlength,\n tag,\n index,\n validateTag: createChangedTag,\n performCancelEdit: cancelEdit,\n performSaveEdit: performSaveTag,\n }\"\n />\n <slot\n name=\"tag-center\"\n :tag=\"tag\"\n :index=\"index\"\n :maxlength=\"maxlength\"\n :edit=\"tagsEditStatus[index]\"\n :perform-save-edit=\"performSaveTag\"\n :perform-delete=\"performDeleteTag\"\n :perform-cancel-edit=\"cancelEdit\"\n :validate-tag=\"createChangedTag\"\n :perform-open-edit=\"performEditTag\"\n :deletion-mark=\"isMarked(index)\"\n />\n </div>\n <div\n v-if=\"$slots['tag-right']\"\n class=\"ti-tag-right\"\n >\n <slot\n name=\"tag-right\"\n :tag=\"tag\"\n :index=\"index\"\n :edit=\"tagsEditStatus[index]\"\n :perform-save-edit=\"performSaveTag\"\n :perform-delete=\"performDeleteTag\"\n :perform-cancel-edit=\"cancelEdit\"\n :perform-open-edit=\"performEditTag\"\n :deletion-mark=\"isMarked(index)\"\n />\n </div>\n </div>\n <div class=\"ti-actions\">\n <i\n v-if=\"!$slots['tag-actions']\"\n v-show=\"tagsEditStatus[index]\"\n class=\"ti-icon-undo\"\n @click.stop=\"cancelEdit(index)\"\n />\n <i\n v-if=\"!$slots['tag-actions']\"\n v-show=\"!tagsEditStatus[index]\"\n class=\"ti-icon-close\"\n @click.stop=\"performDeleteTag(index)\"\n />\n <slot\n v-if=\"$slots['tag-actions']\"\n name=\"tag-actions\"\n :tag=\"tag\"\n :index=\"index\"\n :edit=\"tagsEditStatus[index]\"\n :perform-save-edit=\"performSaveTag\"\n :perform-delete=\"performDeleteTag\"\n :perform-cancel-edit=\"cancelEdit\"\n :perform-open-edit=\"performEditTag\"\n :deletion-mark=\"isMarked(index)\"\n />\n </div>\n </li>\n <li class=\"ti-new-tag-input-wrapper\">\n <input\n ref=\"newTagInputRef\"\n :class=\"[createClasses(newTag, tags, validation, isDuplicate)]\"\n :placeholder=\"placeholder\"\n :value=\"newTag\"\n :maxlength=\"maxlength\"\n :disabled=\"disabled\"\n type=\"text\"\n size=\"1\"\n class=\"ti-new-tag-input\"\n @keydown=\"handleKeyDown\"\n @paste=\"addTagsFromPaste\"\n @keydown.delete=\"invokeDelete\"\n @keydown.tab=\"performBlur\"\n @keydown.up.prevent=\"selectItem('before')\"\n @keydown.down.prevent=\"selectItem('after')\"\n @input=\"updateNewTag\"\n @focus=\"focused = true\"\n @click=\"!addOnlyFromAutocomplete && (selectedItem = null)\"\n >\n </li>\n </ul>\n </div>\n <slot name=\"between-elements\" />\n <div\n v-if=\"autocompleteOpen\"\n class=\"ti-autocomplete\"\n :class=\"$attrs.class\"\n @mouseleave=\"selectedItem = null\"\n >\n <slot name=\"autocomplete-header\" />\n <ul>\n <li\n v-for=\"(item, index) in filteredAutocompleteItems\"\n :key=\"`autocomplete-${index}-${item.text}`\"\n :style=\"item.style\"\n :class=\"[\n item.tiClasses,\n item.classes,\n { 'ti-selected-item': isSelected(index) }\n ]\"\n class=\"ti-item\"\n @mouseenter=\"!disabled && (selectedItem = index)\"\n >\n <div\n v-if=\"!$slots['autocomplete-item']\"\n @click=\"performAddTags(item, undefined, 'autocomplete')\"\n >\n {{ item.text }}\n </div>\n <slot\n v-else\n name=\"autocomplete-item\"\n :item=\"item\"\n :index=\"index\"\n :perform-add=\"item => performAddTags(item, undefined, 'autocomplete')\"\n :selected=\"isSelected(index)\"\n />\n </li>\n </ul>\n <slot name=\"autocomplete-footer\" />\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, computed, watch, nextTick, onMounted, onBeforeUnmount, shallowRef, toRef } from 'vue';\nimport equal from 'fast-deep-equal';\nimport { clone, createClasses, createTag, createTags } from './create-tags.js';\nimport TagInput from './tag-input.vue';\nimport props from './vue-tags-input.props.js';\n\n// Props\nconst propsObj = defineProps(props);\n\n// Emits\nconst emit = defineEmits([\n 'adding-duplicate',\n 'before-adding-tag',\n 'before-deleting-tag',\n 'before-editing-tag',\n 'before-saving-tag',\n 'max-tags-reached',\n 'saving-duplicate',\n 'tags-changed',\n 'tag-clicked',\n 'update:modelValue',\n 'update:tags',\n]);\n\n// State\nconst tagCenterRefs = ref(new Map());\nconst newTag = ref(propsObj.modelValue || '');\nconst tagsCopy = shallowRef([]);\nconst tagsEditStatus = ref([]);\nconst deletionMark = ref(null);\nconst deletionMarkTimer = ref(null);\nconst selectedItem = ref(null);\nconst focused = ref(false);\nconst newTagInputRef = ref(null);\n\n// Computed\nconst autocompleteOpen = computed(() => {\n if (propsObj.autocompleteAlwaysOpen) return true;\n return newTag.value !== null && \n newTag.value.length >= propsObj.autocompleteMinLength && \n filteredAutocompleteItems.value.length > 0 && \n focused.value;\n});\n\nconst filteredAutocompleteItems = computed(() => {\n const items = propsObj.autocompleteItems.map(i => \n createTag(i, propsObj.tags, propsObj.validation, propsObj.isDuplicate)\n );\n\n if (!propsObj.autocompleteFilterDuplicates) return items;\n return items.filter(duplicateFilter);\n});\n\n// Methods\nconst getSelectedIndex = (method) => {\n const items = filteredAutocompleteItems.value;\n const current = selectedItem.value;\n const lastItem = items.length - 1;\n \n if (items.length === 0) return;\n if (current === null) return 0;\n if (method === 'before' && current === 0) return lastItem;\n if (method === 'after' && current === lastItem) return 0;\n return method === 'after' ? current + 1 : current - 1;\n};\n\nconst selectDefaultItem = () => {\n selectedItem.value = propsObj.addOnlyFromAutocomplete && filteredAutocompleteItems.value.length > 0 ? 0 : null;\n};\n\nconst selectItem = (method) => {\n selectedItem.value = getSelectedIndex(method);\n};\n\nconst isSelected = (index) => selectedItem.value === index;\nconst isMarked = (index) => deletionMark.value === index;\n\nconst setTagCenter = (el, index) => {\n if (el) {\n tagCenterRefs.value.set(index, el);\n } else {\n tagCenterRefs.value.delete(index);\n }\n};\n\nconst invokeDelete = () => {\n if (!propsObj.deleteOnBackspace || newTag.value.length > 0) return;\n \n const lastIndex = tagsCopy.value.length - 1;\n if (deletionMark.value === null) {\n clearTimeout(deletionMarkTimer.value);\n deletionMarkTimer.value = setTimeout(() => (deletionMark.value = null), 1000);\n deletionMark.value = lastIndex;\n } else {\n performDeleteTag(lastIndex);\n }\n};\n\nconst addTagsFromPaste = () => {\n if (!propsObj.addFromPaste) return;\n setTimeout(() => performAddTags(newTag.value), 10);\n};\n\nconst performEditTag = (index) => {\n if (!propsObj.allowEditTags) return;\n \n if (!propsObj.onBeforeEditingTag) {\n editTag(index);\n } else {\n emit('before-editing-tag', {\n index,\n tag: tagsCopy.value[index],\n editTag: () => editTag(index),\n });\n }\n};\n\nconst editTag = (index) => {\n if (!propsObj.allowEditTags) return;\n toggleEditMode(index);\n focus(index);\n};\n\nconst toggleEditMode = (index) => {\n if (!propsObj.allowEditTags || propsObj.disabled) return;\n tagsEditStatus.value[index] = !tagsEditStatus.value[index];\n};\n\nconst createChangedTag = (index, event) => {\n const tag = tagsCopy.value[index];\n tag.text = event ? event.target.value : tagsCopy.value[index].text;\n \n const newTags = [...tagsCopy.value];\n newTags[index] = createTag(tag, tagsCopy.value, propsObj.validation, propsObj.isDuplicate);\n tagsCopy.value = newTags;\n};\n\nconst focus = (index) => {\n nextTick(() => {\n const el = tagCenterRefs.value.get(index)?.querySelector('input.ti-tag-input');\n if (el) el.focus();\n });\n};\n\nconst quote = (regex) => regex.replace(/([()[{*+.$^\\\\|?])/g, '\\\\$1');\n\nconst cancelEdit = (index) => {\n if (!propsObj.tags[index]) return;\n \n const newTags = [...tagsCopy.value];\n newTags[index] = clone(createTag(propsObj.tags[index], propsObj.tags, propsObj.validation, propsObj.isDuplicate));\n tagsCopy.value = newTags;\n tagsEditStatus.value[index] = false;\n};\n\nconst hasForbiddingAddRule = (tiClasses) => {\n return tiClasses.some(type => {\n const rule = propsObj.validation.find(rule => type === rule.classes);\n return rule ? rule.disableAdd : false;\n });\n};\n\nconst createTagTexts = (string) => {\n const regex = new RegExp(propsObj.separators.map(s => quote(s)).join('|'));\n return string.split(regex).map(text => ({ text }));\n};\n\nconst performDeleteTag = (index) => {\n if (!propsObj.onBeforeDeletingTag) {\n deleteTag(index);\n } else {\n emit('before-deleting-tag', {\n index,\n tag: tagsCopy.value[index],\n deleteTag: () => deleteTag(index),\n });\n }\n};\n\nconst deleteTag = (index) => {\n if (propsObj.disabled) return;\n \n deletionMark.value = null;\n clearTimeout(deletionMarkTimer.value);\n \n const newTags = [...tagsCopy.value];\n newTags.splice(index, 1);\n tagsCopy.value = newTags;\n \n tagsEditStatus.value.splice(index, 1);\n \n emit('update:tags', tagsCopy.value);\n emit('tags-changed', tagsCopy.value);\n};\n\nconst noTriggerKey = (event, category) => {\n const triggerKey = propsObj[category].indexOf(event.keyCode) !== -1 || \n propsObj[category].indexOf(event.key) !== -1;\n if (triggerKey) event.preventDefault();\n return !triggerKey;\n};\n\nconst performAddTags = (tag, event, source) => {\n if (propsObj.disabled || (event && noTriggerKey(event, 'addOnKey'))) return;\n\n let tags = [];\n if (typeof tag === 'object') tags = [tag];\n if (typeof tag === 'string') tags = createTagTexts(tag);\n\n tags = tags.filter(tag => tag.text.trim().length > 0);\n\n tags.forEach(tag => {\n tag = createTag(tag, propsObj.tags, propsObj.validation, propsObj.isDuplicate);\n if (!propsObj.onBeforeAddingTag) {\n addTag(tag, source);\n } else {\n emit('before-adding-tag', {\n tag,\n addTag: () => addTag(tag, source),\n });\n }\n });\n};\n\nconst duplicateFilter = (tag) => {\n return propsObj.isDuplicate ? \n !propsObj.isDuplicate(tagsCopy.value, tag) : \n !tagsCopy.value.find(t => t.text === tag.text);\n};\n\nconst addTag = (tag, source = 'new-tag-input') => {\n const options = filteredAutocompleteItems.value.map(i => i.text);\n if (propsObj.addOnlyFromAutocomplete && options.indexOf(tag.text) === -1) return;\n\n nextTick(() => {\n const maximumReached = propsObj.maxTags && propsObj.maxTags <= tagsCopy.value.length;\n if (maximumReached) return emit('max-tags-reached', tag);\n\n const dup = propsObj.avoidAddingDuplicates && !duplicateFilter(tag);\n if (dup) return emit('adding-duplicate', tag);\n\n if (hasForbiddingAddRule(tag.tiClasses)) return;\n\n newTag.value = '';\n tagsCopy.value = [...tagsCopy.value, tag];\n tagsEditStatus.value.push(false);\n\n emit('update:tags', tagsCopy.value);\n\n if (source === 'autocomplete') newTagInputRef.value?.focus();\n\n emit('tags-changed', tagsCopy.value);\n });\n};\n\nconst performSaveTag = (index, event) => {\n const tag = tagsCopy.value[index];\n\n if (propsObj.disabled || (event && noTriggerKey(event, 'addOnKey'))) return;\n if (tag.text.trim().length === 0) return;\n\n if (!propsObj['onBeforeSavingTag']) {\n saveTag(index, tag);\n } else {\n emit('before-saving-tag', {\n index,\n tag,\n saveTag: () => saveTag(index, tag),\n });\n }\n};\n\nconst saveTag = (index, tag) => {\n if (propsObj.avoidAddingDuplicates) {\n const tagsDiff = clone(tagsCopy.value);\n const inputTag = tagsDiff.splice(index, 1)[0];\n const dup = propsObj.isDuplicate ? \n propsObj.isDuplicate(tagsDiff, inputTag) : \n tagsDiff.map(t => t.text).indexOf(inputTag.text) !== -1;\n\n if (dup) return emit('saving-duplicate', tag);\n }\n\n if (hasForbiddingAddRule(tag.tiClasses)) return;\n\n const newTags = [...tagsCopy.value];\n newTags[index] = tag;\n tagsCopy.value = newTags;\n toggleEditMode(index);\n\n emit('update:tags', tagsCopy.value);\n emit('tags-changed', tagsCopy.value);\n};\n\nconst tagsEqual = () => {\n return !tagsCopy.value.some((t, i) => !equal(t, propsObj.tags[i]));\n};\n\nconst updateNewTag = (event) => {\n const value = event.target.value;\n newTag.value = value;\n emit('update:modelValue', value);\n};\n\nconst initTags = () => {\n tagsCopy.value = createTags(propsObj.tags, propsObj.validation, propsObj.isDuplicate);\n tagsEditStatus.value = new Array(propsObj.tags.length).fill(false);\n\n if (!tagsEqual()) {\n emit('update:tags', tagsCopy.value);\n }\n};\n\nconst blurredOnClick = (e) => {\n const el = e.currentTarget;\n if (el?.contains(e.target) || el?.contains(document.activeElement)) return;\n performBlur();\n};\n\nconst performBlur = () => {\n if (propsObj.addOnBlur && focused.value) performAddTags(newTag.value);\n focused.value = false;\n};\n\nconst handleKeyDown = (event) => {\n const item = filteredAutocompleteItems.value[selectedItem.value] || newTag.value;\n performAddTags(item, event);\n};\n\n// Watchers\nwatch(() => propsObj.modelValue, (newValue) => {\n if (!propsObj.addOnlyFromAutocomplete) selectedItem.value = null;\n newTag.value = newValue;\n});\n\nwatch(() => propsObj.tags, () => {\n initTags();\n}, { deep: true });\n\nwatch(autocompleteOpen, selectDefaultItem);\n\n// Lifecycle\ninitTags();\n\nonMounted(() => {\n selectDefaultItem();\n document.addEventListener('click', blurredOnClick);\n});\n\nonBeforeUnmount(() => {\n document.removeEventListener('click', blurredOnClick);\n clearTimeout(deletionMarkTimer.value);\n});\n\n// Expose for template\ndefineExpose({\n createClasses\n});\n</script>\n\n<style lang=\"scss\" src=\"./vue-tags-input.scss\"></style>"],"names":["rule","tag"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6LA,UAAM,WAAW;AAGjB,UAAM,OAAO;AAeb,UAAM,gBAAgB,IAAI,oBAAI,KAAK;AACnC,UAAM,SAAS,IAAI,SAAS,cAAc,EAAE;AAC5C,UAAM,WAAW,WAAW,EAAE;AAC9B,UAAM,iBAAiB,IAAI,EAAE;AAC7B,UAAM,eAAe,IAAI,IAAI;AAC7B,UAAM,oBAAoB,IAAI,IAAI;AAClC,UAAM,eAAe,IAAI,IAAI;AAC7B,UAAM,UAAU,IAAI,KAAK;AACzB,UAAM,iBAAiB,IAAI,IAAI;AAG/B,UAAM,mBAAmB,SAAS,MAAM;AACtC,UAAI,SAAS,uBAAwB,QAAO;AAC5C,aAAO,OAAO,UAAU,QACjB,OAAO,MAAM,UAAU,SAAS,yBAChC,0BAA0B,MAAM,SAAS,KACzC,QAAQ;AAAA,IACjB,CAAC;AAED,UAAM,4BAA4B,SAAS,MAAM;AAC/C,YAAM,QAAQ,SAAS,kBAAkB;AAAA,QAAI,OAC3C,UAAU,GAAG,SAAS,MAAM,SAAS,YAAY,SAAS,WAAW;AAAA,MACzE;AAEE,UAAI,CAAC,SAAS,6BAA8B,QAAO;AACnD,aAAO,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AAoB,SAAS,cAAc;AACpD,mBAAa,kBAAkB,KAAK;AAAA,IACtC,CAAC;AAGD,aAAa;AAAA,MACX;AAAA,IACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const validateUserRules = (tag, validation) => {
4
- return validation.filter((val) => {
5
- const { text } = tag;
6
- if (typeof val.rule === "string") return !new RegExp(val.rule).test(text);
7
- if (val.rule instanceof RegExp) return !val.rule.test(text);
8
- const isFunction = {}.toString.call(val.rule) === "[object Function]";
9
- if (isFunction) return val.rule(tag);
10
- }).map((val) => val.classes);
11
- };
12
- const clone = (node) => JSON.parse(JSON.stringify(node));
13
- const findIndex = (arr, callback) => {
14
- let index = 0;
15
- while (index < arr.length) {
16
- if (callback(arr[index], index, arr)) return index;
17
- index++;
18
- }
19
- return -1;
20
- };
21
- const createClasses = (tag, tags, validation = [], customDuplicateFn) => {
22
- if (tag.text === void 0) tag = { text: tag };
23
- if (!Array.isArray(tags)) tags = [];
24
- const classes = validateUserRules(tag, validation);
25
- const index = findIndex(tags, (t) => t === tag);
26
- const tagsDiff = clone(tags);
27
- const inputTag = index !== -1 ? tagsDiff.splice(index, 1)[0] : clone(tag);
28
- const duplicate = customDuplicateFn ? customDuplicateFn(tagsDiff, inputTag) : Array.isArray(tagsDiff) ? tagsDiff.map((t) => t.text).indexOf(inputTag.text) !== -1 : false;
29
- if (duplicate) classes.push("ti-duplicate");
30
- classes.length === 0 ? classes.push("ti-valid") : classes.push("ti-invalid");
31
- return classes;
32
- };
33
- const createTag = (tag, ...rest) => {
34
- if (tag.text === void 0) tag = { text: tag };
35
- const t = clone(tag);
36
- if (rest[0] && !Array.isArray(rest[0])) {
37
- rest[0] = [];
38
- }
39
- t.tiClasses = createClasses(tag, ...rest);
40
- return t;
41
- };
42
- const createTags = (tags, ...rest) => {
43
- if (!Array.isArray(tags)) {
44
- return [];
45
- }
46
- return tags.map((t) => createTag(t, tags, ...rest));
47
- };
48
- exports.clone = clone;
49
- exports.createClasses = createClasses;
50
- exports.createTag = createTag;
51
- exports.createTags = createTags;
52
- //# sourceMappingURL=create-tags.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-tags.cjs","sources":["../../../../../src/components/FieldTags/create-tags.js"],"sourcesContent":["// helper functions\n\nconst validateUserRules = (tag, validation) => {\n return validation\n .filter(val => {\n const { text } = tag;\n // if the rule is a string, we convert it to RegExp\n if (typeof val.rule === 'string') return !new RegExp(val.rule).test(text);\n\n if (val.rule instanceof RegExp) return !val.rule.test(text);\n\n // if we deal with a function, invoke it\n const isFunction = {}.toString.call(val.rule) === '[object Function]';\n if (isFunction) return val.rule(tag);\n })\n .map(val => val.classes);\n};\n\nconst clone = node => JSON.parse(JSON.stringify(node));\n\nconst findIndex = (arr, callback) => {\n let index = 0;\n while (index < arr.length) {\n if (callback(arr[index], index, arr)) return index;\n index++;\n }\n return -1;\n};\n\nconst createClasses = (tag, tags, validation = [], customDuplicateFn) => {\n if (tag.text === undefined) tag = { text: tag };\n \n // Ensure tags is an array\n if (!Array.isArray(tags)) tags = [];\n\n // create css classes from the user validation array\n const classes = validateUserRules(tag, validation);\n\n // if we find the tag, it's an exsting one which is edited.\n // in this case we must splice it out\n const index = findIndex(tags, t => t === tag);\n const tagsDiff = clone(tags);\n const inputTag = index !== -1 ? tagsDiff.splice(index, 1)[0] : clone(tag);\n\n // check whether the tag is a duplicate or not\n const duplicate = customDuplicateFn ? customDuplicateFn(tagsDiff, inputTag) : (Array.isArray(tagsDiff) ? tagsDiff.map(t => t.text).indexOf(inputTag.text) !== -1 : false);\n\n // if it's a duplicate, push the class duplicate to the array\n if (duplicate) classes.push('ti-duplicate');\n\n // if we find no classes, the tag is valid → push the class valid\n classes.length === 0 ? classes.push('ti-valid') : classes.push('ti-invalid');\n return classes;\n};\n\n/**\n * @description Create one tag out of a String or validate an existing one\n * @property {helpers}\n * @param {Object|String} tag A tag which should be validated | A String to create a tag\n * @param {Array} tagsarray The tags array\n * @param {Array} [validation=[]] The validation Array is optional (pass it if you use one)\n * @returns {Object} The created (validated) tag\n */\nconst createTag = (tag, ...rest) => {\n // if text is undefined, a string is passed. let's make a tag out of it\n if (tag.text === undefined) tag = { text: tag };\n\n // we better make a clone to not getting reference trouble\n const t = clone(tag);\n \n // Ensure the first argument in rest (tags array) is actually an array\n if (rest[0] && !Array.isArray(rest[0])) {\n rest[0] = [];\n }\n\n // create the validation classes\n t.tiClasses = createClasses(tag, ...rest);\n return t;\n};\n\n/**\n * @description Create multiple tags out of Strings or validate existing tags\n * @property {helpers}\n * @param {Array} tagsarray An Array containing tags or strings. See example below.\n * @param {Array} [validation=[]] The validation Array is optional (pass it if you use one)\n * @returns {Array} An array containing (validated) tags\n * @example &#47;* Example to call the function *&#47;\n const validatedTags = createTags(['tag1Text', 'tag2Text'], [{ type: 'length', rule: /[0-9]/ }])\n */\nconst createTags = (tags, ...rest) => {\n if (!Array.isArray(tags)) {\n return [];\n }\n return tags.map(t => createTag(t, tags, ...rest));\n};\n\nexport { clone, createClasses, createTag, createTags };\n"],"names":[],"mappings":";;AAEA,MAAM,oBAAoB,CAAC,KAAK,eAAe;AAC7C,SAAO,WACJ,OAAO,SAAO;AACb,UAAM,EAAE,KAAI,IAAK;AAEjB,QAAI,OAAO,IAAI,SAAS,SAAU,QAAO,CAAC,IAAI,OAAO,IAAI,IAAI,EAAE,KAAK,IAAI;AAExE,QAAI,IAAI,gBAAgB,OAAQ,QAAO,CAAC,IAAI,KAAK,KAAK,IAAI;AAG1D,UAAM,aAAa,CAAA,EAAG,SAAS,KAAK,IAAI,IAAI,MAAM;AAClD,QAAI,W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IAAE,YAAY,cAAc,KAAK,GAAG,IAAI;AACxC,SAAO;AACT;AAWK,MAAC,aAAa,CAAC,SAAS,SAAS;AACpC,MAAI,CAAC,MAAM,QAAQ,IAAI,GAAG;AACxB,WAAO,CAAA;AAAA,EACT;AACA,SAAO,KAAK,IAAI,OAAK,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;AAClD;;;;;"}
@@ -1,52 +0,0 @@
1
- const validateUserRules = (tag, validation) => {
2
- return validation.filter((val) => {
3
- const { text } = tag;
4
- if (typeof val.rule === "string") return !new RegExp(val.rule).test(text);
5
- if (val.rule instanceof RegExp) return !val.rule.test(text);
6
- const isFunction = {}.toString.call(val.rule) === "[object Function]";
7
- if (isFunction) return val.rule(tag);
8
- }).map((val) => val.classes);
9
- };
10
- const clone = (node) => JSON.parse(JSON.stringify(node));
11
- const findIndex = (arr, callback) => {
12
- let index = 0;
13
- while (index < arr.length) {
14
- if (callback(arr[index], index, arr)) return index;
15
- index++;
16
- }
17
- return -1;
18
- };
19
- const createClasses = (tag, tags, validation = [], customDuplicateFn) => {
20
- if (tag.text === void 0) tag = { text: tag };
21
- if (!Array.isArray(tags)) tags = [];
22
- const classes = validateUserRules(tag, validation);
23
- const index = findIndex(tags, (t) => t === tag);
24
- const tagsDiff = clone(tags);
25
- const inputTag = index !== -1 ? tagsDiff.splice(index, 1)[0] : clone(tag);
26
- const duplicate = customDuplicateFn ? customDuplicateFn(tagsDiff, inputTag) : Array.isArray(tagsDiff) ? tagsDiff.map((t) => t.text).indexOf(inputTag.text) !== -1 : false;
27
- if (duplicate) classes.push("ti-duplicate");
28
- classes.length === 0 ? classes.push("ti-valid") : classes.push("ti-invalid");
29
- return classes;
30
- };
31
- const createTag = (tag, ...rest) => {
32
- if (tag.text === void 0) tag = { text: tag };
33
- const t = clone(tag);
34
- if (rest[0] && !Array.isArray(rest[0])) {
35
- rest[0] = [];
36
- }
37
- t.tiClasses = createClasses(tag, ...rest);
38
- return t;
39
- };
40
- const createTags = (tags, ...rest) => {
41
- if (!Array.isArray(tags)) {
42
- return [];
43
- }
44
- return tags.map((t) => createTag(t, tags, ...rest));
45
- };
46
- export {
47
- clone,
48
- createClasses,
49
- createTag,
50
- createTags
51
- };
52
- //# sourceMappingURL=create-tags.js.map