@ozdao/martyrs 0.2.582 → 0.2.584
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/{main-vq1_XpmQ.js → main-fmp55tJF.js} +11 -11
- package/dist/martyrs/dist/{main-vq1_XpmQ.js → main-fmp55tJF.js} +2 -2
- package/dist/martyrs/dist/main-fmp55tJF.js.map +1 -0
- package/dist/martyrs/dist/{web-BNJDRie_.js → web-BDuQSQKS.js} +2 -2
- package/dist/martyrs/dist/{web-BNJDRie_.js.map → web-BDuQSQKS.js.map} +1 -1
- package/dist/martyrs/src/components/Button/{Button.vue.js → Button.vue2.js} +2 -2
- package/dist/martyrs/src/components/Button/Button.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Calendar/Calendar.vue2.js +5 -5
- package/dist/martyrs/src/components/Calendar/Calendar.vue2.js.map +1 -1
- package/dist/martyrs/src/components/EditImages/{EditImages.vue.js → EditImages.vue2.js} +2 -2
- package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
- package/dist/martyrs/src/components/Field/Field.vue.js +2 -2
- package/dist/martyrs/src/components/Field/Field.vue.js.map +1 -1
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +2 -2
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js.map +1 -1
- package/dist/martyrs/src/components/FieldDate/FieldDate.vue.js +2 -2
- package/dist/martyrs/src/components/FieldDate/FieldDate.vue.js.map +1 -1
- package/dist/martyrs/src/components/Select/{Select.vue2.js → Select.vue.js} +2 -2
- package/dist/martyrs/src/components/Select/Select.vue.js.map +1 -0
- package/dist/martyrs/src/components/Spoiler/{Spoiler.vue.js → Spoiler.vue2.js} +2 -2
- package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +1 -0
- 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.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +7 -13
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +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.js +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.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/UserDashboard.vue.js +182 -89
- package/dist/martyrs/src/modules/auth/views/components/pages/UserDashboard.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/configs/navigation.user.config.js +9 -2
- package/dist/martyrs/src/modules/auth/views/configs/navigation.user.config.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js +3 -3
- package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js.map +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.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +2 -2
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupAuth.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +3 -3
- package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/Sidebar.vue.js +2 -2
- package/dist/martyrs/src/modules/core/views/components/partials/Sidebar.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue.js → Filters.vue2.js} +5 -5
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +1 -0
- package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js.map +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.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +3 -3
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js.map +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +4 -4
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js.map +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +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.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/pages/Inventory.vue.js +4 -4
- package/dist/martyrs/src/modules/inventory/components/pages/Inventory.vue.js.map +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/blocks/ActionButtons.vue.js +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.js +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.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +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.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +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.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +6 -6
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js.map +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.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/PlayerControls.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +1 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js +3 -3
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js +90 -175
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +8 -8
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js.map +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.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +41 -28
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js.map +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.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/orders.client.js +14 -14
- package/dist/martyrs/src/modules/orders/orders.client.js.map +1 -1
- package/dist/martyrs/src/modules/orders/router/orders.router.js +23 -0
- package/dist/martyrs/src/modules/orders/router/orders.router.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js.map +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.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +89 -40
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js.map +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.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +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.js +3 -3
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +2 -2
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js.map +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.js +3 -3
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +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.js +3 -3
- package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js.map +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.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +2 -2
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +3 -3
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js.map +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/style.css +105 -110
- package/dist/{web-BNJDRie_.js → web-BDuQSQKS.js} +1 -1
- package/package.json +1 -1
- package/src/components/Calendar/Calendar.vue +4 -4
- package/src/components/Completion/Completion.vue +3 -3
- package/src/components/Field/Field.vue +1 -1
- package/src/components/FieldBig/FieldBig.vue +1 -1
- package/src/components/FieldDate/FieldDate.vue +1 -1
- package/src/modules/TASKS.MD +26 -1
- package/src/modules/auth/views/components/pages/Profile.vue +9 -15
- package/src/modules/auth/views/components/pages/UserDashboard.vue +214 -125
- package/src/modules/auth/views/configs/navigation.user.config.js +8 -2
- package/src/modules/community/components/layouts/Community.vue +2 -2
- package/src/modules/core/views/components/blocks/CardHeader.vue +1 -1
- package/src/modules/core/views/components/partials/Header.vue +1 -1
- package/src/modules/core/views/components/partials/Sidebar.vue +1 -1
- package/src/modules/core/views/components/sections/Filters.vue +2 -2
- package/src/modules/core/views/components/sections/SectionPageTitle.vue +1 -1
- package/src/modules/events/components/pages/EditEventTickets.vue +2 -2
- package/src/modules/gallery/components/sections/BackofficeGallery.vue +1 -1
- package/src/modules/inventory/components/pages/Inventory.vue +4 -4
- package/src/modules/inventory/components/pages/InventoryEdit.vue +1 -1
- package/src/modules/music/components/pages/Playlist.vue +5 -5
- package/src/modules/notifications/components/elements/NotificationBadge.vue +1 -1
- package/src/modules/orders/components/blocks/CardOrderUser.vue +88 -190
- package/src/modules/orders/components/pages/OrderBackoffice.vue +5 -5
- package/src/modules/orders/components/pages/Orders.vue +56 -50
- package/src/modules/orders/router/orders.router.js +33 -0
- package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
- package/src/modules/organizations/components/pages/OrganizationEdit.vue +42 -11
- package/src/modules/pages/views/components/pages/PageEdit.vue +2 -2
- package/src/modules/pages/views/components/partials/SidebarPages.vue +1 -1
- package/src/modules/products/components/pages/Products.vue +1 -1
- package/src/modules/products/components/sections/EditDiscounts.vue +1 -1
- package/src/modules/products/components/sections/ProductConfigurator.vue +1 -1
- package/src/modules/spots/components/pages/Spots.vue +1 -1
- package/src/modules/wallet/views/components/blocks/CryptoDeposit.vue +1 -1
- package/src/modules/wallet/views/components/pages/Wallet.vue +1 -1
- package/dist/martyrs/dist/main-vq1_XpmQ.js.map +0 -1
- package/dist/martyrs/src/components/Button/Button.vue.js.map +0 -1
- package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +0 -1
- package/dist/martyrs/src/components/Select/Select.vue2.js.map +0 -1
- package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue2.js +0 -625
- package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +0 -1
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +0 -1
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusCanceled.vue.js +0 -32
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusCanceled.vue.js.map +0 -1
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusConfirmed.vue.js +0 -32
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusConfirmed.vue.js.map +0 -1
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusCreated.vue.js +0 -32
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusCreated.vue.js.map +0 -1
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusDelay.vue.js +0 -32
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusDelay.vue.js.map +0 -1
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusFinished.vue.js +0 -32
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusFinished.vue.js.map +0 -1
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusInUse.vue.js +0 -32
- package/dist/martyrs/src/modules/orders/components/icons/IconStatusInUse.vue.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.vue.js","sources":["../../../../../src/components/Button/Button.vue"],"sourcesContent":["<script setup>\nimport { ref } from 'vue'\n\nimport Loader from '@martyrs/src/components/Loader/Loader.vue'\n\nimport IconCheckmark from '@martyrs/src/modules/icons/navigation/IconCheckmark.vue';\nimport IconCross from '@martyrs/src/modules/icons/navigation/IconCross.vue';\n\nconst props = defineProps({\n submit: {\n type: Function,\n default: async () => { console.log('Button click.') }\n },\n text: {\n type: Object,\n default: () => ({\n success: null,\n error: null\n })\n },\n counter: {\n type: Object\n },\n callback: {\n type: Function,\n default: async () => { console.log('Button callback.') }\n },\n callbackDelay: {\n type: Number,\n default: 750\n },\n showSucces: {\n type: Boolean,\n default: true\n },\n showLoader: {\n type: Boolean,\n default: true\n },\n validation: {\n type: Boolean,\n default: false\n },\n})\n\nconst emits = defineEmits(['error'])\n\nconst button = ref(null)\nconst error = ref(null)\nconst loading = ref(false)\nconst finished = ref(false)\n\nasync function Submit() {\n console.log('click')\n \n button.value.style['pointer-events'] = 'none'\n error.value = null\n loading.value = true\n\n // Функция для сброса состояния кнопки\n const resetButton = () => {\n if (button.value) {\n button.value.style.pointerEvents = 'auto'\n loading.value = false\n finished.value = false\n error.value = null\n }\n }\n\n try {\n await props.submit()\n\n button.value.classList.replace('bg-main', 'bg-second')\n loading.value = false\n\n // Используем функцию сброса состояния кнопки здесь\n if (props.showSucces) { \n finished.value = true\n setTimeout(() => {\n resetButton()\n button.value.classList.replace('bg-second', 'bg-main')\n }, 500)\n } else {\n resetButton()\n button.value.classList.replace('bg-second', 'bg-main')\n }\n\n // Если есть callback, мы также установим таймер для его вызова\n if (props.callback) setTimeout(() => props.callback(), props.callbackDelay)\n\n } catch (err) {\n console.error('=== BUTTON ERROR ===', err)\n emits('error', err)\n // Если возникла ошибка, мы изменяем стили и устанавливаем сообщение об ошибке\n button.value.classList.replace('bg-main', 'bg-fourth-nano')\n loading.value = false\n error.value = true\n \n // После задержки снова сбрасываем состояние кнопки\n setTimeout(() => {\n resetButton()\n // Так как класс кнопки был изменен, вернем его в исходное состояние\n button.value.classList.replace('bg-fourth-nano', 'bg-main')\n }, 1330)\n }\n}\n</script>\n\n<template>\n <button \n @click.stop=\"Submit\"\n :disabled=\"validation\"\n ref=\"button\"\n\t\tclass=\"button\"\n :class=\"{ 'button--disabled': loading || validation }\"\n >\n <span class=\"button-content\" :class=\"{ 'hidden': loading || error || finished }\">\n <slot></slot>\n </span>\n\n <span class=\"button-loader\" :class=\"{ 'active': loading && showLoader }\">\n <Loader class=\"\"/>\n </span>\n\n <span class=\"button-success\" :class=\"{ 'active': finished && showSucces }\">\n <template v-if=\"text.success\">{{ text.success }}</template>\n <IconCheckmark v-else class=\"i-regular\" />\n </span>\n\n <span class=\"button-error\" :class=\"{ 'active': error }\">\n <template v-if=\"text.error\">{{ text.error }}</template>\n <IconCross v-else class=\"i-regular\" />\n </span>\n \n <!-- Counter -->\n <div v-if=\"counter\" class=\"button-counter font-second flex flex-center\">\n <span>{{ counter }}</span>\n </div>\n </button>\n</template>\n\n<style lang=\"scss\">\nbutton[disabled] {\n opacity: 0.75 !important;\n pointer-events: none !important;\n cursor: default !important;\n color: rgba(var(--dark), 0.33) !important;\n background: rgba(var(--light), 1) !important;\n}\n\na.button {\n text-box: trim-both cap alphabetic;\n}\n\n.button {\n position: relative;\n display: flex;\n padding: var(--small);\n border-radius: var(--small);\n text-box: trim-both cap alphabetic;\n transform: scale(1);\n opacity: 1;\n align-items: center;\n justify-content: center;\n color: black;\n text-align: center;\n font-size: 1rem;\n letter-spacing: 5%;\n transition: all 0.33s ease;\n\n &:hover {\n cursor: pointer;\n opacity: 0.9;\n }\n\n &:active {\n transform: scale(0.95);\n }\n\n &-small {\n padding: 0.75rem;\n border-radius: 0.5rem;\n height: fit-content;\n }\n\n .button-counter {\n position: absolute;\n right: -8px;\n bottom: -8px;\n background: yellow;\n height: 16px;\n border-radius: 16px;\n width: 16px;\n font-weight: 500;\n text-align: center;\n line-height: 16px;\n font-size: 10px;\n }\n}\n\n.button-content {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n transition: opacity 0.3s ease;\n}\n\n\n.button-loader {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s ease;\n pointer-events: none;\n}\n\n.button-success {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s ease;\n pointer-events: none;\n}\n\n.button-error {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s ease;\n pointer-events: none;\n}\n\n.active {\n opacity: 1;\n}\n\n.hidden {\n opacity: 0;\n}\n</style>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,UAAM,QAAQ;AAqCd,UAAM,QAAQ;AAEd,UAAM,SAAS,IAAI,IAAI;AACvB,UAAM,QAAQ,IAAI,IAAI;AACtB,UAAM,UAAU,IAAI,KAAK;AACzB,UAAM,WAAW,IAAI,KAAK;AAE1B,mBAAe,SAAS;AACtB,cAAQ,IAAI,OAAO;AAEnB,aAAO,MAAM,MAAM,gBAAgB,IAAI;AACvC,YAAM,QAAQ;AACd,cAAQ,QAAQ;AAGhB,YAAM,cAAc,MAAM;AACxB,YAAI,OAAO,OAAO;AAChB,iBAAO,MAAM,MAAM,gBAAgB;AACnC,kBAAQ,QAAQ;AAChB,mBAAS,QAAQ;AACjB,gBAAM,QAAQ;AAAA,QAChB;AAAA,MACF;AAEA,UAAI;AACF,cAAM,MAAM,OAAM;AAElB,eAAO,MAAM,UAAU,QAAQ,WAAW,WAAW;AACrD,gBAAQ,QAAQ;AAGhB,YAAI,MAAM,YAAY;AACpB,mBAAS,QAAQ;AACjB,qBAAW,MAAM;AACf,wBAAW;AACX,mBAAO,MAAM,UAAU,QAAQ,aAAa,SAAS;AAAA,UACvD,GAAG,GAAG;AAAA,QACR,OAAO;AACL,sBAAW;AACX,iBAAO,MAAM,UAAU,QAAQ,aAAa,SAAS;AAAA,QACvD;AAGA,YAAI,MAAM,SAAU,YAAW,MAAM,MAAM,SAAQ,GAAI,MAAM,aAAa;AAAA,MAE5E,SAAS,KAAK;AACZ,gBAAQ,MAAM,wBAAwB,GAAG;AACzC,cAAM,SAAS,GAAG;AAElB,eAAO,MAAM,UAAU,QAAQ,WAAW,gBAAgB;AAC1D,gBAAQ,QAAQ;AAChB,cAAM,QAAQ;AAGd,mBAAW,MAAM;AACf,sBAAW;AAEX,iBAAO,MAAM,UAAU,QAAQ,kBAAkB,SAAS;AAAA,QAC5D,GAAG,IAAI;AAAA,MACT;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditImages.vue.js","sources":["../../../../../src/components/EditImages/EditImages.vue"],"sourcesContent":["<template>\n\t<div class=\"flex-nowrap flex gap-small\">\n <VueDraggableNext v-if=\"localImages.length > 0\" class=\"gap-small flex dragArea list-group w-full\" v-model=\"localImages\" @change=\"emitChanges\">\n\t\t\t<div v-for=\"(image, index) in localImages\" class=\"pos-relative\">\n\t\t\t\t<img loading=\"lazy\" class=\"i-extra object-fit-contain bg-black-transp-5 pd-nano radius-small o-hidden\" :src=\"(FILE_SERVER_URL || '') + image\" />\n\t\t\t\t\n <IconCross \n @click=\"deleteImage(index)\" \n class=\"cursor-pointer pos-absolute t-center flex-center flex radius-extra i-medium bg-red pos-t-10-negative pos-r-10-negative pd-micro\"\n />\n\t\t\t</div>\n\t\t</VueDraggableNext>\n <div\n v-if=\"localImages.length > 0\" \n class=\"i-extra uppercase flex-center flex radius-small o-hidden br-main br-2px pd-small\"\n >\n <UploadImageMultiple \n @update:images=\"onImagesUpdate\"\n text=\"Add\"\n :options=\"{\n showText: false\n }\"\n :uploadPath=\"'photos'\"\n class=\"radius-big\"\n />\n </div>\n\n\n\t\t<UploadImageMultiple \t\n v-if=\"localImages.length < 1\" \n @update:images=\"onImagesUpdate\"\n :uploadPath=\"props.uploadPath\"\n :text=\"props.text\"\n :options=\"props.options\"\n class=\"w-100 pd-medium\"\n />\n\t</div>\t\n</template>\n\n<script setup>\nimport { ref, defineProps, watchEffect } from 'vue';\nimport { VueDraggableNext } from 'vue-draggable-next'\nimport UploadImageMultiple from \"@martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue\";\nimport IconCross from '@martyrs/src/modules/icons/navigation/IconCross.vue';\n\nconst props = defineProps({\n images: Array,\n text: Object,\n options: Object,\n uploadPath: {\n type: Object,\n default: 'unsorted'\n }\n});\n\nconst emit = defineEmits(['update:images'])\n\nconst localImages = ref([...props.images])\n\nwatchEffect(() => {\n localImages.value = [...props.images]; // Обновление localImages при изменении props.images\n});\n\nconst emitChanges = () => {\n emit('update:images', localImages.value)\n}\n\nconst onImagesUpdate = (newImages) => {\n localImages.value = [...localImages.value, ...newImages]\n emitChanges()\n}\n\nconst deleteImage = (index) => {\n localImages.value.splice(index, 1)\n emitChanges()\n}\n</script>\n\n<style lang=\"scss\">\n// Your styles here\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,UAAM,QAAQ;AAUd,UAAM,OAAO;AAEb,UAAM,cAAc,IAAI,CAAC,GAAG,MAAM,MAAM,CAAC;AAEzC,gBAAY,MAAM;AAChB,kBAAY,QAAQ,CAAC,GAAG,MAAM,MAAM;AAAA,IACtC,CAAC;AAED,UAAM,cAAc,MAAM;AACxB,WAAK,iBAAiB,YAAY,KAAK;AAAA,IACzC;AAEA,UAAM,iBAAiB,CAAC,cAAc;AACpC,kBAAY,QAAQ,CAAC,GAAG,YAAY,OAAO,GAAG,SAAS;AACvD,kBAAW;AAAA,IACb;AAEA,UAAM,cAAc,CAAC,UAAU;AAC7B,kBAAY,MAAM,OAAO,OAAO,CAAC;AACjC,kBAAW;AAAA,IACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.vue2.js","sources":["../../../../../src/components/Select/Select.vue"],"sourcesContent":["<template>\n <!-- Input Wrapper -->\n <div \n ref=\"fieldWrapper\"\n tabindex=\"0\"\n @click.stop=\"toggleMenu\" \n v-click-outside=\"clickedOutside\" \n :class=\"$attrs.class\" \n class=\"cursor-pointer field-wrapper flex-v-center flex-nowrap flex pos-relative\"\n >\n <!-- Label -->\n <span v-if=\"label\" class=\"t-transp mn-r-small\">{{label}}</span>\n \n <!-- Input -->\n <span>\n {{ optionsSelected ? (optionsSelected.name || optionsSelected[props.value] || optionsSelected) : placeholder }}\n </span>\n <!-- Dropdown menu -->\n <transition mode=\"out-in\" name=\"TransitionTranslateY\">\n <ul \n v-show=\"showMenu\" \n class=\"bs-black pos-absolute pos-t-100 pos-l-0 z-index-5 pd-small radius-small bg-white mn-t-thin w-100\"\n style=\"min-width: max-content;\"\n >\n <li @click.stop=\"selectOption(option)\" v-for=\"option in optionsListed\" class=\"radius-thin hover:bg-light pd-thin text-box-trim\">\n <span v-if=\"option\" class=\"w-100\">\n {{ option.name || option[props.value] || option }}\n </span>\n </li>\n </ul>\n </transition>\n </div>\n <!-- Validation -->\n <transition mode=\"out-in\" name=\"fade\">\n <div v-if=\"validation\" class=\"mn-t-thin invalid-feedback\">\n * {{validation.message}}\n </div>\n </transition>\n</template>\n<script setup>\nimport { ref, computed, watch, nextTick } from 'vue'\nimport clickOutside from '../FieldPhone/click-outside.js';\nlet vClickOutside = clickOutside\nconst emit = defineEmits([\n 'update:select', \n 'focus', \n 'blur'\n])\nconst props = defineProps({\n label: String,\n placeholder: { type: String, default: 'Please select an item' },\n select: [String, Object],\n property: String,\n value: String,\n options: { type: Array, default: () => [] },\n validation: Boolean,\n})\nconst showMenu = ref(false)\nconst fieldWrapper = ref(null)\nconst optionsSelected = ref(\n props.property \n ? findObjectByValue(props.select, props.property, props.options) \n : props.select\n)\nconst optionsListed = computed(() => {\n return props.select \n ? props.options.filter(option => option !== props.select) \n : props.options\n})\nwatch(() => props.select, (newSelect) => {\n optionsSelected.value = \n props.property \n ? findObjectByValue(props.select, props.property, props.options) \n : props.select;\n});\nconst toggleMenu = async () => {\n showMenu.value = !showMenu.value\n \n if (showMenu.value) {\n await nextTick()\n fieldWrapper.value?.focus()\n emit('focus')\n } else {\n emit('blur')\n }\n}\nfunction clickedOutside () {\n showMenu.value = false\n}\nconst selectOption = option => {\n optionsSelected.value = option\n \n toggleMenu()\n if (props.property) { \n emit('update:select', optionsSelected.value[props.property])\n } else {\n emit('update:select', optionsSelected.value)\n }\n}\nfunction findObjectByValue (value, property, objects) {\n for (const object of objects) {\n if (object[property] === value || object === value) {\n return object;\n }\n }\n return null;\n}\n</script>\n<style lang=\"scss\" scoped>\n li {\n list-style-type: none;\n }\n ul li {\n line-height: 2;\n }\n .field-wrapper:focus {\n outline: none;\n }\n</style>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,QAAI,gBAAgB;AACpB,UAAM,OAAO;AAKb,UAAM,QAAQ;AASd,UAAM,WAAW,IAAI,KAAK;AAC1B,UAAM,eAAe,IAAI,IAAI;AAC7B,UAAM,kBAAkB;AAAA,MACtB,MAAM,WACJ,kBAAkB,MAAM,QAAQ,MAAM,UAAU,MAAM,OAAO,IAC7D,MAAM;AAAA,IACV;AACA,UAAM,gBAAgB,SAAS,MAAM;AACnC,aAAO,MAAM,SACX,MAAM,QAAQ,OAAO,YAAU,WAAW,MAAM,MAAM,IACtD,MAAM;AAAA,IACV,CAAC;AACD,UAAM,MAAM,MAAM,QAAQ,CAAC,cAAc;AACvC,sBAAgB,QAChB,MAAM,WACJ,kBAAkB,MAAM,QAAQ,MAAM,UAAU,MAAM,OAAO,IAC7D,MAAM;AAAA,IACV,CAAC;AACD,UAAM,aAAa,YAAY;AAC7B,eAAS,QAAQ,CAAC,SAAS;AAE3B,UAAI,SAAS,OAAO;AAClB,cAAM,SAAQ;AACd,qBAAa,OAAO,MAAK;AACzB,aAAK,OAAO;AAAA,MACd,OAAO;AACL,aAAK,MAAM;AAAA,MACb;AAAA,IACF;AACA,aAAS,iBAAkB;AACzB,eAAS,QAAQ;AAAA,IACnB;AACA,UAAM,eAAe,YAAU;AAC7B,sBAAgB,QAAQ;AAExB,iBAAU;AACV,UAAI,MAAM,UAAU;AAClB,aAAK,iBAAiB,gBAAgB,MAAM,MAAM,QAAQ,CAAC;AAAA,MAC7D,OAAO;AACL,aAAK,iBAAiB,gBAAgB,KAAK;AAAA,MAC7C;AAAA,IACF;AACA,aAAS,kBAAmB,OAAO,UAAU,SAAS;AACpD,iBAAW,UAAU,SAAS;AAC5B,YAAI,OAAO,QAAQ,MAAM,SAAS,WAAW,OAAO;AAClD,iBAAO;AAAA,QACT;AAAA,MACF;AACA,aAAO;AAAA,IACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,625 +0,0 @@
|
|
|
1
|
-
import { ref, computed, watch, onMounted, createElementBlock, openBlock, withKeys, normalizeClass, withModifiers, renderSlot, createElementVNode, createVNode, createCommentVNode, withDirectives, Fragment, renderList, toDisplayString, vShow, Transition, withCtx, normalizeStyle, createTextVNode, nextTick } from "vue";
|
|
2
|
-
/* empty css */
|
|
3
|
-
const _hoisted_1 = ["tabindex", "onKeydown", "onKeypress", "aria-owns"];
|
|
4
|
-
const _hoisted_2 = { class: "multiselect__tags-wrap" };
|
|
5
|
-
const _hoisted_3 = { class: "multiselect__tag" };
|
|
6
|
-
const _hoisted_4 = ["textContent"];
|
|
7
|
-
const _hoisted_5 = ["onKeypress", "onMousedown"];
|
|
8
|
-
const _hoisted_6 = ["textContent"];
|
|
9
|
-
const _hoisted_7 = { class: "multiselect__spinner" };
|
|
10
|
-
const _hoisted_8 = ["name", "id", "placeholder", "value", "disabled", "tabindex", "onKeydown", "onKeypress", "aria-controls"];
|
|
11
|
-
const _hoisted_9 = ["id"];
|
|
12
|
-
const _hoisted_10 = { key: 0 };
|
|
13
|
-
const _hoisted_11 = { class: "multiselect__option" };
|
|
14
|
-
const _hoisted_12 = ["id", "role"];
|
|
15
|
-
const _hoisted_13 = ["onClick", "onMouseenter", "data-select", "data-selected", "data-deselect"];
|
|
16
|
-
const _hoisted_14 = ["data-select", "data-deselect", "onMouseenter", "onMousedown"];
|
|
17
|
-
const _hoisted_15 = { class: "multiselect__option" };
|
|
18
|
-
const _hoisted_16 = { class: "multiselect__option" };
|
|
19
|
-
const _sfc_main = {
|
|
20
|
-
__name: "SelectMulti",
|
|
21
|
-
props: {
|
|
22
|
-
modelValue: { type: null, default: () => [] },
|
|
23
|
-
options: { type: Array, required: true },
|
|
24
|
-
multiple: { type: Boolean, default: false },
|
|
25
|
-
trackBy: String,
|
|
26
|
-
label: String,
|
|
27
|
-
searchable: { type: Boolean, default: true },
|
|
28
|
-
clearOnSelect: { type: Boolean, default: true },
|
|
29
|
-
hideSelected: { type: Boolean, default: false },
|
|
30
|
-
placeholder: { type: String, default: "Select option" },
|
|
31
|
-
allowEmpty: { type: Boolean, default: true },
|
|
32
|
-
resetAfter: { type: Boolean, default: false },
|
|
33
|
-
closeOnSelect: { type: Boolean, default: true },
|
|
34
|
-
customLabel: {
|
|
35
|
-
type: Function,
|
|
36
|
-
default: (option, label) => {
|
|
37
|
-
if (!option && option !== 0) return "";
|
|
38
|
-
return label ? option[label] : option;
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
taggable: { type: Boolean, default: false },
|
|
42
|
-
tagPlaceholder: { type: String, default: "Press enter to create a tag" },
|
|
43
|
-
tagPosition: { type: String, default: "top" },
|
|
44
|
-
max: { type: [Number, Boolean], default: false },
|
|
45
|
-
id: { default: null },
|
|
46
|
-
optionsLimit: { type: Number, default: 1e3 },
|
|
47
|
-
groupValues: String,
|
|
48
|
-
groupLabel: String,
|
|
49
|
-
groupSelect: { type: Boolean, default: false },
|
|
50
|
-
blockKeys: { type: Array, default: () => [] },
|
|
51
|
-
preserveSearch: { type: Boolean, default: false },
|
|
52
|
-
preselectFirst: { type: Boolean, default: false },
|
|
53
|
-
preventAutofocus: { type: Boolean, default: false },
|
|
54
|
-
internalSearch: { type: Boolean, default: true },
|
|
55
|
-
name: { type: String, default: "" },
|
|
56
|
-
selectLabel: { type: String, default: "Press enter to select" },
|
|
57
|
-
selectGroupLabel: { type: String, default: "Press enter to select group" },
|
|
58
|
-
selectedLabel: { type: String, default: "Selected" },
|
|
59
|
-
deselectLabel: { type: String, default: "Press enter to remove" },
|
|
60
|
-
deselectGroupLabel: { type: String, default: "Press enter to deselect group" },
|
|
61
|
-
showLabels: { type: Boolean, default: true },
|
|
62
|
-
limit: { type: Number, default: 99999 },
|
|
63
|
-
maxHeight: { type: Number, default: 300 },
|
|
64
|
-
limitText: { type: Function, default: (count) => `and ${count} more` },
|
|
65
|
-
loading: { type: Boolean, default: false },
|
|
66
|
-
disabled: { type: Boolean, default: false },
|
|
67
|
-
openDirection: { type: String, default: "" },
|
|
68
|
-
showNoOptions: { type: Boolean, default: true },
|
|
69
|
-
showNoResults: { type: Boolean, default: true },
|
|
70
|
-
tabindex: { type: Number, default: 0 },
|
|
71
|
-
showPointer: { type: Boolean, default: true },
|
|
72
|
-
optionHeight: { type: Number, default: 40 }
|
|
73
|
-
},
|
|
74
|
-
emits: ["open", "search-change", "close", "select", "update:modelValue", "remove", "tag"],
|
|
75
|
-
setup(__props, { emit: __emit }) {
|
|
76
|
-
const props = __props;
|
|
77
|
-
const emit = __emit;
|
|
78
|
-
const multiselect = ref(null);
|
|
79
|
-
const searchInput = ref(null);
|
|
80
|
-
const list = ref(null);
|
|
81
|
-
const tags = ref(null);
|
|
82
|
-
const search = ref("");
|
|
83
|
-
const isOpen = ref(false);
|
|
84
|
-
const preferredOpenDirection = ref("below");
|
|
85
|
-
const optimizedHeight = ref(props.maxHeight);
|
|
86
|
-
const pointer = ref(0);
|
|
87
|
-
const pointerDirty = ref(false);
|
|
88
|
-
const isEmpty = (opt) => {
|
|
89
|
-
if (opt === 0) return false;
|
|
90
|
-
if (Array.isArray(opt) && opt.length === 0) return true;
|
|
91
|
-
return !opt;
|
|
92
|
-
};
|
|
93
|
-
const includes = (str, query) => {
|
|
94
|
-
if (str === void 0) str = "undefined";
|
|
95
|
-
if (str === null) str = "null";
|
|
96
|
-
if (str === false) str = "false";
|
|
97
|
-
return str.toString().toLowerCase().indexOf(query.trim()) !== -1;
|
|
98
|
-
};
|
|
99
|
-
const filterOptions = (options, search2, label, customLabel) => {
|
|
100
|
-
return search2 ? options.filter((option) => includes(customLabel(option, label), search2)).sort((a, b) => customLabel(a, label).length - customLabel(b, label).length) : options;
|
|
101
|
-
};
|
|
102
|
-
const flattenOptions = (values, label) => (options) => options.reduce((prev, curr) => {
|
|
103
|
-
if (curr[values]?.length) {
|
|
104
|
-
prev.push({ $groupLabel: curr[label], $isLabel: true });
|
|
105
|
-
return prev.concat(curr[values]);
|
|
106
|
-
}
|
|
107
|
-
return prev;
|
|
108
|
-
}, []);
|
|
109
|
-
const stripGroups = (options) => options.filter((option) => !option.$isLabel);
|
|
110
|
-
const filterGroups = (search2, label, values, groupLabel, customLabel) => (groups) => groups.map((group) => {
|
|
111
|
-
if (!group[values]) {
|
|
112
|
-
console.warn(`Options passed to vue-multiselect do not contain groups, despite the config.`);
|
|
113
|
-
return [];
|
|
114
|
-
}
|
|
115
|
-
const groupOptions = filterOptions(group[values], search2, label, customLabel);
|
|
116
|
-
return groupOptions.length ? { [groupLabel]: group[groupLabel], [values]: groupOptions } : [];
|
|
117
|
-
});
|
|
118
|
-
const flow = (...fns) => (x) => fns.reduce((v, f) => f(v), x);
|
|
119
|
-
const internalValue = computed(() => {
|
|
120
|
-
const val = props.modelValue;
|
|
121
|
-
return val || val === 0 ? Array.isArray(val) ? val : [val] : [];
|
|
122
|
-
});
|
|
123
|
-
const filteredOptions = computed(() => {
|
|
124
|
-
const searchVal = search.value || "";
|
|
125
|
-
const normalizedSearch = searchVal.toLowerCase().trim();
|
|
126
|
-
let options = props.options.concat();
|
|
127
|
-
if (props.internalSearch) {
|
|
128
|
-
options = props.groupValues ? filterAndFlat(options, normalizedSearch, props.label) : filterOptions(options, normalizedSearch, props.label, props.customLabel);
|
|
129
|
-
} else {
|
|
130
|
-
options = props.groupValues ? flattenOptions(props.groupValues, props.groupLabel)(options) : options;
|
|
131
|
-
}
|
|
132
|
-
options = props.hideSelected ? options.filter((o) => !isSelected(o)) : options;
|
|
133
|
-
if (props.taggable && normalizedSearch.length && !isExistingOption(normalizedSearch)) {
|
|
134
|
-
if (props.tagPosition === "bottom") {
|
|
135
|
-
options.push({ isTag: true, label: searchVal });
|
|
136
|
-
} else {
|
|
137
|
-
options.unshift({ isTag: true, label: searchVal });
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return options.slice(0, props.optionsLimit);
|
|
141
|
-
});
|
|
142
|
-
const valueKeys = computed(
|
|
143
|
-
() => props.trackBy ? internalValue.value.map((el) => el[props.trackBy]) : internalValue.value
|
|
144
|
-
);
|
|
145
|
-
const optionKeys = computed(() => {
|
|
146
|
-
const options = props.groupValues ? flatAndStrip(props.options) : props.options;
|
|
147
|
-
return options.map((el) => props.customLabel(el, props.label).toString().toLowerCase());
|
|
148
|
-
});
|
|
149
|
-
const currentOptionLabel = computed(
|
|
150
|
-
() => props.multiple ? props.searchable ? "" : props.placeholder : internalValue.value.length ? getOptionLabel(internalValue.value[0]) : props.searchable ? "" : props.placeholder
|
|
151
|
-
);
|
|
152
|
-
const hasOptionGroup = computed(() => props.groupValues && props.groupLabel && props.groupSelect);
|
|
153
|
-
const isSingleLabelVisible = computed(
|
|
154
|
-
() => (singleValue.value || singleValue.value === 0) && (!isOpen.value || !props.searchable) && !visibleValues.value.length
|
|
155
|
-
);
|
|
156
|
-
const isPlaceholderVisible = computed(
|
|
157
|
-
() => !internalValue.value.length && (!props.searchable || !isOpen.value)
|
|
158
|
-
);
|
|
159
|
-
const visibleValues = computed(
|
|
160
|
-
() => props.multiple ? internalValue.value.slice(0, props.limit) : []
|
|
161
|
-
);
|
|
162
|
-
const singleValue = computed(() => internalValue.value[0]);
|
|
163
|
-
const deselectLabelText = computed(() => props.showLabels ? props.deselectLabel : "");
|
|
164
|
-
const deselectGroupLabelText = computed(() => props.showLabels ? props.deselectGroupLabel : "");
|
|
165
|
-
const selectLabelText = computed(() => props.showLabels ? props.selectLabel : "");
|
|
166
|
-
const selectGroupLabelText = computed(() => props.showLabels ? props.selectGroupLabel : "");
|
|
167
|
-
const selectedLabelText = computed(() => props.showLabels ? props.selectedLabel : "");
|
|
168
|
-
const inputStyle = computed(() => {
|
|
169
|
-
if (props.searchable || props.multiple && props.modelValue?.length) {
|
|
170
|
-
return isOpen.value ? { width: "100%" } : { width: "0", position: "absolute", padding: "0" };
|
|
171
|
-
}
|
|
172
|
-
return "";
|
|
173
|
-
});
|
|
174
|
-
const contentStyle = computed(
|
|
175
|
-
() => props.options.length ? { display: "inline-block" } : { display: "block" }
|
|
176
|
-
);
|
|
177
|
-
const isAbove = computed(() => {
|
|
178
|
-
if (["above", "top"].includes(props.openDirection)) return true;
|
|
179
|
-
if (["below", "bottom"].includes(props.openDirection)) return false;
|
|
180
|
-
return preferredOpenDirection.value === "above";
|
|
181
|
-
});
|
|
182
|
-
const pointerPosition = computed(() => pointer.value * props.optionHeight);
|
|
183
|
-
const visibleElements = computed(() => optimizedHeight.value / props.optionHeight);
|
|
184
|
-
const filterAndFlat = (options, search2, label) => flow(
|
|
185
|
-
filterGroups(search2, label, props.groupValues, props.groupLabel, props.customLabel),
|
|
186
|
-
flattenOptions(props.groupValues, props.groupLabel)
|
|
187
|
-
)(options);
|
|
188
|
-
const flatAndStrip = (options) => flow(
|
|
189
|
-
flattenOptions(props.groupValues, props.groupLabel),
|
|
190
|
-
stripGroups
|
|
191
|
-
)(options);
|
|
192
|
-
const updateSearch = (query) => {
|
|
193
|
-
search.value = query;
|
|
194
|
-
};
|
|
195
|
-
const isExistingOption = (query) => props.options ? optionKeys.value.indexOf(query) > -1 : false;
|
|
196
|
-
const isSelected = (option) => {
|
|
197
|
-
const opt = props.trackBy ? option[props.trackBy] : option;
|
|
198
|
-
return valueKeys.value.indexOf(opt) > -1;
|
|
199
|
-
};
|
|
200
|
-
const isOptionDisabled = (option) => !!option?.$isDisabled;
|
|
201
|
-
const getOptionLabel = (option) => {
|
|
202
|
-
if (isEmpty(option)) return "";
|
|
203
|
-
if (option.isTag) return option.label;
|
|
204
|
-
if (option.$isLabel) return option.$groupLabel;
|
|
205
|
-
const label = props.customLabel(option, props.label);
|
|
206
|
-
return isEmpty(label) ? "" : label;
|
|
207
|
-
};
|
|
208
|
-
const select = (option, key) => {
|
|
209
|
-
if (option.$isLabel && props.groupSelect) {
|
|
210
|
-
selectGroup(option);
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
if (props.blockKeys.indexOf(key) !== -1 || props.disabled || option.$isDisabled || option.$isLabel) return;
|
|
214
|
-
if (props.max && props.multiple && internalValue.value.length === props.max) return;
|
|
215
|
-
if (key === "Tab" && !pointerDirty.value) return;
|
|
216
|
-
if (option.isTag) {
|
|
217
|
-
emit("tag", option.label, props.id);
|
|
218
|
-
search.value = "";
|
|
219
|
-
if (props.closeOnSelect && !props.multiple) deactivate();
|
|
220
|
-
} else {
|
|
221
|
-
if (isSelected(option)) {
|
|
222
|
-
if (key !== "Tab") removeElement(option);
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
emit("update:modelValue", props.multiple ? internalValue.value.concat([option]) : option);
|
|
226
|
-
emit("select", option, props.id);
|
|
227
|
-
if (props.clearOnSelect) search.value = "";
|
|
228
|
-
}
|
|
229
|
-
if (props.closeOnSelect) deactivate();
|
|
230
|
-
};
|
|
231
|
-
const selectGroup = (selectedGroup) => {
|
|
232
|
-
const group = props.options.find(
|
|
233
|
-
(option) => option[props.groupLabel] === selectedGroup.$groupLabel
|
|
234
|
-
);
|
|
235
|
-
if (!group) return;
|
|
236
|
-
if (wholeGroupSelected(group)) {
|
|
237
|
-
emit("remove", group[props.groupValues], props.id);
|
|
238
|
-
const newValue = internalValue.value.filter(
|
|
239
|
-
(option) => group[props.groupValues].indexOf(option) === -1
|
|
240
|
-
);
|
|
241
|
-
emit("update:modelValue", newValue);
|
|
242
|
-
} else {
|
|
243
|
-
let optionsToAdd = group[props.groupValues].filter(
|
|
244
|
-
(option) => !(isOptionDisabled(option) || isSelected(option))
|
|
245
|
-
);
|
|
246
|
-
if (props.max) optionsToAdd.splice(props.max - internalValue.value.length);
|
|
247
|
-
emit("select", optionsToAdd, props.id);
|
|
248
|
-
emit("update:modelValue", internalValue.value.concat(optionsToAdd));
|
|
249
|
-
}
|
|
250
|
-
if (props.closeOnSelect) deactivate();
|
|
251
|
-
};
|
|
252
|
-
const wholeGroupSelected = (group) => group[props.groupValues].every((option) => isSelected(option) || isOptionDisabled(option));
|
|
253
|
-
const wholeGroupDisabled = (group) => group[props.groupValues].every(isOptionDisabled);
|
|
254
|
-
const removeElement = (option, shouldClose = true) => {
|
|
255
|
-
if (props.disabled || option?.$isDisabled) return;
|
|
256
|
-
if (!props.allowEmpty && internalValue.value.length <= 1) {
|
|
257
|
-
deactivate();
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
const index = typeof option === "object" ? valueKeys.value.indexOf(option[props.trackBy]) : valueKeys.value.indexOf(option);
|
|
261
|
-
const newValue = props.multiple ? internalValue.value.slice(0, index).concat(internalValue.value.slice(index + 1)) : null;
|
|
262
|
-
emit("update:modelValue", newValue);
|
|
263
|
-
emit("remove", option, props.id);
|
|
264
|
-
if (props.closeOnSelect && shouldClose) deactivate();
|
|
265
|
-
};
|
|
266
|
-
const removeLastElement = () => {
|
|
267
|
-
if (props.blockKeys.indexOf("Delete") !== -1) return;
|
|
268
|
-
if (search.value.length === 0 && Array.isArray(internalValue.value) && internalValue.value.length) {
|
|
269
|
-
removeElement(internalValue.value[internalValue.value.length - 1], false);
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
const activate = () => {
|
|
273
|
-
if (isOpen.value || props.disabled) return;
|
|
274
|
-
adjustPosition();
|
|
275
|
-
if (props.groupValues && pointer.value === 0 && filteredOptions.value.length) {
|
|
276
|
-
pointer.value = 1;
|
|
277
|
-
}
|
|
278
|
-
isOpen.value = true;
|
|
279
|
-
if (props.searchable) {
|
|
280
|
-
if (!props.preserveSearch) search.value = "";
|
|
281
|
-
if (!props.preventAutofocus) nextTick(() => searchInput.value?.focus());
|
|
282
|
-
} else if (!props.preventAutofocus) {
|
|
283
|
-
multiselect.value?.focus();
|
|
284
|
-
}
|
|
285
|
-
emit("open", props.id);
|
|
286
|
-
};
|
|
287
|
-
const deactivate = () => {
|
|
288
|
-
if (!isOpen.value) return;
|
|
289
|
-
isOpen.value = false;
|
|
290
|
-
if (props.searchable) {
|
|
291
|
-
searchInput.value?.blur();
|
|
292
|
-
} else {
|
|
293
|
-
multiselect.value?.blur();
|
|
294
|
-
}
|
|
295
|
-
if (!props.preserveSearch) search.value = "";
|
|
296
|
-
emit("close", getValue(), props.id);
|
|
297
|
-
};
|
|
298
|
-
const toggle = () => {
|
|
299
|
-
isOpen.value ? deactivate() : activate();
|
|
300
|
-
};
|
|
301
|
-
const adjustPosition = () => {
|
|
302
|
-
if (typeof window === "undefined") return;
|
|
303
|
-
const spaceAbove = multiselect.value.getBoundingClientRect().top;
|
|
304
|
-
const spaceBelow = window.innerHeight - multiselect.value.getBoundingClientRect().bottom;
|
|
305
|
-
const hasEnoughSpaceBelow = spaceBelow > props.maxHeight;
|
|
306
|
-
if (hasEnoughSpaceBelow || spaceBelow > spaceAbove || ["below", "bottom"].includes(props.openDirection)) {
|
|
307
|
-
preferredOpenDirection.value = "below";
|
|
308
|
-
optimizedHeight.value = Math.min(spaceBelow - 40, props.maxHeight);
|
|
309
|
-
} else {
|
|
310
|
-
preferredOpenDirection.value = "above";
|
|
311
|
-
optimizedHeight.value = Math.min(spaceAbove - 40, props.maxHeight);
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
const getValue = () => props.multiple ? internalValue.value : internalValue.value.length === 0 ? null : internalValue.value[0];
|
|
315
|
-
const optionHighlight = (index, option) => ({
|
|
316
|
-
"multiselect__option--highlight": index === pointer.value && props.showPointer,
|
|
317
|
-
"multiselect__option--selected": isSelected(option)
|
|
318
|
-
});
|
|
319
|
-
const groupHighlight = (index, selectedGroup) => {
|
|
320
|
-
if (!props.groupSelect) {
|
|
321
|
-
return ["multiselect__option--disabled", { "multiselect__option--group": selectedGroup.$isLabel }];
|
|
322
|
-
}
|
|
323
|
-
const group = props.options.find(
|
|
324
|
-
(option) => option[props.groupLabel] === selectedGroup.$groupLabel
|
|
325
|
-
);
|
|
326
|
-
return group && !wholeGroupDisabled(group) ? [
|
|
327
|
-
"multiselect__option--group",
|
|
328
|
-
{ "multiselect__option--highlight": index === pointer.value && props.showPointer },
|
|
329
|
-
{ "multiselect__option--group-selected": wholeGroupSelected(group) }
|
|
330
|
-
] : "multiselect__option--disabled";
|
|
331
|
-
};
|
|
332
|
-
const addPointerElement = ({ key } = "Enter") => {
|
|
333
|
-
if (filteredOptions.value.length > 0) {
|
|
334
|
-
select(filteredOptions.value[pointer.value], key);
|
|
335
|
-
}
|
|
336
|
-
pointerReset();
|
|
337
|
-
};
|
|
338
|
-
const pointerForward = () => {
|
|
339
|
-
if (pointer.value < filteredOptions.value.length - 1) {
|
|
340
|
-
pointer.value++;
|
|
341
|
-
if (list.value.scrollTop <= pointerPosition.value - (visibleElements.value - 1) * props.optionHeight) {
|
|
342
|
-
list.value.scrollTop = pointerPosition.value - (visibleElements.value - 1) * props.optionHeight;
|
|
343
|
-
}
|
|
344
|
-
if (filteredOptions.value[pointer.value]?.$isLabel && !props.groupSelect) pointerForward();
|
|
345
|
-
}
|
|
346
|
-
pointerDirty.value = true;
|
|
347
|
-
};
|
|
348
|
-
const pointerBackward = () => {
|
|
349
|
-
if (pointer.value > 0) {
|
|
350
|
-
pointer.value--;
|
|
351
|
-
if (list.value.scrollTop >= pointerPosition.value) {
|
|
352
|
-
list.value.scrollTop = pointerPosition.value;
|
|
353
|
-
}
|
|
354
|
-
if (filteredOptions.value[pointer.value]?.$isLabel && !props.groupSelect) pointerBackward();
|
|
355
|
-
} else {
|
|
356
|
-
if (filteredOptions.value[pointer.value]?.$isLabel && !props.groupSelect) pointerForward();
|
|
357
|
-
}
|
|
358
|
-
pointerDirty.value = true;
|
|
359
|
-
};
|
|
360
|
-
const pointerReset = () => {
|
|
361
|
-
if (!props.closeOnSelect) return;
|
|
362
|
-
pointer.value = 0;
|
|
363
|
-
if (list.value) list.value.scrollTop = 0;
|
|
364
|
-
};
|
|
365
|
-
const pointerAdjust = () => {
|
|
366
|
-
if (pointer.value >= filteredOptions.value.length - 1) {
|
|
367
|
-
pointer.value = filteredOptions.value.length ? filteredOptions.value.length - 1 : 0;
|
|
368
|
-
}
|
|
369
|
-
if (filteredOptions.value.length > 0 && filteredOptions.value[pointer.value]?.$isLabel && !props.groupSelect) {
|
|
370
|
-
pointerForward();
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
const pointerSet = (index) => {
|
|
374
|
-
pointer.value = index;
|
|
375
|
-
pointerDirty.value = true;
|
|
376
|
-
};
|
|
377
|
-
watch(() => internalValue.value, () => {
|
|
378
|
-
if (props.resetAfter && internalValue.value.length) {
|
|
379
|
-
search.value = "";
|
|
380
|
-
emit("update:modelValue", props.multiple ? [] : null);
|
|
381
|
-
}
|
|
382
|
-
}, { deep: true });
|
|
383
|
-
watch(search, () => emit("search-change", search.value));
|
|
384
|
-
watch(filteredOptions, () => pointerAdjust());
|
|
385
|
-
watch(isOpen, () => pointerDirty.value = false);
|
|
386
|
-
watch(pointer, () => {
|
|
387
|
-
searchInput.value?.setAttribute("aria-activedescendant", `${props.id}-${pointer.value}`);
|
|
388
|
-
});
|
|
389
|
-
onMounted(() => {
|
|
390
|
-
if (!props.multiple && props.max) {
|
|
391
|
-
console.warn("[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false.");
|
|
392
|
-
}
|
|
393
|
-
if (props.preselectFirst && !internalValue.value.length && props.options.length) {
|
|
394
|
-
select(filteredOptions.value[0]);
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
return (_ctx, _cache) => {
|
|
398
|
-
return openBlock(), createElementBlock("div", {
|
|
399
|
-
ref_key: "multiselect",
|
|
400
|
-
ref: multiselect,
|
|
401
|
-
tabindex: __props.searchable ? -1 : __props.tabindex,
|
|
402
|
-
class: normalizeClass([{
|
|
403
|
-
"multiselect--active": isOpen.value,
|
|
404
|
-
"multiselect--disabled": __props.disabled,
|
|
405
|
-
"multiselect--above": isAbove.value,
|
|
406
|
-
"multiselect--has-options-group": hasOptionGroup.value
|
|
407
|
-
}, "multiselect flex flex-v-center"]),
|
|
408
|
-
onFocus: activate,
|
|
409
|
-
onBlur: _cache[2] || (_cache[2] = ($event) => __props.searchable ? false : deactivate),
|
|
410
|
-
onKeydown: [
|
|
411
|
-
withKeys(withModifiers(pointerForward, ["self", "prevent"]), ["down"]),
|
|
412
|
-
withKeys(withModifiers(pointerBackward, ["self", "prevent"]), ["up"])
|
|
413
|
-
],
|
|
414
|
-
onKeypress: withKeys(withModifiers(addPointerElement, ["stop", "self"]), ["enter", "tab"]),
|
|
415
|
-
onKeyup: withKeys(deactivate, ["esc"]),
|
|
416
|
-
role: "combobox",
|
|
417
|
-
"aria-owns": `listbox-${__props.id}`
|
|
418
|
-
}, [
|
|
419
|
-
renderSlot(_ctx.$slots, "caret", { toggle }, () => [
|
|
420
|
-
createElementVNode("div", {
|
|
421
|
-
onMousedown: withModifiers(toggle, ["prevent", "stop"]),
|
|
422
|
-
class: "multiselect__select"
|
|
423
|
-
}, null, 32)
|
|
424
|
-
]),
|
|
425
|
-
renderSlot(_ctx.$slots, "clear", { search: search.value }),
|
|
426
|
-
createElementVNode("div", {
|
|
427
|
-
ref_key: "tags",
|
|
428
|
-
ref: tags,
|
|
429
|
-
class: "multiselect__tags"
|
|
430
|
-
}, [
|
|
431
|
-
renderSlot(_ctx.$slots, "selection", {
|
|
432
|
-
search: search.value,
|
|
433
|
-
remove: removeElement,
|
|
434
|
-
values: visibleValues.value,
|
|
435
|
-
isOpen: isOpen.value
|
|
436
|
-
}, () => [
|
|
437
|
-
withDirectives(createElementVNode("div", _hoisted_2, [
|
|
438
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(visibleValues.value, (option, index) => {
|
|
439
|
-
return renderSlot(_ctx.$slots, "tag", {
|
|
440
|
-
key: index,
|
|
441
|
-
option,
|
|
442
|
-
search: search.value,
|
|
443
|
-
remove: removeElement
|
|
444
|
-
}, () => [
|
|
445
|
-
createElementVNode("span", _hoisted_3, [
|
|
446
|
-
createElementVNode("span", {
|
|
447
|
-
textContent: toDisplayString(getOptionLabel(option))
|
|
448
|
-
}, null, 8, _hoisted_4),
|
|
449
|
-
createElementVNode("i", {
|
|
450
|
-
tabindex: "1",
|
|
451
|
-
onKeypress: withKeys(withModifiers(($event) => removeElement(option), ["prevent"]), ["enter"]),
|
|
452
|
-
onMousedown: withModifiers(($event) => removeElement(option), ["prevent"]),
|
|
453
|
-
class: "multiselect__tag-icon"
|
|
454
|
-
}, null, 40, _hoisted_5)
|
|
455
|
-
])
|
|
456
|
-
]);
|
|
457
|
-
}), 128))
|
|
458
|
-
], 512), [
|
|
459
|
-
[vShow, visibleValues.value.length > 0]
|
|
460
|
-
]),
|
|
461
|
-
internalValue.value?.length > __props.limit ? renderSlot(_ctx.$slots, "limit", { key: 0 }, () => [
|
|
462
|
-
createElementVNode("strong", {
|
|
463
|
-
class: "multiselect__strong",
|
|
464
|
-
textContent: toDisplayString(__props.limitText(internalValue.value.length - __props.limit))
|
|
465
|
-
}, null, 8, _hoisted_6)
|
|
466
|
-
]) : createCommentVNode("", true)
|
|
467
|
-
]),
|
|
468
|
-
createVNode(Transition, { name: "multiselect__loading" }, {
|
|
469
|
-
default: withCtx(() => [
|
|
470
|
-
renderSlot(_ctx.$slots, "loading", {}, () => [
|
|
471
|
-
withDirectives(createElementVNode("div", _hoisted_7, null, 512), [
|
|
472
|
-
[vShow, __props.loading]
|
|
473
|
-
])
|
|
474
|
-
])
|
|
475
|
-
]),
|
|
476
|
-
_: 3
|
|
477
|
-
}),
|
|
478
|
-
__props.searchable ? (openBlock(), createElementBlock("input", {
|
|
479
|
-
key: 0,
|
|
480
|
-
ref_key: "searchInput",
|
|
481
|
-
ref: searchInput,
|
|
482
|
-
name: __props.name,
|
|
483
|
-
id: __props.id,
|
|
484
|
-
type: "text",
|
|
485
|
-
autocomplete: "off",
|
|
486
|
-
spellcheck: "false",
|
|
487
|
-
placeholder: __props.placeholder,
|
|
488
|
-
style: normalizeStyle(inputStyle.value),
|
|
489
|
-
value: search.value,
|
|
490
|
-
disabled: __props.disabled,
|
|
491
|
-
tabindex: __props.tabindex,
|
|
492
|
-
onInput: _cache[0] || (_cache[0] = ($event) => updateSearch($event.target.value)),
|
|
493
|
-
onFocus: withModifiers(activate, ["prevent"]),
|
|
494
|
-
onBlur: withModifiers(deactivate, ["prevent"]),
|
|
495
|
-
onKeyup: withKeys(deactivate, ["esc"]),
|
|
496
|
-
onKeydown: [
|
|
497
|
-
withKeys(withModifiers(pointerForward, ["prevent"]), ["down"]),
|
|
498
|
-
withKeys(withModifiers(pointerBackward, ["prevent"]), ["up"]),
|
|
499
|
-
withKeys(withModifiers(removeLastElement, ["stop"]), ["delete"])
|
|
500
|
-
],
|
|
501
|
-
onKeypress: withKeys(withModifiers(addPointerElement, ["prevent", "stop", "self"]), ["enter"]),
|
|
502
|
-
class: "multiselect__input",
|
|
503
|
-
"aria-controls": `listbox-${__props.id}`
|
|
504
|
-
}, null, 44, _hoisted_8)) : createCommentVNode("", true),
|
|
505
|
-
isSingleLabelVisible.value ? (openBlock(), createElementBlock("span", {
|
|
506
|
-
key: 1,
|
|
507
|
-
class: "multiselect__single",
|
|
508
|
-
onMousedown: withModifiers(toggle, ["prevent"])
|
|
509
|
-
}, [
|
|
510
|
-
renderSlot(_ctx.$slots, "singleLabel", { option: singleValue.value }, () => [
|
|
511
|
-
createTextVNode(toDisplayString(currentOptionLabel.value), 1)
|
|
512
|
-
])
|
|
513
|
-
], 32)) : createCommentVNode("", true),
|
|
514
|
-
isPlaceholderVisible.value ? (openBlock(), createElementBlock("span", {
|
|
515
|
-
key: 2,
|
|
516
|
-
class: "multiselect__placeholder",
|
|
517
|
-
onMousedown: withModifiers(toggle, ["prevent"])
|
|
518
|
-
}, [
|
|
519
|
-
renderSlot(_ctx.$slots, "placeholder", {}, () => [
|
|
520
|
-
createTextVNode(toDisplayString(__props.placeholder), 1)
|
|
521
|
-
])
|
|
522
|
-
], 32)) : createCommentVNode("", true)
|
|
523
|
-
], 512),
|
|
524
|
-
createVNode(Transition, { name: "multiselect" }, {
|
|
525
|
-
default: withCtx(() => [
|
|
526
|
-
withDirectives(createElementVNode("div", {
|
|
527
|
-
class: "multiselect__content-wrapper",
|
|
528
|
-
onFocus: activate,
|
|
529
|
-
tabindex: "-1",
|
|
530
|
-
onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
531
|
-
}, ["prevent"])),
|
|
532
|
-
style: normalizeStyle({ maxHeight: `${optimizedHeight.value}px` }),
|
|
533
|
-
ref_key: "list",
|
|
534
|
-
ref: list
|
|
535
|
-
}, [
|
|
536
|
-
createElementVNode("ul", {
|
|
537
|
-
class: "multiselect__content",
|
|
538
|
-
style: normalizeStyle(contentStyle.value),
|
|
539
|
-
role: "listbox",
|
|
540
|
-
id: `listbox-${__props.id}`
|
|
541
|
-
}, [
|
|
542
|
-
renderSlot(_ctx.$slots, "beforeList"),
|
|
543
|
-
__props.multiple && __props.max === internalValue.value.length ? (openBlock(), createElementBlock("li", _hoisted_10, [
|
|
544
|
-
createElementVNode("span", _hoisted_11, [
|
|
545
|
-
renderSlot(_ctx.$slots, "maxElements", {}, () => [
|
|
546
|
-
createTextVNode(" Maximum of " + toDisplayString(__props.max) + " options selected. First remove a selected option to select another. ", 1)
|
|
547
|
-
])
|
|
548
|
-
])
|
|
549
|
-
])) : createCommentVNode("", true),
|
|
550
|
-
!__props.max || internalValue.value.length < __props.max ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(filteredOptions.value, (option, index) => {
|
|
551
|
-
return openBlock(), createElementBlock("li", {
|
|
552
|
-
class: "multiselect__element",
|
|
553
|
-
key: index,
|
|
554
|
-
id: `${__props.id}-${index}`,
|
|
555
|
-
role: !(option?.$isLabel || option?.$isDisabled) ? "option" : null
|
|
556
|
-
}, [
|
|
557
|
-
!(option?.$isLabel || option?.$isDisabled) ? (openBlock(), createElementBlock("span", {
|
|
558
|
-
key: 0,
|
|
559
|
-
class: normalizeClass([optionHighlight(index, option), "multiselect__option"]),
|
|
560
|
-
onClick: withModifiers(($event) => select(option), ["stop"]),
|
|
561
|
-
onMouseenter: withModifiers(($event) => pointerSet(index), ["self"]),
|
|
562
|
-
"data-select": option?.isTag ? __props.tagPlaceholder : selectLabelText.value,
|
|
563
|
-
"data-selected": selectedLabelText.value,
|
|
564
|
-
"data-deselect": deselectLabelText.value
|
|
565
|
-
}, [
|
|
566
|
-
renderSlot(_ctx.$slots, "option", {
|
|
567
|
-
option,
|
|
568
|
-
search: search.value,
|
|
569
|
-
index
|
|
570
|
-
}, () => [
|
|
571
|
-
createElementVNode("span", null, toDisplayString(getOptionLabel(option)), 1)
|
|
572
|
-
])
|
|
573
|
-
], 42, _hoisted_13)) : createCommentVNode("", true),
|
|
574
|
-
option?.$isLabel || option?.$isDisabled ? (openBlock(), createElementBlock("span", {
|
|
575
|
-
key: 1,
|
|
576
|
-
"data-select": __props.groupSelect && selectGroupLabelText.value,
|
|
577
|
-
"data-deselect": __props.groupSelect && deselectGroupLabelText.value,
|
|
578
|
-
class: normalizeClass([groupHighlight(index, option), "multiselect__option"]),
|
|
579
|
-
onMouseenter: withModifiers(($event) => __props.groupSelect && pointerSet(index), ["self"]),
|
|
580
|
-
onMousedown: withModifiers(($event) => selectGroup(option), ["prevent"])
|
|
581
|
-
}, [
|
|
582
|
-
renderSlot(_ctx.$slots, "option", {
|
|
583
|
-
option,
|
|
584
|
-
search: search.value,
|
|
585
|
-
index
|
|
586
|
-
}, () => [
|
|
587
|
-
createElementVNode("span", null, toDisplayString(getOptionLabel(option)), 1)
|
|
588
|
-
])
|
|
589
|
-
], 42, _hoisted_14)) : createCommentVNode("", true)
|
|
590
|
-
], 8, _hoisted_12);
|
|
591
|
-
}), 128)) : createCommentVNode("", true),
|
|
592
|
-
withDirectives(createElementVNode("li", null, [
|
|
593
|
-
createElementVNode("span", _hoisted_15, [
|
|
594
|
-
renderSlot(_ctx.$slots, "noResult", { search: search.value }, () => [
|
|
595
|
-
_cache[3] || (_cache[3] = createTextVNode(" No elements found. Consider changing the search query. "))
|
|
596
|
-
])
|
|
597
|
-
])
|
|
598
|
-
], 512), [
|
|
599
|
-
[vShow, __props.showNoResults && filteredOptions.value.length === 0 && search.value && !__props.loading]
|
|
600
|
-
]),
|
|
601
|
-
withDirectives(createElementVNode("li", null, [
|
|
602
|
-
createElementVNode("span", _hoisted_16, [
|
|
603
|
-
renderSlot(_ctx.$slots, "noOptions", {}, () => [
|
|
604
|
-
_cache[4] || (_cache[4] = createTextVNode("List is empty."))
|
|
605
|
-
])
|
|
606
|
-
])
|
|
607
|
-
], 512), [
|
|
608
|
-
[vShow, __props.showNoOptions && (__props.options.length === 0 || hasOptionGroup.value && filteredOptions.value.length === 0) && !search.value && !__props.loading]
|
|
609
|
-
]),
|
|
610
|
-
renderSlot(_ctx.$slots, "afterList")
|
|
611
|
-
], 12, _hoisted_9)
|
|
612
|
-
], 36), [
|
|
613
|
-
[vShow, isOpen.value]
|
|
614
|
-
])
|
|
615
|
-
]),
|
|
616
|
-
_: 3
|
|
617
|
-
})
|
|
618
|
-
], 42, _hoisted_1);
|
|
619
|
-
};
|
|
620
|
-
}
|
|
621
|
-
};
|
|
622
|
-
export {
|
|
623
|
-
_sfc_main as default
|
|
624
|
-
};
|
|
625
|
-
//# sourceMappingURL=SelectMulti.vue2.js.map
|