@ozdao/martyrs 0.2.540 → 0.2.542
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.
- package/dist/_virtual/index.cjs +4 -4
- package/dist/_virtual/index.js +4 -4
- package/dist/_virtual/index2.cjs +3 -6
- package/dist/_virtual/index2.cjs.map +1 -1
- package/dist/_virtual/index2.js +2 -5
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/{globals.verifier-CJ1lr-NW.cjs → globals.verifier-Bi-XLEi9.cjs} +24 -23
- package/dist/{globals.verifier-BhqUrneb.js → globals.verifier-gPPX_jhf.js} +24 -23
- package/dist/inventory.server.cjs +1 -1
- package/dist/inventory.server.js +1 -1
- package/dist/{main-gOfhekZG.js → main-ByKkD9qa.js} +2857 -3276
- package/dist/main-Czyu-VcC.cjs +11 -0
- package/dist/martyrs/src/components/Button/{Button.vue2.cjs → Button.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Button/{Button.vue2.js.map → Button.vue.cjs.map} +1 -1
- package/dist/martyrs/src/components/Button/{Button.vue2.js → Button.vue.js} +2 -2
- package/dist/martyrs/src/components/Button/Button.vue.js.map +1 -0
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/martyrs/src/components/FieldTags/BlockTags.vue.cjs +30 -21
- package/dist/martyrs/src/components/FieldTags/BlockTags.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/FieldTags/BlockTags.vue.js +32 -23
- package/dist/martyrs/src/components/FieldTags/BlockTags.vue.js.map +1 -1
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue2.cjs +235 -0
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue2.js +235 -0
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Marquee/Marquee.vue.cjs +17 -8
- package/dist/martyrs/src/components/Marquee/Marquee.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/Marquee/Marquee.vue.js +17 -8
- package/dist/martyrs/src/components/Marquee/Marquee.vue.js.map +1 -1
- package/dist/martyrs/src/components/UploadImage/UploadImage.vue.cjs +161 -42
- package/dist/martyrs/src/components/UploadImage/UploadImage.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js +162 -43
- package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +4 -4
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.cjs +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -4
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -4
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js.map +1 -1
- package/dist/martyrs/src/modules/constructor/components/elements/Card.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +21 -21
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupAuth.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupAuth.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/store/globals.cjs +2 -2
- package/dist/martyrs/src/modules/globals/views/store/globals.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/store/globals.js +2 -2
- package/dist/martyrs/src/modules/globals/views/store/globals.js.map +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.cjs +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.cjs +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +11 -11
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +12 -12
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +16 -16
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +16 -16
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +3 -4
- package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +3 -4
- package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +20 -20
- package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.cjs +3 -4
- package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +3 -4
- package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +4 -5
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +4 -5
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs +2 -3
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +2 -3
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +6 -6
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardProduct.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/elements/{THC.vue2.cjs → THC.vue.cjs} +2 -2
- package/dist/martyrs/src/modules/products/components/elements/THC.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/products/components/elements/{THC.vue2.js → THC.vue.js} +2 -2
- package/dist/martyrs/src/modules/products/components/elements/THC.vue.js.map +1 -0
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +63 -39
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +69 -45
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.cjs +2 -2
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +2 -2
- package/dist/martyrs/src/modules/products/store/categories.cjs +4 -0
- package/dist/martyrs/src/modules/products/store/categories.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/store/categories.js +4 -0
- package/dist/martyrs/src/modules/products/store/categories.js.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.cjs +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +11 -11
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
- package/dist/martyrs.cjs.js +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/music.server.cjs +1 -1
- package/dist/music.server.js +1 -1
- package/dist/node_modules/.pnpm/lodash.merge@4.6.2/node_modules/lodash.merge/index.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash.merge@4.6.2/node_modules/lodash.merge/index.js +1 -1
- package/dist/orders.server.cjs +1 -1
- package/dist/orders.server.js +1 -1
- package/dist/organizations.server.cjs +1 -1
- package/dist/organizations.server.js +1 -1
- package/dist/products.server.cjs +10 -2
- package/dist/products.server.js +10 -2
- package/dist/rents.server.cjs +1 -1
- package/dist/rents.server.js +1 -1
- package/dist/style.css +129 -129
- package/dist/{web-DxxU2bwy.js → web-BklgIiYr.js} +1 -1
- package/dist/{web-bMa0DMyG.cjs → web-CQBm7C6L.cjs} +1 -1
- package/package.json +1 -1
- package/src/components/FieldTags/BlockTags.vue +28 -16
- package/src/components/FieldTags/FieldTags.vue +327 -508
- package/src/components/Marquee/Marquee.vue +25 -14
- package/src/components/UploadImage/UploadImage.vue +192 -18
- package/src/modules/community/components/pages/CreateBlogPost.vue +0 -1
- package/src/modules/globals/controllers/classes/globals.validator.js +24 -23
- package/src/modules/globals/views/store/globals.js +2 -2
- package/src/modules/products/components/pages/CategoryEdit.vue +73 -39
- package/src/modules/products/middlewares/categories.verifier.js +9 -1
- package/src/modules/products/store/categories.js +5 -0
- package/dist/_virtual/index3.cjs +0 -5
- package/dist/_virtual/index3.cjs.map +0 -1
- package/dist/_virtual/index3.js +0 -5
- package/dist/_virtual/index3.js.map +0 -1
- package/dist/main-Zhs0EqRp.cjs +0 -11
- package/dist/martyrs/src/components/Button/Button.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue.cjs +0 -480
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue.cjs.map +0 -1
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue.js +0 -480
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue.js.map +0 -1
- package/dist/martyrs/src/components/FieldTags/create-tags.cjs +0 -43
- package/dist/martyrs/src/components/FieldTags/create-tags.cjs.map +0 -1
- package/dist/martyrs/src/components/FieldTags/create-tags.js +0 -43
- package/dist/martyrs/src/components/FieldTags/create-tags.js.map +0 -1
- package/dist/martyrs/src/components/FieldTags/tag-input.vue2.cjs +0 -32
- package/dist/martyrs/src/components/FieldTags/tag-input.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/FieldTags/tag-input.vue2.js +0 -32
- package/dist/martyrs/src/components/FieldTags/tag-input.vue2.js.map +0 -1
- package/dist/martyrs/src/components/FieldTags/vue-tags-input.props.cjs +0 -329
- package/dist/martyrs/src/components/FieldTags/vue-tags-input.props.cjs.map +0 -1
- package/dist/martyrs/src/components/FieldTags/vue-tags-input.props.js +0 -329
- package/dist/martyrs/src/components/FieldTags/vue-tags-input.props.js.map +0 -1
- package/dist/martyrs/src/modules/products/components/elements/THC.vue2.cjs.map +0 -1
- package/dist/martyrs/src/modules/products/components/elements/THC.vue2.js.map +0 -1
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.cjs +0 -39
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.cjs.map +0 -1
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +0 -39
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js.map +0 -1
- package/src/components/FieldTags/create-tags.js +0 -84
- package/src/components/FieldTags/tag-input.vue +0 -55
- package/src/components/FieldTags/vue-tags-input.props.js +0 -342
- package/src/components/FieldTags/vue-tags-input.scss +0 -149
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { ref, computed, watch, createElementBlock, openBlock, createElementVNode, createCommentVNode, withDirectives, Fragment, renderList, createTextVNode, toDisplayString, vModelText, normalizeClass } from "vue";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const _hoisted_1 = { class: "field-tags-new" };
|
|
5
|
+
const _hoisted_2 = { class: "tags-container" };
|
|
6
|
+
const _hoisted_3 = ["onClick"];
|
|
7
|
+
const _hoisted_4 = ["placeholder", "maxlength", "disabled"];
|
|
8
|
+
const _hoisted_5 = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "autocomplete"
|
|
11
|
+
};
|
|
12
|
+
const _hoisted_6 = ["onClick", "onMouseenter"];
|
|
13
|
+
const _sfc_main = {
|
|
14
|
+
__name: "FieldTags",
|
|
15
|
+
props: {
|
|
16
|
+
modelValue: Array,
|
|
17
|
+
textField: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "text"
|
|
20
|
+
},
|
|
21
|
+
autocompleteItems: Array,
|
|
22
|
+
separators: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => [",", ";"]
|
|
25
|
+
},
|
|
26
|
+
addOnKey: {
|
|
27
|
+
type: Array,
|
|
28
|
+
default: () => [13]
|
|
29
|
+
// Enter key
|
|
30
|
+
},
|
|
31
|
+
maxTags: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: 20
|
|
34
|
+
},
|
|
35
|
+
maxlength: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 50
|
|
38
|
+
},
|
|
39
|
+
placeholder: String,
|
|
40
|
+
disabled: Boolean,
|
|
41
|
+
addOnBlur: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: true
|
|
44
|
+
},
|
|
45
|
+
autocompleteMinLength: {
|
|
46
|
+
type: Number,
|
|
47
|
+
default: 1
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
emits: ["update:modelValue", "tags-changed"],
|
|
51
|
+
setup(__props, { emit: __emit }) {
|
|
52
|
+
const props = __props;
|
|
53
|
+
const emit = __emit;
|
|
54
|
+
const newTag = ref("");
|
|
55
|
+
const focused = ref(false);
|
|
56
|
+
const selectedIndex = ref(-1);
|
|
57
|
+
const inputRef = ref(null);
|
|
58
|
+
const tags = computed({
|
|
59
|
+
get: () => props.modelValue || [],
|
|
60
|
+
set: (value) => {
|
|
61
|
+
emit("update:modelValue", value);
|
|
62
|
+
emit("tags-changed", value);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const showAutocomplete = computed(() => {
|
|
66
|
+
return focused.value && props.autocompleteItems?.length > 0 && newTag.value.length >= props.autocompleteMinLength;
|
|
67
|
+
});
|
|
68
|
+
const filteredAutocomplete = computed(() => {
|
|
69
|
+
if (!props.autocompleteItems) return [];
|
|
70
|
+
const searchText = newTag.value.toLowerCase();
|
|
71
|
+
return props.autocompleteItems.filter((item) => {
|
|
72
|
+
const itemText = getTagText(item).toLowerCase();
|
|
73
|
+
if (!itemText.includes(searchText)) return false;
|
|
74
|
+
return !isDuplicate(itemText);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
function getTagText(tag) {
|
|
78
|
+
if (tag === null || tag === void 0) return "";
|
|
79
|
+
if (typeof tag === "string") return tag;
|
|
80
|
+
return tag[props.textField] || "";
|
|
81
|
+
}
|
|
82
|
+
function createTag(text) {
|
|
83
|
+
if (tags.value.length > 0) {
|
|
84
|
+
if (typeof tags.value[0] === "string") {
|
|
85
|
+
return text;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return { [props.textField]: text };
|
|
89
|
+
}
|
|
90
|
+
function isDuplicate(text) {
|
|
91
|
+
const searchText = text.toLowerCase().trim();
|
|
92
|
+
return tags.value.some(
|
|
93
|
+
(tag) => getTagText(tag).toLowerCase().trim() === searchText
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
function addTag(input) {
|
|
97
|
+
let text = "";
|
|
98
|
+
if (typeof input === "string") {
|
|
99
|
+
text = input.trim();
|
|
100
|
+
} else if (typeof input === "object") {
|
|
101
|
+
if (props.autocompleteItems?.includes(input)) {
|
|
102
|
+
if (!isDuplicate(getTagText(input))) {
|
|
103
|
+
tags.value = [...tags.value, input];
|
|
104
|
+
}
|
|
105
|
+
newTag.value = "";
|
|
106
|
+
selectedIndex.value = -1;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
text = getTagText(input).trim();
|
|
110
|
+
}
|
|
111
|
+
if (!text || tags.value.length >= props.maxTags) return;
|
|
112
|
+
if (isDuplicate(text)) return;
|
|
113
|
+
const tag = createTag(text);
|
|
114
|
+
tags.value = [...tags.value, tag];
|
|
115
|
+
newTag.value = "";
|
|
116
|
+
selectedIndex.value = -1;
|
|
117
|
+
}
|
|
118
|
+
function removeTag(index) {
|
|
119
|
+
if (props.disabled) return;
|
|
120
|
+
const newTags = [...tags.value];
|
|
121
|
+
newTags.splice(index, 1);
|
|
122
|
+
tags.value = newTags;
|
|
123
|
+
}
|
|
124
|
+
function handleKeyDown(event) {
|
|
125
|
+
if (showAutocomplete.value) {
|
|
126
|
+
if (event.key === "ArrowDown") {
|
|
127
|
+
event.preventDefault();
|
|
128
|
+
selectedIndex.value = Math.min(
|
|
129
|
+
selectedIndex.value + 1,
|
|
130
|
+
filteredAutocomplete.value.length - 1
|
|
131
|
+
);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (event.key === "ArrowUp") {
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
selectedIndex.value = Math.max(selectedIndex.value - 1, -1);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (event.key === "Enter" && selectedIndex.value >= 0) {
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
addTag(filteredAutocomplete.value[selectedIndex.value]);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const shouldAdd = props.addOnKey.some((key) => {
|
|
146
|
+
if (typeof key === "number") {
|
|
147
|
+
return event.keyCode === key;
|
|
148
|
+
}
|
|
149
|
+
return event.key === key;
|
|
150
|
+
});
|
|
151
|
+
if (shouldAdd) {
|
|
152
|
+
event.preventDefault();
|
|
153
|
+
addTag(newTag.value);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (event.key === "Backspace" && newTag.value === "" && tags.value.length > 0) {
|
|
157
|
+
removeTag(tags.value.length - 1);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function handlePaste(event) {
|
|
161
|
+
event.preventDefault();
|
|
162
|
+
const text = event.clipboardData.getData("text");
|
|
163
|
+
if (!text) return;
|
|
164
|
+
const separatorRegex = new RegExp(
|
|
165
|
+
props.separators.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")
|
|
166
|
+
);
|
|
167
|
+
const parts = text.split(separatorRegex);
|
|
168
|
+
parts.forEach((part) => {
|
|
169
|
+
if (tags.value.length >= props.maxTags) return;
|
|
170
|
+
addTag(part);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
function handleBlur() {
|
|
174
|
+
setTimeout(() => {
|
|
175
|
+
focused.value = false;
|
|
176
|
+
selectedIndex.value = -1;
|
|
177
|
+
if (props.addOnBlur && newTag.value) {
|
|
178
|
+
addTag(newTag.value);
|
|
179
|
+
}
|
|
180
|
+
}, 200);
|
|
181
|
+
}
|
|
182
|
+
watch(filteredAutocomplete, () => {
|
|
183
|
+
selectedIndex.value = -1;
|
|
184
|
+
});
|
|
185
|
+
return (_ctx, _cache) => {
|
|
186
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
187
|
+
createElementVNode("div", _hoisted_2, [
|
|
188
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(tags.value, (tag, index) => {
|
|
189
|
+
return openBlock(), createElementBlock("span", {
|
|
190
|
+
key: index,
|
|
191
|
+
class: "tag"
|
|
192
|
+
}, [
|
|
193
|
+
createTextVNode(toDisplayString(getTagText(tag)) + " ", 1),
|
|
194
|
+
createElementVNode("button", {
|
|
195
|
+
onClick: ($event) => removeTag(index),
|
|
196
|
+
class: "tag-remove",
|
|
197
|
+
type: "button"
|
|
198
|
+
}, " × ", 8, _hoisted_3)
|
|
199
|
+
]);
|
|
200
|
+
}), 128)),
|
|
201
|
+
withDirectives(createElementVNode("input", {
|
|
202
|
+
ref_key: "inputRef",
|
|
203
|
+
ref: inputRef,
|
|
204
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => newTag.value = $event),
|
|
205
|
+
onKeydown: handleKeyDown,
|
|
206
|
+
onPaste: handlePaste,
|
|
207
|
+
onFocus: _cache[1] || (_cache[1] = ($event) => focused.value = true),
|
|
208
|
+
onBlur: handleBlur,
|
|
209
|
+
placeholder: __props.placeholder || "Add tags",
|
|
210
|
+
maxlength: __props.maxlength,
|
|
211
|
+
disabled: __props.disabled,
|
|
212
|
+
class: "tag-input"
|
|
213
|
+
}, null, 40, _hoisted_4), [
|
|
214
|
+
[vModelText, newTag.value]
|
|
215
|
+
])
|
|
216
|
+
]),
|
|
217
|
+
showAutocomplete.value && filteredAutocomplete.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
218
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredAutocomplete.value, (item, index) => {
|
|
219
|
+
return openBlock(), createElementBlock("div", {
|
|
220
|
+
key: getTagText(item),
|
|
221
|
+
onClick: ($event) => addTag(item),
|
|
222
|
+
onMouseenter: ($event) => selectedIndex.value = index,
|
|
223
|
+
class: normalizeClass(["autocomplete-item", { selected: selectedIndex.value === index }])
|
|
224
|
+
}, toDisplayString(getTagText(item)), 43, _hoisted_6);
|
|
225
|
+
}), 128))
|
|
226
|
+
])) : createCommentVNode("", true)
|
|
227
|
+
]);
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
const FieldTags = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1b76c0f9"]]);
|
|
232
|
+
export {
|
|
233
|
+
FieldTags as default
|
|
234
|
+
};
|
|
235
|
+
//# sourceMappingURL=FieldTags.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldTags.vue2.js","sources":["../../../../../src/components/FieldTags/FieldTags.vue"],"sourcesContent":["<template>\n <div class=\"field-tags-new\">\n <!-- Tags container -->\n <div class=\"tags-container\">\n <span \n v-for=\"(tag, index) in tags\" \n :key=\"index\"\n class=\"tag\"\n >\n {{ getTagText(tag) }}\n <button \n @click=\"removeTag(index)\" \n class=\"tag-remove\"\n type=\"button\"\n >\n ×\n </button>\n </span>\n \n <input\n ref=\"inputRef\"\n v-model=\"newTag\"\n @keydown=\"handleKeyDown\"\n @paste=\"handlePaste\"\n @focus=\"focused = true\"\n @blur=\"handleBlur\"\n :placeholder=\"placeholder || 'Add tags'\"\n :maxlength=\"maxlength\"\n :disabled=\"disabled\"\n class=\"tag-input\"\n />\n </div>\n \n <!-- Autocomplete dropdown -->\n <div \n v-if=\"showAutocomplete && filteredAutocomplete.length > 0\"\n class=\"autocomplete\"\n >\n <div \n v-for=\"(item, index) in filteredAutocomplete\"\n :key=\"getTagText(item)\"\n @click=\"addTag(item)\"\n @mouseenter=\"selectedIndex = index\"\n :class=\"['autocomplete-item', { selected: selectedIndex === index }]\"\n >\n {{ getTagText(item) }}\n </div>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, computed, watch } from 'vue'\n\nconst props = defineProps({\n modelValue: Array,\n textField: {\n type: String,\n default: 'text'\n },\n autocompleteItems: Array,\n separators: {\n type: Array,\n default: () => [',', ';']\n },\n addOnKey: {\n type: Array,\n default: () => [13] // Enter key\n },\n maxTags: {\n type: Number,\n default: 20\n },\n maxlength: {\n type: Number,\n default: 50\n },\n placeholder: String,\n disabled: Boolean,\n addOnBlur: {\n type: Boolean,\n default: true\n },\n autocompleteMinLength: {\n type: Number,\n default: 1\n }\n})\n\nconst emit = defineEmits(['update:modelValue', 'tags-changed'])\n\n// State\nconst newTag = ref('')\nconst focused = ref(false)\nconst selectedIndex = ref(-1)\nconst inputRef = ref(null)\n\n// Computed\nconst tags = computed({\n get: () => props.modelValue || [],\n set: (value) => {\n emit('update:modelValue', value)\n emit('tags-changed', value)\n }\n})\n\nconst showAutocomplete = computed(() => {\n return focused.value && \n props.autocompleteItems?.length > 0 &&\n newTag.value.length >= props.autocompleteMinLength\n})\n\nconst filteredAutocomplete = computed(() => {\n if (!props.autocompleteItems) return []\n \n const searchText = newTag.value.toLowerCase()\n \n return props.autocompleteItems.filter(item => {\n const itemText = getTagText(item).toLowerCase()\n \n // Filter by search text\n if (!itemText.includes(searchText)) return false\n \n // Filter out duplicates\n return !isDuplicate(itemText)\n })\n})\n\n// Methods\nfunction getTagText(tag) {\n if (tag === null || tag === undefined) return ''\n if (typeof tag === 'string') return tag\n return tag[props.textField] || ''\n}\n\nfunction createTag(text) {\n // Preserve format based on existing data\n if (tags.value.length > 0) {\n if (typeof tags.value[0] === 'string') {\n return text\n }\n }\n \n // Default to object with custom field\n return { [props.textField]: text }\n}\n\nfunction isDuplicate(text) {\n const searchText = text.toLowerCase().trim()\n return tags.value.some(tag => \n getTagText(tag).toLowerCase().trim() === searchText\n )\n}\n\nfunction addTag(input) {\n let text = ''\n \n if (typeof input === 'string') {\n text = input.trim()\n } else if (typeof input === 'object') {\n // If it's an autocomplete item, preserve the whole object\n if (props.autocompleteItems?.includes(input)) {\n if (!isDuplicate(getTagText(input))) {\n tags.value = [...tags.value, input]\n }\n newTag.value = ''\n selectedIndex.value = -1\n return\n }\n text = getTagText(input).trim()\n }\n \n if (!text || tags.value.length >= props.maxTags) return\n \n if (isDuplicate(text)) return\n \n const tag = createTag(text)\n tags.value = [...tags.value, tag]\n newTag.value = ''\n selectedIndex.value = -1\n}\n\nfunction removeTag(index) {\n if (props.disabled) return\n \n const newTags = [...tags.value]\n newTags.splice(index, 1)\n tags.value = newTags\n}\n\nfunction handleKeyDown(event) {\n // Handle arrow keys for autocomplete navigation\n if (showAutocomplete.value) {\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n selectedIndex.value = Math.min(\n selectedIndex.value + 1, \n filteredAutocomplete.value.length - 1\n )\n return\n }\n \n if (event.key === 'ArrowUp') {\n event.preventDefault()\n selectedIndex.value = Math.max(selectedIndex.value - 1, -1)\n return\n }\n \n // Add selected autocomplete item on Enter\n if (event.key === 'Enter' && selectedIndex.value >= 0) {\n event.preventDefault()\n addTag(filteredAutocomplete.value[selectedIndex.value])\n return\n }\n }\n \n // Check for add triggers\n const shouldAdd = props.addOnKey.some(key => {\n if (typeof key === 'number') {\n return event.keyCode === key\n }\n return event.key === key\n })\n \n if (shouldAdd) {\n event.preventDefault()\n addTag(newTag.value)\n return\n }\n \n // Handle backspace to delete last tag\n if (event.key === 'Backspace' && newTag.value === '' && tags.value.length > 0) {\n removeTag(tags.value.length - 1)\n }\n}\n\nfunction handlePaste(event) {\n event.preventDefault()\n \n const text = event.clipboardData.getData('text')\n if (!text) return\n \n // Create regex from separators\n const separatorRegex = new RegExp(\n props.separators.map(s => s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')).join('|')\n )\n \n // Split by separators and add each tag\n const parts = text.split(separatorRegex)\n \n parts.forEach(part => {\n if (tags.value.length >= props.maxTags) return\n addTag(part)\n })\n}\n\nfunction handleBlur() {\n // Small delay to allow click on autocomplete items\n setTimeout(() => {\n focused.value = false\n selectedIndex.value = -1\n \n if (props.addOnBlur && newTag.value) {\n addTag(newTag.value)\n }\n }, 200)\n}\n\n// Reset selected index when autocomplete items change\nwatch(filteredAutocomplete, () => {\n selectedIndex.value = -1\n})\n</script>\n\n<style scoped>\n.field-tags-new {\n position: relative;\n}\n\n.tags-container {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n}\n\n.tag {\n display: inline-flex;\n align-items: center;\n background: rgb(var(--main, 255, 215, 0));\n color: rgb(var(--black, 0, 0, 0));\n padding: 0.25rem 0.5rem;\n border-radius: 2rem;\n font-size: 0.875rem;\n}\n\n.tag-remove {\n margin-left: 0.25rem;\n background: none;\n border: none;\n color: inherit;\n font-size: 1.25rem;\n cursor: pointer;\n padding: 0;\n line-height: 1;\n opacity: 0.7;\n}\n\n.tag-remove:hover {\n opacity: 1;\n}\n\n.tag-input {\n flex: 1;\n border: none;\n background: none;\n outline: none;\n min-width: 150px;\n padding: 0.25rem;\n font-size: inherit;\n font-family: inherit;\n}\n\n.tag-input:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.autocomplete {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n margin-top: 0.25rem;\n background: white;\n border: 1px solid rgb(var(--gray, 224, 224, 224));\n border-radius: 0.5rem;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n max-height: 200px;\n overflow-y: auto;\n z-index: 100;\n}\n\n.autocomplete-item {\n padding: 0.5rem 0.75rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n\n.autocomplete-item:hover,\n.autocomplete-item.selected {\n background: rgb(var(--gray-light, 248, 248, 248));\n}\n\n.autocomplete-item:first-child {\n border-radius: 0.5rem 0.5rem 0 0;\n}\n\n.autocomplete-item:last-child {\n border-radius: 0 0 0.5rem 0.5rem;\n}\n</style>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,UAAM,QAAQ;AAmCd,UAAM,OAAO;AAGb,UAAM,SAAS,IAAI,EAAE;AACrB,UAAM,UAAU,IAAI,KAAK;AACzB,UAAM,gBAAgB,IAAI,EAAE;AAC5B,UAAM,WAAW,IAAI,I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C,YAAI,OAAO,QAAQ,UAAU;AAC3B,iBAAO,MAAM,YAAY;AAAA,QAC3B;AACA,eAAO,MAAM,QAAQ;AAAA,MACvB,CAAC;AAED,UAAI,WAAW;AACb,cAAM,eAAc;AACpB,eAAO,OAAO,KAAK;AACnB;AAAA,MACF;AAGA,UAAI,MAAM,QAAQ,eAAe,OAAO,UAAU,MAAM,KAAK,MAAM,SAAS,GAAG;AAC7E,kBAAU,KAAK,MAAM,SAAS,CAAC;AAAA,MACjC;AAAA,IACF;AAEA,aAAS,YAAY,OAAO;AAC1B,YAAM,eAAc;AAEpB,YAAM,OAAO,MAAM,cAAc,QAAQ,MAAM;AAC/C,UAAI,CAAC,KAAM;AAGX,YAAM,iBAAiB,IAAI;AAAA,QACzB,MAAM,WAAW,IAAI,OAAK,EAAE,QAAQ,uBAAuB,MAAM,CAAC,EAAE,KAAK,GAAG;AAAA,MAChF;AAGE,YAAM,QAAQ,KAAK,MAAM,cAAc;AAEvC,YAAM,QAAQ,UAAQ;AACpB,YAAI,KAAK,MAAM,UAAU,MAAM,QAAS;AACxC,eAAO,IAAI;AAAA,MACb,CAAC;AAAA,IACH;AAEA,aAAS,aAAa;AAEpB,iBAAW,MAAM;AACf,gBAAQ,QAAQ;AAChB,sBAAc,QAAQ;AAEtB,YAAI,MAAM,aAAa,OAAO,OAAO;AACnC,iBAAO,OAAO,KAAK;AAAA,QACrB;AAAA,MACF,GAAG,GAAG;AAAA,IACR;AAGA,UAAM,sBAAsB,MAAM;AAChC,oBAAc,QAAQ;AAAA,IACxB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -33,6 +33,7 @@ const _sfc_main = {
|
|
|
33
33
|
const resizeObserver = vue.ref(null);
|
|
34
34
|
const checkInterval = vue.ref(null);
|
|
35
35
|
const resizeTimeout = vue.ref(null);
|
|
36
|
+
const previousSize = vue.ref({ width: 0, height: 0 });
|
|
36
37
|
const widthMin = vue.ref("100%");
|
|
37
38
|
const widthContainer = vue.ref(0);
|
|
38
39
|
const widthContent = vue.ref(0);
|
|
@@ -87,11 +88,19 @@ const _sfc_main = {
|
|
|
87
88
|
if (resizeObserver.value) {
|
|
88
89
|
resizeObserver.value.disconnect();
|
|
89
90
|
}
|
|
90
|
-
resizeObserver.value = new ResizeObserver(() => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
resizeObserver.value = new ResizeObserver((entries) => {
|
|
92
|
+
const entry = entries[0];
|
|
93
|
+
const newWidth = entry.contentRect.width;
|
|
94
|
+
const newHeight = entry.contentRect.height;
|
|
95
|
+
const widthChanged = Math.abs(newWidth - previousSize.value.width) > 1;
|
|
96
|
+
const heightChanged = Math.abs(newHeight - previousSize.value.height) > 1;
|
|
97
|
+
if (widthChanged || heightChanged) {
|
|
98
|
+
previousSize.value = { width: newWidth, height: newHeight };
|
|
99
|
+
clearTimeout(resizeTimeout.value);
|
|
100
|
+
resizeTimeout.value = setTimeout(() => {
|
|
101
|
+
calculateClones();
|
|
102
|
+
}, 300);
|
|
103
|
+
}
|
|
95
104
|
});
|
|
96
105
|
resizeObserver.value.observe(marqueeOverlayContainer.value);
|
|
97
106
|
} else {
|
|
@@ -125,7 +134,7 @@ const _sfc_main = {
|
|
|
125
134
|
"--pauseOnHover": `${props.pauseOnHover ? "paused" : "running"}`,
|
|
126
135
|
"--pauseOnClick": `${props.pauseOnClick ? "paused" : "running"}`,
|
|
127
136
|
"--pauseAnimation": `${props.vertical && verticalAnimationPause.value || props.pause ? "paused" : "running"}`,
|
|
128
|
-
"--gradient-color":
|
|
137
|
+
"--gradient-color": props.gradientColor,
|
|
129
138
|
"--gradient-length": `${gradientLength.value}`,
|
|
130
139
|
"--min-width": `${widthMin.value}`,
|
|
131
140
|
"--min-height": `${heightMin.value}`,
|
|
@@ -181,9 +190,9 @@ const _sfc_main = {
|
|
|
181
190
|
(newVal, oldVal) => {
|
|
182
191
|
if (newVal !== oldVal) {
|
|
183
192
|
if (newVal) {
|
|
184
|
-
emits("onResume");
|
|
185
|
-
} else {
|
|
186
193
|
emits("onPause");
|
|
194
|
+
} else {
|
|
195
|
+
emits("onResume");
|
|
187
196
|
}
|
|
188
197
|
}
|
|
189
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marquee.vue.cjs","sources":["../../../../../src/components/Marquee/Marquee.vue"],"sourcesContent":["<template>\n <div\n v-if=\"ready\"\n class=\"vue3-marquee\"\n :class=\"{ vertical: vertical, horizontal: !vertical }\"\n :style=\"getCurrentStyle\"\n @mouseenter=\"hoverStarted\"\n @mouseleave=\"hoverEnded\"\n @mousedown=\"mouseDown\"\n @mouseup=\"mouseUp\"\n >\n <div\n class=\"transparent-overlay\"\n ref=\"marqueeOverlayContainer\"\n :aria-hidden=\"true\"\n :class=\"{ vertical: vertical, horizontal: !vertical, overlay: gradient }\"\n />\n\n <div \n class=\"marquee\"\n ref=\"marqueeContent\">\n <slot></slot>\n </div>\n\n <div \n class=\"marquee\" \n :aria-hidden=\"true\"\n >\n <slot></slot>\n </div>\n\n <div\n v-for=\"num in cloneAmount\"\n :key=\"num\"\n :aria-hidden=\"true\"\n class=\"marquee cloned\"\n >\n <slot></slot>\n </div\n >\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue'\n\nconst props = defineProps({\n vertical: { type: Boolean, default: false },\n direction: { type: String, default: 'normal' },\n duration: { type: Number, default: 20 },\n delay: { type: Number, default: 0 },\n loop: { type: Number, default: 0 },\n clone: { type: Boolean, default: false },\n gradient: { type: Boolean, default: false },\n gradientColor: { type: [Array,String], default: () => [255, 255, 255] },\n gradientLength: { type: String },\n pauseOnHover: { type: Boolean, default: false },\n pauseOnClick: { type: Boolean, default: false },\n pause: { type: Boolean, default: false }\n})\n\nconst emits = defineEmits(['onComplete', 'onLoopComplete', 'onPause', 'onResume'])\n\nconst ready = ref(false)\n\nconst cloneAmount = ref(0)\nconst loopCounter = ref(0)\nconst loopInterval = ref(null)\nconst resizeObserver = ref(null)\nconst checkInterval = ref(null)\nconst resizeTimeout = ref(null)\n\nconst widthMin = ref('100%')\nconst widthContainer = ref(0)\nconst widthContent = ref(0)\nconst heightMin = ref('100%')\nconst heightContainer = ref(0)\nconst heightContent = ref(0)\n\nconst gradientLength = ref('200px')\n\nconst verticalAnimationPause = ref(false)\nconst marqueeContent = ref(null)\nconst marqueeOverlayContainer = ref(null)\n\n// Removed ForcesUpdate - no longer needed\n\nconst checkForClone = async () => {\n if (props.vertical) {\n verticalAnimationPause.value = true\n }\n\n await nextTick()\n \n const calculateClones = () => {\n widthMin.value = '0%'\n heightMin.value = '0%'\n\n if (marqueeContent.value !== null && marqueeOverlayContainer.value !== null) {\n if (marqueeContent.value && marqueeOverlayContainer.value) {\n if (\n props.vertical &&\n 'clientHeight' in marqueeContent.value &&\n 'clientHeight' in marqueeOverlayContainer.value\n ) {\n heightContent.value = marqueeContent.value.clientHeight\n heightContainer.value = marqueeOverlayContainer.value.clientHeight\n\n const localCloneAmount = Math.ceil(heightContainer.value / heightContent.value)\n\n cloneAmount.value = isFinite(localCloneAmount) ? localCloneAmount : 0\n\n verticalAnimationPause.value = false\n\n return cloneAmount.value\n } else if (\n !props.vertical &&\n 'clientWidth' in marqueeContent.value &&\n 'clientWidth' in marqueeOverlayContainer.value\n ) {\n widthContent.value = marqueeContent.value.clientWidth\n widthContainer.value = marqueeOverlayContainer.value.clientWidth\n\n const localCloneAmount = Math.ceil(widthContainer.value / widthContent.value)\n\n cloneAmount.value = isFinite(localCloneAmount) ? localCloneAmount : 0\n\n return cloneAmount.value\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n }\n \n // Run once immediately\n calculateClones()\n \n // Setup ResizeObserver for efficient resize detection\n if (typeof ResizeObserver !== 'undefined' && marqueeOverlayContainer.value) {\n if (resizeObserver.value) {\n resizeObserver.value.disconnect()\n }\n \n resizeObserver.value = new ResizeObserver(() => {\n clearTimeout(resizeTimeout.value)\n resizeTimeout.value = setTimeout(() => {\n calculateClones()\n }, 150)\n })\n \n resizeObserver.value.observe(marqueeOverlayContainer.value)\n } else {\n // Fallback for browsers without ResizeObserver\n // Only check once after a delay for initial setup\n if (checkInterval.value) {\n clearInterval(checkInterval.value)\n }\n \n checkInterval.value = setTimeout(() => {\n calculateClones()\n checkInterval.value = null\n }, 500)\n }\n}\n\nconst hoverStarted = () => { if (props.pauseOnHover) emits('onPause') }\nconst hoverEnded = () => { if (props.pauseOnHover) emits('onResume') }\nconst mouseDown = () => { if (props.pauseOnClick) emits('onPause') }\nconst mouseUp = () => { if (props.pauseOnClick) emits('onResume') }\n\nconst getCurrentStyle = computed(() => {\n return {\n '--loops': `${props.loop === 0 ? 'infinite' : props.loop}`,\n '--duration': `${props.duration}s`,\n '--delay': `${props.delay}s`,\n '--direction': `${props.direction}`,\n '--pauseOnHover': `${props.pauseOnHover ? 'paused' : 'running'}`,\n '--pauseOnClick': `${props.pauseOnClick ? 'paused' : 'running'}`,\n '--pauseAnimation': `${(props.vertical && verticalAnimationPause.value) || props.pause ? 'paused' : 'running'}`,\n '--gradient-color': `rgba(${props.gradientColor}, 1), rgba(${props.gradientColor}, 0)`,\n '--gradient-length': `${gradientLength.value}`,\n '--min-width': `${widthMin.value}`,\n '--min-height': `${heightMin.value}`,\n '--orientation': props.vertical ? 'scrollY' : 'scrollX'\n }\n})\n\nconst setupMarquee = async () => {\n if (props.vertical) {\n heightMin.value = '100%'\n widthMin.value = 'auto'\n } else {\n heightMin.value = 'auto'\n widthMin.value = '100%'\n }\n\n if (props.gradient && props.gradientLength) {\n gradientLength.value = props.gradientLength\n }\n\n if (props.clone) {\n await checkForClone()\n ready.value = true\n } else {\n ready.value = true\n }\n}\n\nonMounted(async () => {\n setupMarquee()\n\n loopInterval.value = setInterval(() => {\n loopCounter.value++\n\n if (props.loop !== 0 && loopCounter.value === props.loop) {\n emits('onComplete')\n clearInterval(loopInterval.value)\n }\n\n emits('onLoopComplete')\n }, props.duration * 1000)\n})\n\nonBeforeUnmount(() => {\n clearInterval(loopInterval.value)\n \n if (resizeObserver.value) {\n resizeObserver.value.disconnect()\n resizeObserver.value = null\n }\n \n if (checkInterval.value) {\n clearInterval(checkInterval.value)\n checkInterval.value = null\n }\n \n if (resizeTimeout.value) {\n clearTimeout(resizeTimeout.value)\n resizeTimeout.value = null\n }\n})\n\n// Removed inefficient watchers - ResizeObserver handles this now\n\nwatch(\n () => props.pause,\n (newVal, oldVal) => {\n if (newVal !== oldVal) {\n if (newVal) {\n emits('onResume')\n } else {\n emits('onPause')\n }\n }\n }\n)\n</script>\n\n<style lang=\"scss\">\n.vue3-marquee {\n display: flex !important;\n position: relative;\n\n .marquee {\n flex: 0 0 auto;\n min-width: var(--min-width);\n min-height: var(--min-height);\n z-index: 1;\n will-change: transform;\n transform: translateZ(0);\n backface-visibility: hidden;\n\n animation: var(--orientation) var(--duration) linear var(--delay) var(--loops);\n animation-play-state: var(--pauseAnimation);\n animation-direction: var(--direction);\n contain: layout style paint;\n }\n\n .overlay {\n position: absolute;\n width: 100%;\n height: 100%;\n\n &:before {\n left: 0;\n top: 0;\n }\n\n &:before, &:after {\n content: '';\n position: absolute;\n z-index: 2;\n }\n }\n\n .transparent-overlay {\n position: absolute;\n width: 100.5%;\n height: 100.5%;\n }\n\n\n &.horizontal {\n overflow-x: hidden !important;\n overflow-y: hidden !important;\n flex-direction: row !important;\n width: 100%;\n height: max-content;\n\n .marquee {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n\n .overlay::before,.overlay::after {\n background: linear-gradient(to right, var(--gradient-color));\n height: 100%;\n width: var(--gradient-length);\n }\n\n .overlay::after {\n transform: rotateZ(180deg);\n right: 0;\n top: 0;\n }\n }\n\n &.vertical {\n overflow-y: hidden !important;\n overflow-x: hidden !important;\n flex-direction: column !important;\n height: 100%;\n width: max-content;\n\n .marquee {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .overlay::before, .overlay::after {\n background: linear-gradient(to bottom, var(--gradient-color));\n height: var(--gradient-length);\n width: 100%;\n }\n\n .overlay::after {\n transform: rotateZ(-180deg);\n left: 0;\n bottom: 0;\n }\n }\n\n &:hover {\n div {\n animation-play-state: var(--pauseOnHover);\n }\n }\n\n &:active {\n div {\n animation-play-state: var(--pauseOnClick);\n } \n }\n}\n\n@keyframes scrollX {\n 0% {\n transform: translate3d(0, 0, 0);\n }\n 100% {\n transform: translate3d(-100%, 0, 0);\n }\n}\n\n@keyframes scrollY {\n 0% {\n transform: translate3d(0, 0, 0);\n }\n 100% {\n transform: translate3d(0, -100%, 0);\n }\n}\n</style>"],"names":["ref","nextTick","computed","onMounted","onBeforeUnmount","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,UAAM,QAAQ;AAed,UAAM,QAAQ;AAEd,UAAM,QAAQA,IAAAA,IAAI,KAAK;AAEvB,UAAM,cAAcA,IAAAA,IAAI,CAAC;AACzB,UAAM,cAAcA,IAAAA,IAAI,CAAC;AACzB,UAAM,eAAeA,IAAAA,IAAI,IAAI;AAC7B,UAAM,iBAAiBA,IAAAA,IAAI,IAAI;AAC/B,UAAM,gBAAgBA,IAAAA,IAAI,IAAI;AAC9B,UAAM,gBAAgBA,IAAAA,IAAI,IAAI;AAE9B,UAAM,WAAWA,IAAAA,IAAI,MAAM;AAC3B,UAAM,iBAAiBA,IAAAA,IAAI,CAAC;AAC5B,UAAM,eAAeA,IAAAA,IAAI,CAAC;AAC1B,UAAM,YAAYA,IAAAA,IAAI,MAAM;AAC5B,UAAM,kBAAkBA,IAAAA,IAAI,CAAC;AAC7B,UAAM,gBAAgBA,IAAAA,IAAI,CAAC;AAE3B,UAAM,iBAAiBA,IAAAA,IAAI,OAAO;AAElC,UAAM,yBAAyBA,IAAAA,IAAI,KAAK;AACxC,U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,UAClB,OAAO;AACL,kBAAM,SAAS;AAAA,UACjB;AAAA,QACF;AAAA,MACF;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Marquee.vue.cjs","sources":["../../../../../src/components/Marquee/Marquee.vue"],"sourcesContent":["<template>\n <div\n v-if=\"ready\"\n class=\"vue3-marquee\"\n :class=\"{ vertical: vertical, horizontal: !vertical }\"\n :style=\"getCurrentStyle\"\n @mouseenter=\"hoverStarted\"\n @mouseleave=\"hoverEnded\"\n @mousedown=\"mouseDown\"\n @mouseup=\"mouseUp\"\n >\n <div\n class=\"transparent-overlay\"\n ref=\"marqueeOverlayContainer\"\n :aria-hidden=\"true\"\n :class=\"{ vertical: vertical, horizontal: !vertical, overlay: gradient }\"\n />\n\n <div \n class=\"marquee\"\n ref=\"marqueeContent\">\n <slot></slot>\n </div>\n\n <div \n class=\"marquee\" \n :aria-hidden=\"true\"\n >\n <slot></slot>\n </div>\n\n <div\n v-for=\"num in cloneAmount\"\n :key=\"num\"\n :aria-hidden=\"true\"\n class=\"marquee cloned\"\n >\n <slot></slot>\n </div\n >\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue'\n\nconst props = defineProps({\n vertical: { type: Boolean, default: false },\n direction: { type: String, default: 'normal' },\n duration: { type: Number, default: 20 },\n delay: { type: Number, default: 0 },\n loop: { type: Number, default: 0 },\n clone: { type: Boolean, default: false },\n gradient: { type: Boolean, default: false },\n gradientColor: { type: [Array,String], default: () => [255, 255, 255] },\n gradientLength: { type: String },\n pauseOnHover: { type: Boolean, default: false },\n pauseOnClick: { type: Boolean, default: false },\n pause: { type: Boolean, default: false }\n})\n\nconst emits = defineEmits(['onComplete', 'onLoopComplete', 'onPause', 'onResume'])\n\nconst ready = ref(false)\n\nconst cloneAmount = ref(0)\nconst loopCounter = ref(0)\nconst loopInterval = ref(null)\nconst resizeObserver = ref(null)\nconst checkInterval = ref(null)\nconst resizeTimeout = ref(null)\nconst previousSize = ref({ width: 0, height: 0 })\n\nconst widthMin = ref('100%')\nconst widthContainer = ref(0)\nconst widthContent = ref(0)\nconst heightMin = ref('100%')\nconst heightContainer = ref(0)\nconst heightContent = ref(0)\n\nconst gradientLength = ref('200px')\n\nconst verticalAnimationPause = ref(false)\nconst marqueeContent = ref(null)\nconst marqueeOverlayContainer = ref(null)\n\n// Removed ForcesUpdate - no longer needed\n\nconst checkForClone = async () => {\n if (props.vertical) {\n verticalAnimationPause.value = true\n }\n\n await nextTick()\n \n const calculateClones = () => {\n widthMin.value = '0%'\n heightMin.value = '0%'\n\n if (marqueeContent.value !== null && marqueeOverlayContainer.value !== null) {\n if (marqueeContent.value && marqueeOverlayContainer.value) {\n if (\n props.vertical &&\n 'clientHeight' in marqueeContent.value &&\n 'clientHeight' in marqueeOverlayContainer.value\n ) {\n heightContent.value = marqueeContent.value.clientHeight\n heightContainer.value = marqueeOverlayContainer.value.clientHeight\n\n const localCloneAmount = Math.ceil(heightContainer.value / heightContent.value)\n\n cloneAmount.value = isFinite(localCloneAmount) ? localCloneAmount : 0\n\n verticalAnimationPause.value = false\n\n return cloneAmount.value\n } else if (\n !props.vertical &&\n 'clientWidth' in marqueeContent.value &&\n 'clientWidth' in marqueeOverlayContainer.value\n ) {\n widthContent.value = marqueeContent.value.clientWidth\n widthContainer.value = marqueeOverlayContainer.value.clientWidth\n\n const localCloneAmount = Math.ceil(widthContainer.value / widthContent.value)\n\n cloneAmount.value = isFinite(localCloneAmount) ? localCloneAmount : 0\n\n return cloneAmount.value\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n }\n \n // Run once immediately\n calculateClones()\n \n // Setup ResizeObserver for efficient resize detection\n if (typeof ResizeObserver !== 'undefined' && marqueeOverlayContainer.value) {\n if (resizeObserver.value) {\n resizeObserver.value.disconnect()\n }\n \n resizeObserver.value = new ResizeObserver((entries) => {\n const entry = entries[0]\n const newWidth = entry.contentRect.width\n const newHeight = entry.contentRect.height\n \n // Only recalculate if size changed significantly (more than 1px)\n const widthChanged = Math.abs(newWidth - previousSize.value.width) > 1\n const heightChanged = Math.abs(newHeight - previousSize.value.height) > 1\n \n if (widthChanged || heightChanged) {\n previousSize.value = { width: newWidth, height: newHeight }\n clearTimeout(resizeTimeout.value)\n resizeTimeout.value = setTimeout(() => {\n calculateClones()\n }, 300)\n }\n })\n \n resizeObserver.value.observe(marqueeOverlayContainer.value)\n } else {\n // Fallback for browsers without ResizeObserver\n // Only check once after a delay for initial setup\n if (checkInterval.value) {\n clearInterval(checkInterval.value)\n }\n \n checkInterval.value = setTimeout(() => {\n calculateClones()\n checkInterval.value = null\n }, 500)\n }\n}\n\nconst hoverStarted = () => { if (props.pauseOnHover) emits('onPause') }\nconst hoverEnded = () => { if (props.pauseOnHover) emits('onResume') }\nconst mouseDown = () => { if (props.pauseOnClick) emits('onPause') }\nconst mouseUp = () => { if (props.pauseOnClick) emits('onResume') }\n\nconst getCurrentStyle = computed(() => {\n return {\n '--loops': `${props.loop === 0 ? 'infinite' : props.loop}`,\n '--duration': `${props.duration}s`,\n '--delay': `${props.delay}s`,\n '--direction': `${props.direction}`,\n '--pauseOnHover': `${props.pauseOnHover ? 'paused' : 'running'}`,\n '--pauseOnClick': `${props.pauseOnClick ? 'paused' : 'running'}`,\n '--pauseAnimation': `${(props.vertical && verticalAnimationPause.value) || props.pause ? 'paused' : 'running'}`,\n '--gradient-color': props.gradientColor,\n '--gradient-length': `${gradientLength.value}`,\n '--min-width': `${widthMin.value}`,\n '--min-height': `${heightMin.value}`,\n '--orientation': props.vertical ? 'scrollY' : 'scrollX'\n }\n})\n\nconst setupMarquee = async () => {\n if (props.vertical) {\n heightMin.value = '100%'\n widthMin.value = 'auto'\n } else {\n heightMin.value = 'auto'\n widthMin.value = '100%'\n }\n\n if (props.gradient && props.gradientLength) {\n gradientLength.value = props.gradientLength\n }\n\n if (props.clone) {\n await checkForClone()\n ready.value = true\n } else {\n ready.value = true\n }\n}\n\nonMounted(async () => {\n setupMarquee()\n\n loopInterval.value = setInterval(() => {\n loopCounter.value++\n\n if (props.loop !== 0 && loopCounter.value === props.loop) {\n emits('onComplete')\n clearInterval(loopInterval.value)\n }\n\n emits('onLoopComplete')\n }, props.duration * 1000)\n})\n\nonBeforeUnmount(() => {\n clearInterval(loopInterval.value)\n \n if (resizeObserver.value) {\n resizeObserver.value.disconnect()\n resizeObserver.value = null\n }\n \n if (checkInterval.value) {\n clearInterval(checkInterval.value)\n checkInterval.value = null\n }\n \n if (resizeTimeout.value) {\n clearTimeout(resizeTimeout.value)\n resizeTimeout.value = null\n }\n})\n\n// Removed inefficient watchers - ResizeObserver handles this now\n\nwatch(\n () => props.pause,\n (newVal, oldVal) => {\n if (newVal !== oldVal) {\n if (newVal) {\n emits('onPause')\n } else {\n emits('onResume')\n }\n }\n }\n)\n</script>\n\n<style lang=\"scss\">\n.vue3-marquee {\n display: flex !important;\n position: relative;\n will-change: transform;\n transform: translateZ(0);\n backface-visibility: hidden;\n\n .marquee {\n flex: 0 0 auto;\n min-width: var(--min-width);\n min-height: var(--min-height);\n z-index: 1;\n\n animation: var(--orientation) var(--duration) linear var(--delay) var(--loops);\n animation-play-state: var(--pauseAnimation);\n animation-direction: var(--direction);\n }\n\n .overlay {\n position: absolute;\n width: 100%;\n height: 100%;\n\n &:before {\n left: 0;\n top: 0;\n }\n\n &:before, &:after {\n content: '';\n position: absolute;\n z-index: 2;\n }\n }\n\n .transparent-overlay {\n position: absolute;\n width: 100.5%;\n height: 100.5%;\n }\n\n\n &.horizontal {\n overflow-x: hidden !important;\n overflow-y: hidden !important;\n flex-direction: row !important;\n width: 100%;\n height: max-content;\n\n .marquee {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n\n .overlay::before,.overlay::after {\n background: linear-gradient(to right, var(--gradient-color), transparent);\n height: 100%;\n width: var(--gradient-length);\n }\n\n .overlay::after {\n transform: rotateZ(180deg);\n right: 0;\n top: 0;\n }\n }\n\n &.vertical {\n overflow-y: hidden !important;\n overflow-x: hidden !important;\n flex-direction: column !important;\n height: 100%;\n width: max-content;\n\n .marquee {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .overlay::before, .overlay::after {\n background: linear-gradient(to bottom, var(--gradient-color), transparent);\n height: var(--gradient-length);\n width: 100%;\n }\n\n .overlay::after {\n transform: rotateZ(-180deg);\n left: 0;\n bottom: 0;\n }\n }\n\n &:hover {\n div {\n animation-play-state: var(--pauseOnHover);\n }\n }\n\n &:active {\n div {\n animation-play-state: var(--pauseOnClick);\n } \n }\n}\n\n@keyframes scrollX {\n 0% {\n transform: translate3d(0, 0, 0);\n }\n 100% {\n transform: translate3d(-100%, 0, 0);\n }\n}\n\n@keyframes scrollY {\n 0% {\n transform: translate3d(0, 0, 0);\n }\n 100% {\n transform: translate3d(0, -100%, 0);\n }\n}\n</style>"],"names":["ref","nextTick","computed","onMounted","onBeforeUnmount","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,UAAM,QAAQ;AAed,UAAM,QAAQ;AAEd,UAAM,QAAQA,IAAAA,IAAI,KAAK;AAEvB,UAAM,cAAcA,IAAAA,IAAI,CAAC;AACzB,UAAM,cAAcA,IAAAA,IAAI,CAAC;AACzB,UAAM,eAAeA,IAAAA,IAAI,IAAI;AAC7B,UAAM,iBAAiBA,IAAAA,IAAI,IAAI;AAC/B,UAAM,gBAAgBA,IAAAA,IAAI,IAAI;AAC9B,UAAM,gBAAgBA,IAAAA,IAAI,IAAI;AAC9B,UAAM,eAAeA,IAAAA,IAAI,EAAE,OAAO,GAAG,QAAQ,EAAC,CAAE;AAEhD,UAAM,WAAWA,IAAAA,IAAI,MAAM;AAC3B,UAAM,iBAAiBA,IAAAA,IAAI,CAAC;AAC5B,UAAM,eAAeA,IAAAA,IAAI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A,MACxB,GAAG,MAAM,WAAW,GAAI;AAAA,IAC1B,CAAC;AAEDC,QAAAA,gBAAgB,MAAM;AACpB,oBAAc,aAAa,KAAK;AAEhC,UAAI,eAAe,OAAO;AACxB,uBAAe,MAAM,WAAU;AAC/B,uBAAe,QAAQ;AAAA,MACzB;AAEA,UAAI,cAAc,OAAO;AACvB,sBAAc,cAAc,KAAK;AACjC,sBAAc,QAAQ;AAAA,MACxB;AAEA,UAAI,cAAc,OAAO;AACvB,qBAAa,cAAc,KAAK;AAChC,sBAAc,QAAQ;AAAA,MACxB;AAAA,IACF,CAAC;AAIDC,QAAAA;AAAAA,MACE,MAAM,MAAM;AAAA,MACZ,CAAC,QAAQ,WAAW;AAClB,YAAI,WAAW,QAAQ;AACrB,cAAI,QAAQ;AACV,kBAAM,SAAS;AAAA,UACjB,OAAO;AACL,kBAAM,UAAU;AAAA,UAClB;AAAA,QACF;AAAA,MACF;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -31,6 +31,7 @@ const _sfc_main = {
|
|
|
31
31
|
const resizeObserver = ref(null);
|
|
32
32
|
const checkInterval = ref(null);
|
|
33
33
|
const resizeTimeout = ref(null);
|
|
34
|
+
const previousSize = ref({ width: 0, height: 0 });
|
|
34
35
|
const widthMin = ref("100%");
|
|
35
36
|
const widthContainer = ref(0);
|
|
36
37
|
const widthContent = ref(0);
|
|
@@ -85,11 +86,19 @@ const _sfc_main = {
|
|
|
85
86
|
if (resizeObserver.value) {
|
|
86
87
|
resizeObserver.value.disconnect();
|
|
87
88
|
}
|
|
88
|
-
resizeObserver.value = new ResizeObserver(() => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
resizeObserver.value = new ResizeObserver((entries) => {
|
|
90
|
+
const entry = entries[0];
|
|
91
|
+
const newWidth = entry.contentRect.width;
|
|
92
|
+
const newHeight = entry.contentRect.height;
|
|
93
|
+
const widthChanged = Math.abs(newWidth - previousSize.value.width) > 1;
|
|
94
|
+
const heightChanged = Math.abs(newHeight - previousSize.value.height) > 1;
|
|
95
|
+
if (widthChanged || heightChanged) {
|
|
96
|
+
previousSize.value = { width: newWidth, height: newHeight };
|
|
97
|
+
clearTimeout(resizeTimeout.value);
|
|
98
|
+
resizeTimeout.value = setTimeout(() => {
|
|
99
|
+
calculateClones();
|
|
100
|
+
}, 300);
|
|
101
|
+
}
|
|
93
102
|
});
|
|
94
103
|
resizeObserver.value.observe(marqueeOverlayContainer.value);
|
|
95
104
|
} else {
|
|
@@ -123,7 +132,7 @@ const _sfc_main = {
|
|
|
123
132
|
"--pauseOnHover": `${props.pauseOnHover ? "paused" : "running"}`,
|
|
124
133
|
"--pauseOnClick": `${props.pauseOnClick ? "paused" : "running"}`,
|
|
125
134
|
"--pauseAnimation": `${props.vertical && verticalAnimationPause.value || props.pause ? "paused" : "running"}`,
|
|
126
|
-
"--gradient-color":
|
|
135
|
+
"--gradient-color": props.gradientColor,
|
|
127
136
|
"--gradient-length": `${gradientLength.value}`,
|
|
128
137
|
"--min-width": `${widthMin.value}`,
|
|
129
138
|
"--min-height": `${heightMin.value}`,
|
|
@@ -179,9 +188,9 @@ const _sfc_main = {
|
|
|
179
188
|
(newVal, oldVal) => {
|
|
180
189
|
if (newVal !== oldVal) {
|
|
181
190
|
if (newVal) {
|
|
182
|
-
emits("onResume");
|
|
183
|
-
} else {
|
|
184
191
|
emits("onPause");
|
|
192
|
+
} else {
|
|
193
|
+
emits("onResume");
|
|
185
194
|
}
|
|
186
195
|
}
|
|
187
196
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marquee.vue.js","sources":["../../../../../src/components/Marquee/Marquee.vue"],"sourcesContent":["<template>\n <div\n v-if=\"ready\"\n class=\"vue3-marquee\"\n :class=\"{ vertical: vertical, horizontal: !vertical }\"\n :style=\"getCurrentStyle\"\n @mouseenter=\"hoverStarted\"\n @mouseleave=\"hoverEnded\"\n @mousedown=\"mouseDown\"\n @mouseup=\"mouseUp\"\n >\n <div\n class=\"transparent-overlay\"\n ref=\"marqueeOverlayContainer\"\n :aria-hidden=\"true\"\n :class=\"{ vertical: vertical, horizontal: !vertical, overlay: gradient }\"\n />\n\n <div \n class=\"marquee\"\n ref=\"marqueeContent\">\n <slot></slot>\n </div>\n\n <div \n class=\"marquee\" \n :aria-hidden=\"true\"\n >\n <slot></slot>\n </div>\n\n <div\n v-for=\"num in cloneAmount\"\n :key=\"num\"\n :aria-hidden=\"true\"\n class=\"marquee cloned\"\n >\n <slot></slot>\n </div\n >\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue'\n\nconst props = defineProps({\n vertical: { type: Boolean, default: false },\n direction: { type: String, default: 'normal' },\n duration: { type: Number, default: 20 },\n delay: { type: Number, default: 0 },\n loop: { type: Number, default: 0 },\n clone: { type: Boolean, default: false },\n gradient: { type: Boolean, default: false },\n gradientColor: { type: [Array,String], default: () => [255, 255, 255] },\n gradientLength: { type: String },\n pauseOnHover: { type: Boolean, default: false },\n pauseOnClick: { type: Boolean, default: false },\n pause: { type: Boolean, default: false }\n})\n\nconst emits = defineEmits(['onComplete', 'onLoopComplete', 'onPause', 'onResume'])\n\nconst ready = ref(false)\n\nconst cloneAmount = ref(0)\nconst loopCounter = ref(0)\nconst loopInterval = ref(null)\nconst resizeObserver = ref(null)\nconst checkInterval = ref(null)\nconst resizeTimeout = ref(null)\n\nconst widthMin = ref('100%')\nconst widthContainer = ref(0)\nconst widthContent = ref(0)\nconst heightMin = ref('100%')\nconst heightContainer = ref(0)\nconst heightContent = ref(0)\n\nconst gradientLength = ref('200px')\n\nconst verticalAnimationPause = ref(false)\nconst marqueeContent = ref(null)\nconst marqueeOverlayContainer = ref(null)\n\n// Removed ForcesUpdate - no longer needed\n\nconst checkForClone = async () => {\n if (props.vertical) {\n verticalAnimationPause.value = true\n }\n\n await nextTick()\n \n const calculateClones = () => {\n widthMin.value = '0%'\n heightMin.value = '0%'\n\n if (marqueeContent.value !== null && marqueeOverlayContainer.value !== null) {\n if (marqueeContent.value && marqueeOverlayContainer.value) {\n if (\n props.vertical &&\n 'clientHeight' in marqueeContent.value &&\n 'clientHeight' in marqueeOverlayContainer.value\n ) {\n heightContent.value = marqueeContent.value.clientHeight\n heightContainer.value = marqueeOverlayContainer.value.clientHeight\n\n const localCloneAmount = Math.ceil(heightContainer.value / heightContent.value)\n\n cloneAmount.value = isFinite(localCloneAmount) ? localCloneAmount : 0\n\n verticalAnimationPause.value = false\n\n return cloneAmount.value\n } else if (\n !props.vertical &&\n 'clientWidth' in marqueeContent.value &&\n 'clientWidth' in marqueeOverlayContainer.value\n ) {\n widthContent.value = marqueeContent.value.clientWidth\n widthContainer.value = marqueeOverlayContainer.value.clientWidth\n\n const localCloneAmount = Math.ceil(widthContainer.value / widthContent.value)\n\n cloneAmount.value = isFinite(localCloneAmount) ? localCloneAmount : 0\n\n return cloneAmount.value\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n }\n \n // Run once immediately\n calculateClones()\n \n // Setup ResizeObserver for efficient resize detection\n if (typeof ResizeObserver !== 'undefined' && marqueeOverlayContainer.value) {\n if (resizeObserver.value) {\n resizeObserver.value.disconnect()\n }\n \n resizeObserver.value = new ResizeObserver(() => {\n clearTimeout(resizeTimeout.value)\n resizeTimeout.value = setTimeout(() => {\n calculateClones()\n }, 150)\n })\n \n resizeObserver.value.observe(marqueeOverlayContainer.value)\n } else {\n // Fallback for browsers without ResizeObserver\n // Only check once after a delay for initial setup\n if (checkInterval.value) {\n clearInterval(checkInterval.value)\n }\n \n checkInterval.value = setTimeout(() => {\n calculateClones()\n checkInterval.value = null\n }, 500)\n }\n}\n\nconst hoverStarted = () => { if (props.pauseOnHover) emits('onPause') }\nconst hoverEnded = () => { if (props.pauseOnHover) emits('onResume') }\nconst mouseDown = () => { if (props.pauseOnClick) emits('onPause') }\nconst mouseUp = () => { if (props.pauseOnClick) emits('onResume') }\n\nconst getCurrentStyle = computed(() => {\n return {\n '--loops': `${props.loop === 0 ? 'infinite' : props.loop}`,\n '--duration': `${props.duration}s`,\n '--delay': `${props.delay}s`,\n '--direction': `${props.direction}`,\n '--pauseOnHover': `${props.pauseOnHover ? 'paused' : 'running'}`,\n '--pauseOnClick': `${props.pauseOnClick ? 'paused' : 'running'}`,\n '--pauseAnimation': `${(props.vertical && verticalAnimationPause.value) || props.pause ? 'paused' : 'running'}`,\n '--gradient-color': `rgba(${props.gradientColor}, 1), rgba(${props.gradientColor}, 0)`,\n '--gradient-length': `${gradientLength.value}`,\n '--min-width': `${widthMin.value}`,\n '--min-height': `${heightMin.value}`,\n '--orientation': props.vertical ? 'scrollY' : 'scrollX'\n }\n})\n\nconst setupMarquee = async () => {\n if (props.vertical) {\n heightMin.value = '100%'\n widthMin.value = 'auto'\n } else {\n heightMin.value = 'auto'\n widthMin.value = '100%'\n }\n\n if (props.gradient && props.gradientLength) {\n gradientLength.value = props.gradientLength\n }\n\n if (props.clone) {\n await checkForClone()\n ready.value = true\n } else {\n ready.value = true\n }\n}\n\nonMounted(async () => {\n setupMarquee()\n\n loopInterval.value = setInterval(() => {\n loopCounter.value++\n\n if (props.loop !== 0 && loopCounter.value === props.loop) {\n emits('onComplete')\n clearInterval(loopInterval.value)\n }\n\n emits('onLoopComplete')\n }, props.duration * 1000)\n})\n\nonBeforeUnmount(() => {\n clearInterval(loopInterval.value)\n \n if (resizeObserver.value) {\n resizeObserver.value.disconnect()\n resizeObserver.value = null\n }\n \n if (checkInterval.value) {\n clearInterval(checkInterval.value)\n checkInterval.value = null\n }\n \n if (resizeTimeout.value) {\n clearTimeout(resizeTimeout.value)\n resizeTimeout.value = null\n }\n})\n\n// Removed inefficient watchers - ResizeObserver handles this now\n\nwatch(\n () => props.pause,\n (newVal, oldVal) => {\n if (newVal !== oldVal) {\n if (newVal) {\n emits('onResume')\n } else {\n emits('onPause')\n }\n }\n }\n)\n</script>\n\n<style lang=\"scss\">\n.vue3-marquee {\n display: flex !important;\n position: relative;\n\n .marquee {\n flex: 0 0 auto;\n min-width: var(--min-width);\n min-height: var(--min-height);\n z-index: 1;\n will-change: transform;\n transform: translateZ(0);\n backface-visibility: hidden;\n\n animation: var(--orientation) var(--duration) linear var(--delay) var(--loops);\n animation-play-state: var(--pauseAnimation);\n animation-direction: var(--direction);\n contain: layout style paint;\n }\n\n .overlay {\n position: absolute;\n width: 100%;\n height: 100%;\n\n &:before {\n left: 0;\n top: 0;\n }\n\n &:before, &:after {\n content: '';\n position: absolute;\n z-index: 2;\n }\n }\n\n .transparent-overlay {\n position: absolute;\n width: 100.5%;\n height: 100.5%;\n }\n\n\n &.horizontal {\n overflow-x: hidden !important;\n overflow-y: hidden !important;\n flex-direction: row !important;\n width: 100%;\n height: max-content;\n\n .marquee {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n\n .overlay::before,.overlay::after {\n background: linear-gradient(to right, var(--gradient-color));\n height: 100%;\n width: var(--gradient-length);\n }\n\n .overlay::after {\n transform: rotateZ(180deg);\n right: 0;\n top: 0;\n }\n }\n\n &.vertical {\n overflow-y: hidden !important;\n overflow-x: hidden !important;\n flex-direction: column !important;\n height: 100%;\n width: max-content;\n\n .marquee {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .overlay::before, .overlay::after {\n background: linear-gradient(to bottom, var(--gradient-color));\n height: var(--gradient-length);\n width: 100%;\n }\n\n .overlay::after {\n transform: rotateZ(-180deg);\n left: 0;\n bottom: 0;\n }\n }\n\n &:hover {\n div {\n animation-play-state: var(--pauseOnHover);\n }\n }\n\n &:active {\n div {\n animation-play-state: var(--pauseOnClick);\n } \n }\n}\n\n@keyframes scrollX {\n 0% {\n transform: translate3d(0, 0, 0);\n }\n 100% {\n transform: translate3d(-100%, 0, 0);\n }\n}\n\n@keyframes scr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AAY,UAAU,MAAM,MAAM;AACxD,gBAAM,YAAY;AAClB,wBAAc,aAAa,KAAK;AAAA,QAClC;AAEA,cAAM,gBAAgB;AAAA,MACxB,GAAG,MAAM,WAAW,GAAI;AAAA,IAC1B,CAAC;AAED,oBAAgB,MAAM;AACpB,oBAAc,aAAa,KAAK;AAEhC,UAAI,eAAe,OAAO;AACxB,uBAAe,MAAM,WAAU;AAC/B,uBAAe,QAAQ;AAAA,MACzB;AAEA,UAAI,cAAc,OAAO;AACvB,sBAAc,cAAc,KAAK;AACjC,sBAAc,QAAQ;AAAA,MACxB;AAEA,UAAI,cAAc,OAAO;AACvB,qBAAa,cAAc,KAAK;AAChC,sBAAc,QAAQ;AAAA,MACxB;AAAA,IACF,CAAC;AAID;AAAA,MACE,MAAM,MAAM;AAAA,MACZ,CAAC,QAAQ,WAAW;AAClB,YAAI,WAAW,QAAQ;AACrB,cAAI,QAAQ;AACV,kBAAM,UAAU;AAAA,UAClB,OAAO;AACL,kBAAM,SAAS;AAAA,UACjB;AAAA,QACF;AAAA,MACF;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Marquee.vue.js","sources":["../../../../../src/components/Marquee/Marquee.vue"],"sourcesContent":["<template>\n <div\n v-if=\"ready\"\n class=\"vue3-marquee\"\n :class=\"{ vertical: vertical, horizontal: !vertical }\"\n :style=\"getCurrentStyle\"\n @mouseenter=\"hoverStarted\"\n @mouseleave=\"hoverEnded\"\n @mousedown=\"mouseDown\"\n @mouseup=\"mouseUp\"\n >\n <div\n class=\"transparent-overlay\"\n ref=\"marqueeOverlayContainer\"\n :aria-hidden=\"true\"\n :class=\"{ vertical: vertical, horizontal: !vertical, overlay: gradient }\"\n />\n\n <div \n class=\"marquee\"\n ref=\"marqueeContent\">\n <slot></slot>\n </div>\n\n <div \n class=\"marquee\" \n :aria-hidden=\"true\"\n >\n <slot></slot>\n </div>\n\n <div\n v-for=\"num in cloneAmount\"\n :key=\"num\"\n :aria-hidden=\"true\"\n class=\"marquee cloned\"\n >\n <slot></slot>\n </div\n >\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue'\n\nconst props = defineProps({\n vertical: { type: Boolean, default: false },\n direction: { type: String, default: 'normal' },\n duration: { type: Number, default: 20 },\n delay: { type: Number, default: 0 },\n loop: { type: Number, default: 0 },\n clone: { type: Boolean, default: false },\n gradient: { type: Boolean, default: false },\n gradientColor: { type: [Array,String], default: () => [255, 255, 255] },\n gradientLength: { type: String },\n pauseOnHover: { type: Boolean, default: false },\n pauseOnClick: { type: Boolean, default: false },\n pause: { type: Boolean, default: false }\n})\n\nconst emits = defineEmits(['onComplete', 'onLoopComplete', 'onPause', 'onResume'])\n\nconst ready = ref(false)\n\nconst cloneAmount = ref(0)\nconst loopCounter = ref(0)\nconst loopInterval = ref(null)\nconst resizeObserver = ref(null)\nconst checkInterval = ref(null)\nconst resizeTimeout = ref(null)\nconst previousSize = ref({ width: 0, height: 0 })\n\nconst widthMin = ref('100%')\nconst widthContainer = ref(0)\nconst widthContent = ref(0)\nconst heightMin = ref('100%')\nconst heightContainer = ref(0)\nconst heightContent = ref(0)\n\nconst gradientLength = ref('200px')\n\nconst verticalAnimationPause = ref(false)\nconst marqueeContent = ref(null)\nconst marqueeOverlayContainer = ref(null)\n\n// Removed ForcesUpdate - no longer needed\n\nconst checkForClone = async () => {\n if (props.vertical) {\n verticalAnimationPause.value = true\n }\n\n await nextTick()\n \n const calculateClones = () => {\n widthMin.value = '0%'\n heightMin.value = '0%'\n\n if (marqueeContent.value !== null && marqueeOverlayContainer.value !== null) {\n if (marqueeContent.value && marqueeOverlayContainer.value) {\n if (\n props.vertical &&\n 'clientHeight' in marqueeContent.value &&\n 'clientHeight' in marqueeOverlayContainer.value\n ) {\n heightContent.value = marqueeContent.value.clientHeight\n heightContainer.value = marqueeOverlayContainer.value.clientHeight\n\n const localCloneAmount = Math.ceil(heightContainer.value / heightContent.value)\n\n cloneAmount.value = isFinite(localCloneAmount) ? localCloneAmount : 0\n\n verticalAnimationPause.value = false\n\n return cloneAmount.value\n } else if (\n !props.vertical &&\n 'clientWidth' in marqueeContent.value &&\n 'clientWidth' in marqueeOverlayContainer.value\n ) {\n widthContent.value = marqueeContent.value.clientWidth\n widthContainer.value = marqueeOverlayContainer.value.clientWidth\n\n const localCloneAmount = Math.ceil(widthContainer.value / widthContent.value)\n\n cloneAmount.value = isFinite(localCloneAmount) ? localCloneAmount : 0\n\n return cloneAmount.value\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n } else {\n widthMin.value = '100%'\n heightMin.value = '100%'\n return 0\n }\n }\n \n // Run once immediately\n calculateClones()\n \n // Setup ResizeObserver for efficient resize detection\n if (typeof ResizeObserver !== 'undefined' && marqueeOverlayContainer.value) {\n if (resizeObserver.value) {\n resizeObserver.value.disconnect()\n }\n \n resizeObserver.value = new ResizeObserver((entries) => {\n const entry = entries[0]\n const newWidth = entry.contentRect.width\n const newHeight = entry.contentRect.height\n \n // Only recalculate if size changed significantly (more than 1px)\n const widthChanged = Math.abs(newWidth - previousSize.value.width) > 1\n const heightChanged = Math.abs(newHeight - previousSize.value.height) > 1\n \n if (widthChanged || heightChanged) {\n previousSize.value = { width: newWidth, height: newHeight }\n clearTimeout(resizeTimeout.value)\n resizeTimeout.value = setTimeout(() => {\n calculateClones()\n }, 300)\n }\n })\n \n resizeObserver.value.observe(marqueeOverlayContainer.value)\n } else {\n // Fallback for browsers without ResizeObserver\n // Only check once after a delay for initial setup\n if (checkInterval.value) {\n clearInterval(checkInterval.value)\n }\n \n checkInterval.value = setTimeout(() => {\n calculateClones()\n checkInterval.value = null\n }, 500)\n }\n}\n\nconst hoverStarted = () => { if (props.pauseOnHover) emits('onPause') }\nconst hoverEnded = () => { if (props.pauseOnHover) emits('onResume') }\nconst mouseDown = () => { if (props.pauseOnClick) emits('onPause') }\nconst mouseUp = () => { if (props.pauseOnClick) emits('onResume') }\n\nconst getCurrentStyle = computed(() => {\n return {\n '--loops': `${props.loop === 0 ? 'infinite' : props.loop}`,\n '--duration': `${props.duration}s`,\n '--delay': `${props.delay}s`,\n '--direction': `${props.direction}`,\n '--pauseOnHover': `${props.pauseOnHover ? 'paused' : 'running'}`,\n '--pauseOnClick': `${props.pauseOnClick ? 'paused' : 'running'}`,\n '--pauseAnimation': `${(props.vertical && verticalAnimationPause.value) || props.pause ? 'paused' : 'running'}`,\n '--gradient-color': props.gradientColor,\n '--gradient-length': `${gradientLength.value}`,\n '--min-width': `${widthMin.value}`,\n '--min-height': `${heightMin.value}`,\n '--orientation': props.vertical ? 'scrollY' : 'scrollX'\n }\n})\n\nconst setupMarquee = async () => {\n if (props.vertical) {\n heightMin.value = '100%'\n widthMin.value = 'auto'\n } else {\n heightMin.value = 'auto'\n widthMin.value = '100%'\n }\n\n if (props.gradient && props.gradientLength) {\n gradientLength.value = props.gradientLength\n }\n\n if (props.clone) {\n await checkForClone()\n ready.value = true\n } else {\n ready.value = true\n }\n}\n\nonMounted(async () => {\n setupMarquee()\n\n loopInterval.value = setInterval(() => {\n loopCounter.value++\n\n if (props.loop !== 0 && loopCounter.value === props.loop) {\n emits('onComplete')\n clearInterval(loopInterval.value)\n }\n\n emits('onLoopComplete')\n }, props.duration * 1000)\n})\n\nonBeforeUnmount(() => {\n clearInterval(loopInterval.value)\n \n if (resizeObserver.value) {\n resizeObserver.value.disconnect()\n resizeObserver.value = null\n }\n \n if (checkInterval.value) {\n clearInterval(checkInterval.value)\n checkInterval.value = null\n }\n \n if (resizeTimeout.value) {\n clearTimeout(resizeTimeout.value)\n resizeTimeout.value = null\n }\n})\n\n// Removed inefficient watchers - ResizeObserver handles this now\n\nwatch(\n () => props.pause,\n (newVal, oldVal) => {\n if (newVal !== oldVal) {\n if (newVal) {\n emits('onPause')\n } else {\n emits('onResume')\n }\n }\n }\n)\n</script>\n\n<style lang=\"scss\">\n.vue3-marquee {\n display: flex !important;\n position: relative;\n will-change: transform;\n transform: translateZ(0);\n backface-visibility: hidden;\n\n .marquee {\n flex: 0 0 auto;\n min-width: var(--min-width);\n min-height: var(--min-height);\n z-index: 1;\n\n animation: var(--orientation) var(--duration) linear var(--delay) var(--loops);\n animation-play-state: var(--pauseAnimation);\n animation-direction: var(--direction);\n }\n\n .overlay {\n position: absolute;\n width: 100%;\n height: 100%;\n\n &:before {\n left: 0;\n top: 0;\n }\n\n &:before, &:after {\n content: '';\n position: absolute;\n z-index: 2;\n }\n }\n\n .transparent-overlay {\n position: absolute;\n width: 100.5%;\n height: 100.5%;\n }\n\n\n &.horizontal {\n overflow-x: hidden !important;\n overflow-y: hidden !important;\n flex-direction: row !important;\n width: 100%;\n height: max-content;\n\n .marquee {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n\n .overlay::before,.overlay::after {\n background: linear-gradient(to right, var(--gradient-color), transparent);\n height: 100%;\n width: var(--gradient-length);\n }\n\n .overlay::after {\n transform: rotateZ(180deg);\n right: 0;\n top: 0;\n }\n }\n\n &.vertical {\n overflow-y: hidden !important;\n overflow-x: hidden !important;\n flex-direction: column !important;\n height: 100%;\n width: max-content;\n\n .marquee {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .overlay::before, .overlay::after {\n background: linear-gradient(to bottom, var(--gradient-color), transparent);\n height: var(--gradient-length);\n width: 100%;\n }\n\n .overlay::after {\n transform: rotateZ(-180deg);\n left: 0;\n bottom: 0;\n }\n }\n\n &:hover {\n div {\n animation-play-state: var(--pauseOnHover);\n }\n }\n\n &:active {\n div {\n animation-play-state: var(--pauseOnClick);\n } \n }\n}\n\n@keyframes scrollX {\n 0% {\n transform: translate3d(0, 0, 0);\n }\n 100% {\n transform: translate3d(-100%, 0, 0);\n }\n}\n\n@keyframes scrollY {\n 0% {\n transform: translate3d(0, 0, 0);\n }\n 100% {\n transform: translate3d(0, -100%, 0);\n }\n}\n</style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