@sonic-equipment/ui 0.0.119 → 120.0.0
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/_commonjsHelpers.js +5 -0
- package/dist/_virtual/index.js +7 -0
- package/dist/algolia/algolia-active-categories.js +38 -0
- package/dist/algolia/algolia-active-filters.js +33 -0
- package/dist/algolia/algolia-categories-filters.js +29 -0
- package/dist/algolia/algolia-dummy-refinement-list-consumer.js +20 -0
- package/dist/algolia/algolia-filter-panel.js +42 -0
- package/dist/algolia/algolia-filter-panel.module.css.js +3 -0
- package/dist/algolia/algolia-hit-type.js +6 -0
- package/dist/algolia/algolia-hits-provider.js +17 -0
- package/dist/algolia/algolia-index-config.js +175 -0
- package/dist/algolia/algolia-insight-instant-search-provider.js +14 -0
- package/dist/algolia/algolia-insights-provider.js +18 -0
- package/dist/algolia/algolia-instant-search-state-provider.js +16 -0
- package/dist/algolia/algolia-intialization.js +26 -0
- package/dist/algolia/algolia-multi-select-filter-section.js +27 -0
- package/dist/algolia/algolia-pagination.js +18 -0
- package/dist/algolia/algolia-provider.js +34 -0
- package/dist/algolia/algolia-query-string-routing.js +106 -0
- package/dist/algolia/algolia-results-count.js +14 -0
- package/dist/algolia/algolia-search-provider.js +139 -0
- package/dist/algolia/algolia-searchclient-offline.js +25 -0
- package/dist/algolia/algolia-sonic-searchclient.js +25 -0
- package/dist/algolia/algolia-sort-by.js +29 -0
- package/dist/algolia/filter-section.js +33 -0
- package/dist/algolia/filter-section.module.css.js +3 -0
- package/dist/algolia/use-algolia-hits.js +19 -0
- package/dist/algolia/use-algolia-insights-provider-global-state.js +9 -0
- package/dist/algolia/use-algolia-insights.js +181 -0
- package/dist/algolia/use-algolia-instant-search-state.js +25 -0
- package/dist/algolia/use-algolia-search.js +41 -0
- package/dist/background-overlay/background-overlay.js +36 -0
- package/dist/background-overlay/background-overlay.module.css.js +3 -0
- package/dist/badges/badge/badge.js +22 -0
- package/dist/badges/badge/badge.module.css.js +3 -0
- package/dist/badges/badge/icon-with-badge/icon-with-badge.js +8 -0
- package/dist/badges/badge/icon-with-badge/icon-with-badge.module.css.js +3 -0
- package/dist/badges/tag/tag.js +10 -0
- package/dist/badges/tag/tag.module.css.js +3 -0
- package/dist/breadcrumbs/breadcrumb.js +35 -0
- package/dist/breadcrumbs/breadcrumb.module.css.js +3 -0
- package/dist/buttons/add-to-cart-button/add-to-cart-button.js +113 -0
- package/dist/buttons/add-to-cart-button/add-to-cart-button.module.css.js +3 -0
- package/dist/buttons/add-to-cart-button/connected-add-to-cart-button.js +92 -0
- package/dist/buttons/button/button.js +21 -0
- package/dist/buttons/button/button.module.css.js +3 -0
- package/dist/buttons/favorite/connected-favorite-button.js +64 -0
- package/dist/buttons/favorite/favorite-button.js +15 -0
- package/dist/buttons/favorite/favorite-button.module.css.js +3 -0
- package/dist/buttons/icon-button/icon-button.js +15 -0
- package/dist/buttons/icon-button/icon-button.module.css.js +3 -0
- package/dist/buttons/link/link.js +10 -0
- package/dist/buttons/link/link.module.css.js +3 -0
- package/dist/buttons/print-button/print-button.js +9 -0
- package/dist/cards/category-card/category-card.js +15 -0
- package/dist/cards/category-card/category-card.module.css.js +3 -0
- package/dist/cards/orderline-card/connected-orderline-card.js +13 -0
- package/dist/cards/orderline-card/connected-remove-button.js +19 -0
- package/dist/cards/orderline-card/orderline-card.js +17 -0
- package/dist/cards/orderline-card/orderline-card.module.css.js +3 -0
- package/dist/cards/product-card/connected-product-card.js +11 -0
- package/dist/cards/product-card/product-card.js +15 -0
- package/dist/cards/product-card/product-card.module.css.js +3 -0
- package/dist/carousel/card-carousel/card-carousel.js +23 -0
- package/dist/carousel/card-carousel/card-carousel.module.css.js +3 -0
- package/dist/carousel/carousel-navigation-button.js +13 -0
- package/dist/carousel/carousel-navigation-button.module.css.js +3 -0
- package/dist/carousel/carousel.js +69 -0
- package/dist/carousel/carousel.module.css.js +3 -0
- package/dist/carousel/category-carousel/category-carousel.js +9 -0
- package/dist/carousel/category-carousel/category-carousel.module.css.js +3 -0
- package/dist/carousel/pagination/pagination.js +40 -0
- package/dist/carousel/pagination/pagination.module.css.js +3 -0
- package/dist/carousel/pagination/transitions.js +144 -0
- package/dist/carousel/usp-carousel/product-usp-carousel-slide.js +10 -0
- package/dist/carousel/usp-carousel/product-usp-carousel.js +9 -0
- package/dist/carousel/usp-carousel/usp-carousel.js +47 -0
- package/dist/carousel/usp-carousel/usp-carousel.module.css.js +3 -0
- package/dist/cart-totals/cart-totals-summary.js +11 -0
- package/dist/cart-totals/cart-totals-summary.module.css.js +3 -0
- package/dist/cart-totals/cart-totals.js +10 -0
- package/dist/cart-totals/cart-totals.module.css.js +3 -0
- package/dist/collapsables/accordion/accordion-item.js +18 -0
- package/dist/collapsables/accordion/accordion.js +15 -0
- package/dist/collapsables/accordion/accordion.module.css.js +3 -0
- package/dist/collapsables/show-all/show-all.js +33 -0
- package/dist/collapsables/show-all/show-all.module.css.js +3 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.js +82 -0
- package/dist/country-selector/connected-country-selector.js +37 -0
- package/dist/country-selector/country-selector-dialog/country-selector-dialog.js +42 -0
- package/dist/country-selector/country-selector-dialog/country-selector-dialog.module.css.js +3 -0
- package/dist/country-selector/country-selector-trigger/country-selector-trigger.js +16 -0
- package/dist/country-selector/country-selector-trigger/country-selector-trigger.module.css.js +3 -0
- package/dist/country-selector/use-countries-languages.js +72 -0
- package/dist/delivery-time/delivery-time.js +18 -0
- package/dist/delivery-time/delivery-time.module.css.js +3 -0
- package/dist/display/product-price/product-price.js +19 -0
- package/dist/display/product-price/product-price.module.css.js +3 -0
- package/dist/display/product-price/product-total-price.js +16 -0
- package/dist/display/product-price/product-total-price.module.css.js +3 -0
- package/dist/display/product-sku/product-sku.js +8 -0
- package/dist/display/product-sku/product-sku.module.css.js +3 -0
- package/dist/exports.d.ts +4 -4
- package/dist/filters/active-filters/active-filters.js +20 -0
- package/dist/filters/active-filters/active-filters.module.css.js +3 -0
- package/dist/filters/multi-select/multi-select.js +20 -0
- package/dist/filters/multi-select/multi-select.module.css.js +3 -0
- package/dist/filters/pagination/pagination.js +14 -0
- package/dist/filters/pagination/pagination.module.css.js +3 -0
- package/dist/forms/checkbox/checkbox.js +11 -0
- package/dist/forms/checkbox/checkbox.module.css.js +3 -0
- package/dist/forms/color-checkbox/color-checkbox.js +13 -0
- package/dist/forms/field-error/field-error.js +10 -0
- package/dist/forms/field-error/field-error.module.css.js +3 -0
- package/dist/forms/input/input.js +31 -0
- package/dist/forms/input/input.module.css.js +3 -0
- package/dist/forms/label/label.js +12 -0
- package/dist/forms/label/label.module.css.js +3 -0
- package/dist/forms/number-field/number-field.js +29 -0
- package/dist/forms/number-field/number-field.module.css.js +3 -0
- package/dist/forms/select/select.js +31 -0
- package/dist/forms/select/select.module.css.js +3 -0
- package/dist/forms/text-field/text-field.js +22 -0
- package/dist/forms/text-field/text-field.module.css.js +3 -0
- package/dist/forms/textarea/textarea.js +54 -0
- package/dist/forms/textarea/textarea.module.css.js +3 -0
- package/dist/global-search/categories-grid/categories-grid.js +14 -0
- package/dist/global-search/categories-grid/categories-grid.module.css.js +3 -0
- package/dist/global-search/global-search-provider/global-search-provider.js +15 -0
- package/dist/global-search/global-search-provider/use-search-disclosure.js +13 -0
- package/dist/global-search/global-search.js +43 -0
- package/dist/global-search/global-search.module.css.js +3 -0
- package/dist/global-search/plugins/categories-plugin.js +35 -0
- package/dist/global-search/plugins/popular-categories-plugin.js +32 -0
- package/dist/global-search/plugins/popular-searches-plugin.js +23 -0
- package/dist/global-search/plugins/query-suggestions-plugin.js +21 -0
- package/dist/global-search/plugins/quick-access-plugin.js +34 -0
- package/dist/global-search/plugins/recent-searches-plugin.js +16 -0
- package/dist/global-search/search-highlight/highlight.js +13 -0
- package/dist/global-search/search-input/connected-search-input.js +22 -0
- package/dist/global-search/search-input/search-input.js +29 -0
- package/dist/global-search/search-input/search-input.module.css.js +3 -0
- package/dist/global-search/search-result-panel/panel-content.js +13 -0
- package/dist/global-search/search-result-panel/search-result-panel.js +17 -0
- package/dist/global-search/search-result-panel/search-result-panel.module.css.js +3 -0
- package/dist/global-search/search-result-panel/sections/no-search-results.js +30 -0
- package/dist/global-search/search-result-panel/sections/no-search.js +56 -0
- package/dist/global-search/search-result-panel/sections/search-content.module.css.js +3 -0
- package/dist/global-search/search-result-panel/sections/section-container.js +8 -0
- package/dist/global-search/search-result-panel/sections/with-results.js +101 -0
- package/dist/global-search/search-section/search-list-item.js +25 -0
- package/dist/global-search/search-section/search-list-item.module.css.js +3 -0
- package/dist/global-search/search-section/search-list.js +9 -0
- package/dist/global-search/search-section/search-list.module.css.js +3 -0
- package/dist/global-search/search-section/search-section.js +9 -0
- package/dist/global-search/search-section/search-section.module.css.js +3 -0
- package/dist/header/cart-icon/connected-cart-icon.js +14 -0
- package/dist/icons/glyph/glyphs-arrow-boldcaps-left-icon.js +7 -0
- package/dist/icons/glyph/glyphs-arrow-boldcaps-right-icon.js +7 -0
- package/dist/icons/glyph/glyphs-arrow-semibold-right-icon.js +7 -0
- package/dist/icons/glyph/glyphs-chevrons-bold-down-icon.js +7 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-down-icon.js +7 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-left-icon.js +7 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-right-icon.js +7 -0
- package/dist/icons/solid/solid-attention-icon.js +7 -0
- package/dist/icons/solid/solid-cart-icon.js +7 -0
- package/dist/icons/solid/solid-close-icon.js +7 -0
- package/dist/icons/solid/solid-event-icon.js +7 -0
- package/dist/icons/solid/solid-favorite-icon.js +7 -0
- package/dist/icons/solid/solid-home-icon.js +7 -0
- package/dist/icons/solid/solid-information-icon.js +7 -0
- package/dist/icons/solid/solid-news-icon.js +7 -0
- package/dist/icons/solid/solid-notice-icon.js +7 -0
- package/dist/icons/solid/solid-okay-icon.js +7 -0
- package/dist/icons/solid/solid-sale-icon.js +7 -0
- package/dist/icons/solid/solid-tag-icon.js +7 -0
- package/dist/icons/stroke/stroke-categories-icon.js +7 -0
- package/dist/icons/stroke/stroke-checkmark-icon.js +7 -0
- package/dist/icons/stroke/stroke-closebox-icon.js +7 -0
- package/dist/icons/stroke/stroke-collapse-icon.js +7 -0
- package/dist/icons/stroke/stroke-download-icon.js +7 -0
- package/dist/icons/stroke/stroke-expand-icon.js +7 -0
- package/dist/icons/stroke/stroke-favorite-icon.js +7 -0
- package/dist/icons/stroke/stroke-filter-icon.js +7 -0
- package/dist/icons/stroke/stroke-recent-icon.js +7 -0
- package/dist/icons/stroke/stroke-search-icon.js +7 -0
- package/dist/icons/stroke/stroke-trash-icon.js +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +254 -12972
- package/dist/intl/formatted-message.js +6 -0
- package/dist/intl/intl-context.js +10 -0
- package/dist/intl/intl-provider.js +15 -0
- package/dist/intl/types.js +17 -0
- package/dist/intl/use-culture-code.js +14 -0
- package/dist/intl/use-formatted-message.js +17 -0
- package/dist/intl/use-language-code.js +11 -0
- package/dist/intl/utils.js +29 -0
- package/dist/lists/download-document-list/download-document-list.js +16 -0
- package/dist/lists/download-document-list/download-document-list.module.css.js +3 -0
- package/dist/lists/feature-list/feature-list.js +22 -0
- package/dist/lists/feature-list/feature-list.module.css.js +3 -0
- package/dist/lists/orderline-list/orderline-list.js +25 -0
- package/dist/lists/orderline-list/orderline-list.module.css.js +3 -0
- package/dist/lists/product-overview-grid/product-overview-grid.js +10 -0
- package/dist/lists/product-overview-grid/product-overview-grid.module.css.js +3 -0
- package/dist/lists/ul/list.js +11 -0
- package/dist/lists/ul/list.module.css.js +3 -0
- package/dist/loading/blank-page-spacer.js +8 -0
- package/dist/loading/blank-page-spacer.module.css.js +3 -0
- package/dist/loading/loading-overlay.js +9 -0
- package/dist/loading/loading-overlay.module.css.js +3 -0
- package/dist/loading/progress-circle.js +9 -0
- package/dist/loading/progress-circle.module.css.js +3 -0
- package/dist/media/image/image.js +46 -0
- package/dist/media/image/image.module.css.js +3 -0
- package/dist/media/image-grid/images-grid.js +32 -0
- package/dist/media/image-grid/images-grid.module.css.js +3 -0
- package/dist/media/image-lightbox/image-lightbox.js +35 -0
- package/dist/media/image-lightbox/image-lightbox.module.css.js +3 -0
- package/dist/media/zoom-image/zoom-image.js +33 -0
- package/dist/media/zoom-image/zoom-image.module.css.js +3 -0
- package/dist/modals/confirmation/confirmation-dialog.js +12 -0
- package/dist/modals/confirmation/confirmation-dialog.module.css.js +3 -0
- package/dist/modals/dialog/dialog.js +30 -0
- package/dist/modals/dialog/dialog.module.css.js +3 -0
- package/dist/modals/favorite/add-to-favorite-dialog.js +60 -0
- package/dist/modals/favorite/add-to-favorite-dialog.module.css.js +3 -0
- package/dist/modals/modal/modal.js +34 -0
- package/dist/modals/modal/modal.module.css.js +3 -0
- package/dist/modals/signin/sign-in-dialog.js +22 -0
- package/dist/modals/signin/sign-in-dialog.module.css.js +3 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/routers/history.js +341 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/stateMappings/simple.js +36 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/utils/documentation.js +8 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/utils/logger.js +32 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/utils/noop.js +3 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js +24 -0
- package/dist/node_modules/.pnpm/qs@6.9.7/node_modules/qs/lib/formats.js +33 -0
- package/dist/node_modules/.pnpm/qs@6.9.7/node_modules/qs/lib/index.js +25 -0
- package/dist/node_modules/.pnpm/qs@6.9.7/node_modules/qs/lib/parse.js +269 -0
- package/dist/node_modules/.pnpm/qs@6.9.7/node_modules/qs/lib/stringify.js +300 -0
- package/dist/node_modules/.pnpm/qs@6.9.7/node_modules/qs/lib/utils.js +264 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/modules/free-mode.js +237 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/modules/navigation.js +200 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/modules/thumbs.js +193 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/create-element-if-not-defined.js +21 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/ssr-window.esm.js +145 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/swiper-core.js +3912 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/update-on-virtual-data.js +130 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/update-swiper.js +230 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/utils.js +287 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/swiper-react.js +389 -0
- package/dist/notifications/announcements/announcement-provider.js +32 -0
- package/dist/notifications/announcements/announcement-provider.module.css.js +3 -0
- package/dist/notifications/announcements/announcement.js +30 -0
- package/dist/notifications/announcements/announcement.module.css.js +3 -0
- package/dist/notifications/announcements/connected-announcement.js +27 -0
- package/dist/observers/intersection-observer.js +18 -0
- package/dist/pages/cart-page/cart-page.js +114 -0
- package/dist/pages/error-page/error-page.js +22 -0
- package/dist/pages/layouts/checkout-page-layout/checkout-page-layout.js +30 -0
- package/dist/pages/layouts/checkout-page-layout/checkout-page-layout.module.css.js +3 -0
- package/dist/pages/layouts/product-details-page-layout/product-details-page-layout.js +8 -0
- package/dist/pages/layouts/product-details-page-layout/product-details-page-layout.module.css.js +3 -0
- package/dist/pages/loading-page/loading-page.js +9 -0
- package/dist/pages/page/page.js +18 -0
- package/dist/pages/page/page.module.css.js +3 -0
- package/dist/pages/page-container/page-container.js +9 -0
- package/dist/pages/page-container/page-container.module.css.js +3 -0
- package/dist/pages/product-details-page/components/product-details-images/product-detail-images.js +35 -0
- package/dist/pages/product-details-page/components/product-details-images/product-detail-images.module.css.js +3 -0
- package/dist/pages/product-details-page/components/product-details-panel/product-details-panel.d.ts +3 -2
- package/dist/pages/product-details-page/components/product-details-panel/product-details-panel.js +35 -0
- package/dist/pages/product-details-page/components/product-details-panel/product-details-panel.module.css.js +3 -0
- package/dist/pages/product-details-page/components/product-details-recently-viewed/product-details-recently-viewed.d.ts +4 -0
- package/dist/pages/product-details-page/components/product-details-recently-viewed/product-details-recently-viewed.js +15 -0
- package/dist/pages/product-details-page/product-details-page.js +22 -0
- package/dist/pages/product-details-page/product-details.d.ts +6 -0
- package/dist/pages/product-details-page/product-details.js +25 -0
- package/dist/pages/product-listing-page/no-results/no-results.js +14 -0
- package/dist/pages/product-listing-page/no-results/no-results.module.css.js +3 -0
- package/dist/pages/product-listing-page/product-listing-page-category-carousel/product-listing-page-category-carousel.js +22 -0
- package/dist/pages/product-listing-page/product-listing-page-provider/product-listing-page-context.js +8 -0
- package/dist/pages/product-listing-page/product-listing-page-provider/product-listing-page-provider.js +13 -0
- package/dist/pages/product-listing-page/product-listing-page.js +29 -0
- package/dist/pages/product-listing-page/product-listing-page.module.css.js +3 -0
- package/dist/pages/product-listing-page/product-listing-product-overview/product-listing-product-overview.js +36 -0
- package/dist/pages/product-listing-page/product-listing.d.ts +6 -0
- package/dist/pages/product-listing-page/product-listing.js +42 -0
- package/dist/pages/search-result-page/search-result-product-overview/search-result-product-overview.js +38 -0
- package/dist/pages/search-result-page/search-results-page-category-carousel/search-results-page-category-carousel.js +22 -0
- package/dist/pages/search-result-page/search-results-page.js +49 -0
- package/dist/pages/search-result-page/search-results-page.module.css.js +3 -0
- package/dist/promos/promo-banner/promo-banner.js +11 -0
- package/dist/promos/promo-banner/promo-banner.module.css.js +3 -0
- package/dist/promos/promo-banners/promo-banners.js +16 -0
- package/dist/promos/promo-banners/promo-banners.module.css.js +3 -0
- package/dist/promos/promo-card/promo-card.js +11 -0
- package/dist/promos/promo-card/promo-card.module.css.js +3 -0
- package/dist/shared/api/bff/hooks/use-fetch-announcements.js +15 -0
- package/dist/shared/api/bff/hooks/use-fetch-product-details-page-data.js +14 -0
- package/dist/shared/api/bff/hooks/use-fetch-product-listing-page-data.js +14 -0
- package/dist/shared/api/bff/model/bff.model.d.ts +1 -1
- package/dist/shared/api/bff/model/bff.model.js +1 -0
- package/dist/shared/api/bff/services/bff-service.js +76 -0
- package/dist/shared/api/storefront/hooks/authentication/use-fetch-session.js +18 -0
- package/dist/shared/api/storefront/hooks/authentication/use-invalidate-session.js +9 -0
- package/dist/shared/api/storefront/hooks/authentication/use-is-authenticated.js +8 -0
- package/dist/shared/api/storefront/hooks/authentication/use-sign-in.js +21 -0
- package/dist/shared/api/storefront/hooks/authentication/use-sign-out.js +25 -0
- package/dist/shared/api/storefront/hooks/cart/use-add-product-to-current-cart.js +31 -0
- package/dist/shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js +23 -0
- package/dist/shared/api/storefront/hooks/cart/use-delete-current-cart.js +18 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-checkout-atp.js +15 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-count.js +8 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines-with-atp.js +11 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines.js +11 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-product-atp.js +15 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-promotions.js +15 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js +26 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.js +17 -0
- package/dist/shared/api/storefront/hooks/cart/use-invalidate-current-cart.js +9 -0
- package/dist/shared/api/storefront/hooks/cart/use-patch-cart.js +15 -0
- package/dist/shared/api/storefront/hooks/cart/use-place-order.js +15 -0
- package/dist/shared/api/storefront/hooks/cart/use-save-cart-for-later.js +17 -0
- package/dist/shared/api/storefront/hooks/cart/use-update-cart-line-by-id.js +30 -0
- package/dist/shared/api/storefront/hooks/translation/use-fetch-translations.js +15 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-countries-languages.js +15 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-countries-with-languages.js +15 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-countries.js +14 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-settings.js +18 -0
- package/dist/shared/api/storefront/hooks/website/use-update-locale.js +11 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist.js +34 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-wishlist.js +33 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-create-wishlist.js +17 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-delete-wishlist-item-from-wishlist.js +21 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-fetch-all-wishlists-items.js +36 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-fetch-wishlists.js +14 -0
- package/dist/shared/api/storefront/model/shop.model.js +42 -0
- package/dist/shared/api/storefront/services/authentication-service.js +80 -0
- package/dist/shared/api/storefront/services/cart-service.js +128 -0
- package/dist/shared/api/storefront/services/translation-service.js +16 -0
- package/dist/shared/api/storefront/services/website-service.js +83 -0
- package/dist/shared/api/storefront/services/wishlist-service.js +72 -0
- package/dist/shared/feature-flags/use-feature-flags.js +45 -0
- package/dist/shared/fetch/request.d.ts +5 -0
- package/dist/shared/fetch/request.js +263 -0
- package/dist/shared/hooks/use-breakpoint.js +24 -0
- package/dist/shared/hooks/use-cookie.js +27 -0
- package/dist/shared/hooks/use-debounced-callback.js +18 -0
- package/dist/shared/hooks/use-disclosure.js +24 -0
- package/dist/shared/hooks/use-enable-mobile-zoom.js +36 -0
- package/dist/shared/hooks/use-intersection-observer.js +66 -0
- package/dist/shared/hooks/use-is-breakpoint.js +19 -0
- package/dist/shared/hooks/use-local-storage.js +19 -0
- package/dist/shared/hooks/use-resize-observer.d.ts +2 -2
- package/dist/shared/hooks/use-resize-observer.js +30 -0
- package/dist/shared/hooks/use-scroll-lock.js +11 -0
- package/dist/shared/hooks/use-scroll-to.js +19 -0
- package/dist/shared/hooks/use-session-storage.js +19 -0
- package/dist/shared/hooks/use-watch-css-property.d.ts +1 -0
- package/dist/shared/hooks/use-watch-css-property.js +29 -0
- package/dist/shared/model/announcement.js +18 -0
- package/dist/shared/model/category.js +25 -0
- package/dist/shared/model/currency.js +29 -0
- package/dist/shared/model/hit.js +45 -0
- package/dist/shared/model/image.js +5 -0
- package/dist/shared/providers/cart-provider.js +13 -0
- package/dist/shared/providers/favorite-provider.js +33 -0
- package/dist/shared/providers/global-state-provider.js +83 -0
- package/dist/shared/providers/react-query-container.js +20 -0
- package/dist/shared/routing/route-button.js +7 -0
- package/dist/shared/routing/route-icon-button.js +7 -0
- package/dist/shared/routing/route-link.js +7 -0
- package/dist/shared/routing/route-provider.d.ts +3 -1
- package/dist/shared/routing/route-provider.js +48 -0
- package/dist/shared/routing/with-routing.js +36 -0
- package/dist/shared/utils/array.js +5 -0
- package/dist/shared/utils/breakpoints.js +33 -0
- package/dist/shared/utils/date.js +58 -0
- package/dist/shared/utils/environment.d.ts +2 -2
- package/dist/shared/utils/environment.js +61 -0
- package/dist/shared/utils/event-emitter.js +34 -0
- package/dist/shared/utils/local-storage.js +108 -0
- package/dist/shared/utils/merge.js +70 -0
- package/dist/shared/utils/price.js +6 -0
- package/dist/shared/utils/time.js +9 -0
- package/dist/shared/utils/uuid.js +15 -0
- package/dist/shared/utils/wait.js +5 -0
- package/dist/sidebar/sidebar-provider.js +46 -0
- package/dist/sidebar/sidebar-provider.module.css.js +3 -0
- package/dist/sidebar/sidebar.js +23 -0
- package/dist/sidebar/sidebar.module.css.js +3 -0
- package/dist/sidebar/toggle-sidebar-button.js +13 -0
- package/dist/sidebar/use-sidebar.js +38 -0
- package/dist/styles.css +5 -16
- package/dist/toast/toast-provider.js +9 -0
- package/dist/toast/toast-provider.module.css.js +3 -0
- package/dist/toast/toast.js +24 -0
- package/dist/toast/toast.module.css.js +3 -0
- package/dist/toast/use-toast.js +21 -0
- package/dist/tokens/tokens.js +8 -0
- package/dist/typography/heading/heading.js +27 -0
- package/dist/typography/heading/heading.module.css.js +3 -0
- package/package.json +3 -2
- package/dist/pages/product-listing-page/product-listing-page-provider/use-subcategories.d.ts +0 -4
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { __require as requireFormats } from './formats.js';
|
|
3
|
+
|
|
4
|
+
var utils;
|
|
5
|
+
var hasRequiredUtils;
|
|
6
|
+
|
|
7
|
+
function requireUtils () {
|
|
8
|
+
if (hasRequiredUtils) return utils;
|
|
9
|
+
hasRequiredUtils = 1;
|
|
10
|
+
|
|
11
|
+
var formats = requireFormats();
|
|
12
|
+
|
|
13
|
+
var has = Object.prototype.hasOwnProperty;
|
|
14
|
+
var isArray = Array.isArray;
|
|
15
|
+
|
|
16
|
+
var hexTable = (function () {
|
|
17
|
+
var array = [];
|
|
18
|
+
for (var i = 0; i < 256; ++i) {
|
|
19
|
+
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return array;
|
|
23
|
+
}());
|
|
24
|
+
|
|
25
|
+
var compactQueue = function compactQueue(queue) {
|
|
26
|
+
while (queue.length > 1) {
|
|
27
|
+
var item = queue.pop();
|
|
28
|
+
var obj = item.obj[item.prop];
|
|
29
|
+
|
|
30
|
+
if (isArray(obj)) {
|
|
31
|
+
var compacted = [];
|
|
32
|
+
|
|
33
|
+
for (var j = 0; j < obj.length; ++j) {
|
|
34
|
+
if (typeof obj[j] !== 'undefined') {
|
|
35
|
+
compacted.push(obj[j]);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
item.obj[item.prop] = compacted;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
var arrayToObject = function arrayToObject(source, options) {
|
|
45
|
+
var obj = options && options.plainObjects ? Object.create(null) : {};
|
|
46
|
+
for (var i = 0; i < source.length; ++i) {
|
|
47
|
+
if (typeof source[i] !== 'undefined') {
|
|
48
|
+
obj[i] = source[i];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return obj;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var merge = function merge(target, source, options) {
|
|
56
|
+
/* eslint no-param-reassign: 0 */
|
|
57
|
+
if (!source) {
|
|
58
|
+
return target;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (typeof source !== 'object') {
|
|
62
|
+
if (isArray(target)) {
|
|
63
|
+
target.push(source);
|
|
64
|
+
} else if (target && typeof target === 'object') {
|
|
65
|
+
if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
|
|
66
|
+
target[source] = true;
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
return [target, source];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return target;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (!target || typeof target !== 'object') {
|
|
76
|
+
return [target].concat(source);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
var mergeTarget = target;
|
|
80
|
+
if (isArray(target) && !isArray(source)) {
|
|
81
|
+
mergeTarget = arrayToObject(target, options);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (isArray(target) && isArray(source)) {
|
|
85
|
+
source.forEach(function (item, i) {
|
|
86
|
+
if (has.call(target, i)) {
|
|
87
|
+
var targetItem = target[i];
|
|
88
|
+
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
|
89
|
+
target[i] = merge(targetItem, item, options);
|
|
90
|
+
} else {
|
|
91
|
+
target.push(item);
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
target[i] = item;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return target;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
101
|
+
var value = source[key];
|
|
102
|
+
|
|
103
|
+
if (has.call(acc, key)) {
|
|
104
|
+
acc[key] = merge(acc[key], value, options);
|
|
105
|
+
} else {
|
|
106
|
+
acc[key] = value;
|
|
107
|
+
}
|
|
108
|
+
return acc;
|
|
109
|
+
}, mergeTarget);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
var assign = function assignSingleSource(target, source) {
|
|
113
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
114
|
+
acc[key] = source[key];
|
|
115
|
+
return acc;
|
|
116
|
+
}, target);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
var decode = function (str, decoder, charset) {
|
|
120
|
+
var strWithoutPlus = str.replace(/\+/g, ' ');
|
|
121
|
+
if (charset === 'iso-8859-1') {
|
|
122
|
+
// unescape never throws, no try...catch needed:
|
|
123
|
+
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
124
|
+
}
|
|
125
|
+
// utf-8
|
|
126
|
+
try {
|
|
127
|
+
return decodeURIComponent(strWithoutPlus);
|
|
128
|
+
} catch (e) {
|
|
129
|
+
return strWithoutPlus;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
134
|
+
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
135
|
+
// It has been adapted here for stricter adherence to RFC 3986
|
|
136
|
+
if (str.length === 0) {
|
|
137
|
+
return str;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
var string = str;
|
|
141
|
+
if (typeof str === 'symbol') {
|
|
142
|
+
string = Symbol.prototype.toString.call(str);
|
|
143
|
+
} else if (typeof str !== 'string') {
|
|
144
|
+
string = String(str);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (charset === 'iso-8859-1') {
|
|
148
|
+
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
|
149
|
+
return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var out = '';
|
|
154
|
+
for (var i = 0; i < string.length; ++i) {
|
|
155
|
+
var c = string.charCodeAt(i);
|
|
156
|
+
|
|
157
|
+
if (
|
|
158
|
+
c === 0x2D // -
|
|
159
|
+
|| c === 0x2E // .
|
|
160
|
+
|| c === 0x5F // _
|
|
161
|
+
|| c === 0x7E // ~
|
|
162
|
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
163
|
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
164
|
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
165
|
+
|| (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
166
|
+
) {
|
|
167
|
+
out += string.charAt(i);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (c < 0x80) {
|
|
172
|
+
out = out + hexTable[c];
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (c < 0x800) {
|
|
177
|
+
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
182
|
+
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
i += 1;
|
|
187
|
+
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
188
|
+
/* eslint operator-linebreak: [2, "before"] */
|
|
189
|
+
out += hexTable[0xF0 | (c >> 18)]
|
|
190
|
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
191
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
192
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return out;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
var compact = function compact(value) {
|
|
199
|
+
var queue = [{ obj: { o: value }, prop: 'o' }];
|
|
200
|
+
var refs = [];
|
|
201
|
+
|
|
202
|
+
for (var i = 0; i < queue.length; ++i) {
|
|
203
|
+
var item = queue[i];
|
|
204
|
+
var obj = item.obj[item.prop];
|
|
205
|
+
|
|
206
|
+
var keys = Object.keys(obj);
|
|
207
|
+
for (var j = 0; j < keys.length; ++j) {
|
|
208
|
+
var key = keys[j];
|
|
209
|
+
var val = obj[key];
|
|
210
|
+
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
211
|
+
queue.push({ obj: obj, prop: key });
|
|
212
|
+
refs.push(val);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
compactQueue(queue);
|
|
218
|
+
|
|
219
|
+
return value;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
var isRegExp = function isRegExp(obj) {
|
|
223
|
+
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
var isBuffer = function isBuffer(obj) {
|
|
227
|
+
if (!obj || typeof obj !== 'object') {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
var combine = function combine(a, b) {
|
|
235
|
+
return [].concat(a, b);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
var maybeMap = function maybeMap(val, fn) {
|
|
239
|
+
if (isArray(val)) {
|
|
240
|
+
var mapped = [];
|
|
241
|
+
for (var i = 0; i < val.length; i += 1) {
|
|
242
|
+
mapped.push(fn(val[i]));
|
|
243
|
+
}
|
|
244
|
+
return mapped;
|
|
245
|
+
}
|
|
246
|
+
return fn(val);
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
utils = {
|
|
250
|
+
arrayToObject: arrayToObject,
|
|
251
|
+
assign: assign,
|
|
252
|
+
combine: combine,
|
|
253
|
+
compact: compact,
|
|
254
|
+
decode: decode,
|
|
255
|
+
encode: encode,
|
|
256
|
+
isBuffer: isBuffer,
|
|
257
|
+
isRegExp: isRegExp,
|
|
258
|
+
maybeMap: maybeMap,
|
|
259
|
+
merge: merge
|
|
260
|
+
};
|
|
261
|
+
return utils;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export { requireUtils as __require };
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { d as now, k as elementTransitionEnd } from '../shared/utils.js';
|
|
2
|
+
|
|
3
|
+
function freeMode(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
swiper,
|
|
6
|
+
extendParams,
|
|
7
|
+
emit,
|
|
8
|
+
once
|
|
9
|
+
} = _ref;
|
|
10
|
+
extendParams({
|
|
11
|
+
freeMode: {
|
|
12
|
+
enabled: false,
|
|
13
|
+
momentum: true,
|
|
14
|
+
momentumRatio: 1,
|
|
15
|
+
momentumBounce: true,
|
|
16
|
+
momentumBounceRatio: 1,
|
|
17
|
+
momentumVelocityRatio: 1,
|
|
18
|
+
sticky: false,
|
|
19
|
+
minimumVelocity: 0.02
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
function onTouchStart() {
|
|
23
|
+
if (swiper.params.cssMode) return;
|
|
24
|
+
const translate = swiper.getTranslate();
|
|
25
|
+
swiper.setTranslate(translate);
|
|
26
|
+
swiper.setTransition(0);
|
|
27
|
+
swiper.touchEventsData.velocities.length = 0;
|
|
28
|
+
swiper.freeMode.onTouchEnd({
|
|
29
|
+
currentPos: swiper.rtl ? swiper.translate : -swiper.translate
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function onTouchMove() {
|
|
33
|
+
if (swiper.params.cssMode) return;
|
|
34
|
+
const {
|
|
35
|
+
touchEventsData: data,
|
|
36
|
+
touches
|
|
37
|
+
} = swiper;
|
|
38
|
+
// Velocity
|
|
39
|
+
if (data.velocities.length === 0) {
|
|
40
|
+
data.velocities.push({
|
|
41
|
+
position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],
|
|
42
|
+
time: data.touchStartTime
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
data.velocities.push({
|
|
46
|
+
position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],
|
|
47
|
+
time: now()
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function onTouchEnd(_ref2) {
|
|
51
|
+
let {
|
|
52
|
+
currentPos
|
|
53
|
+
} = _ref2;
|
|
54
|
+
if (swiper.params.cssMode) return;
|
|
55
|
+
const {
|
|
56
|
+
params,
|
|
57
|
+
wrapperEl,
|
|
58
|
+
rtlTranslate: rtl,
|
|
59
|
+
snapGrid,
|
|
60
|
+
touchEventsData: data
|
|
61
|
+
} = swiper;
|
|
62
|
+
// Time diff
|
|
63
|
+
const touchEndTime = now();
|
|
64
|
+
const timeDiff = touchEndTime - data.touchStartTime;
|
|
65
|
+
if (currentPos < -swiper.minTranslate()) {
|
|
66
|
+
swiper.slideTo(swiper.activeIndex);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (currentPos > -swiper.maxTranslate()) {
|
|
70
|
+
if (swiper.slides.length < snapGrid.length) {
|
|
71
|
+
swiper.slideTo(snapGrid.length - 1);
|
|
72
|
+
} else {
|
|
73
|
+
swiper.slideTo(swiper.slides.length - 1);
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (params.freeMode.momentum) {
|
|
78
|
+
if (data.velocities.length > 1) {
|
|
79
|
+
const lastMoveEvent = data.velocities.pop();
|
|
80
|
+
const velocityEvent = data.velocities.pop();
|
|
81
|
+
const distance = lastMoveEvent.position - velocityEvent.position;
|
|
82
|
+
const time = lastMoveEvent.time - velocityEvent.time;
|
|
83
|
+
swiper.velocity = distance / time;
|
|
84
|
+
swiper.velocity /= 2;
|
|
85
|
+
if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) {
|
|
86
|
+
swiper.velocity = 0;
|
|
87
|
+
}
|
|
88
|
+
// this implies that the user stopped moving a finger then released.
|
|
89
|
+
// There would be no events with distance zero, so the last event is stale.
|
|
90
|
+
if (time > 150 || now() - lastMoveEvent.time > 300) {
|
|
91
|
+
swiper.velocity = 0;
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
swiper.velocity = 0;
|
|
95
|
+
}
|
|
96
|
+
swiper.velocity *= params.freeMode.momentumVelocityRatio;
|
|
97
|
+
data.velocities.length = 0;
|
|
98
|
+
let momentumDuration = 1000 * params.freeMode.momentumRatio;
|
|
99
|
+
const momentumDistance = swiper.velocity * momentumDuration;
|
|
100
|
+
let newPosition = swiper.translate + momentumDistance;
|
|
101
|
+
if (rtl) newPosition = -newPosition;
|
|
102
|
+
let doBounce = false;
|
|
103
|
+
let afterBouncePosition;
|
|
104
|
+
const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio;
|
|
105
|
+
let needsLoopFix;
|
|
106
|
+
if (newPosition < swiper.maxTranslate()) {
|
|
107
|
+
if (params.freeMode.momentumBounce) {
|
|
108
|
+
if (newPosition + swiper.maxTranslate() < -bounceAmount) {
|
|
109
|
+
newPosition = swiper.maxTranslate() - bounceAmount;
|
|
110
|
+
}
|
|
111
|
+
afterBouncePosition = swiper.maxTranslate();
|
|
112
|
+
doBounce = true;
|
|
113
|
+
data.allowMomentumBounce = true;
|
|
114
|
+
} else {
|
|
115
|
+
newPosition = swiper.maxTranslate();
|
|
116
|
+
}
|
|
117
|
+
if (params.loop && params.centeredSlides) needsLoopFix = true;
|
|
118
|
+
} else if (newPosition > swiper.minTranslate()) {
|
|
119
|
+
if (params.freeMode.momentumBounce) {
|
|
120
|
+
if (newPosition - swiper.minTranslate() > bounceAmount) {
|
|
121
|
+
newPosition = swiper.minTranslate() + bounceAmount;
|
|
122
|
+
}
|
|
123
|
+
afterBouncePosition = swiper.minTranslate();
|
|
124
|
+
doBounce = true;
|
|
125
|
+
data.allowMomentumBounce = true;
|
|
126
|
+
} else {
|
|
127
|
+
newPosition = swiper.minTranslate();
|
|
128
|
+
}
|
|
129
|
+
if (params.loop && params.centeredSlides) needsLoopFix = true;
|
|
130
|
+
} else if (params.freeMode.sticky) {
|
|
131
|
+
let nextSlide;
|
|
132
|
+
for (let j = 0; j < snapGrid.length; j += 1) {
|
|
133
|
+
if (snapGrid[j] > -newPosition) {
|
|
134
|
+
nextSlide = j;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {
|
|
139
|
+
newPosition = snapGrid[nextSlide];
|
|
140
|
+
} else {
|
|
141
|
+
newPosition = snapGrid[nextSlide - 1];
|
|
142
|
+
}
|
|
143
|
+
newPosition = -newPosition;
|
|
144
|
+
}
|
|
145
|
+
if (needsLoopFix) {
|
|
146
|
+
once('transitionEnd', () => {
|
|
147
|
+
swiper.loopFix();
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
// Fix duration
|
|
151
|
+
if (swiper.velocity !== 0) {
|
|
152
|
+
if (rtl) {
|
|
153
|
+
momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);
|
|
154
|
+
} else {
|
|
155
|
+
momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);
|
|
156
|
+
}
|
|
157
|
+
if (params.freeMode.sticky) {
|
|
158
|
+
// If freeMode.sticky is active and the user ends a swipe with a slow-velocity
|
|
159
|
+
// event, then durations can be 20+ seconds to slide one (or zero!) slides.
|
|
160
|
+
// It's easy to see this when simulating touch with mouse events. To fix this,
|
|
161
|
+
// limit single-slide swipes to the default slide duration. This also has the
|
|
162
|
+
// nice side effect of matching slide speed if the user stopped moving before
|
|
163
|
+
// lifting finger or mouse vs. moving slowly before lifting the finger/mouse.
|
|
164
|
+
// For faster swipes, also apply limits (albeit higher ones).
|
|
165
|
+
const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);
|
|
166
|
+
const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];
|
|
167
|
+
if (moveDistance < currentSlideSize) {
|
|
168
|
+
momentumDuration = params.speed;
|
|
169
|
+
} else if (moveDistance < 2 * currentSlideSize) {
|
|
170
|
+
momentumDuration = params.speed * 1.5;
|
|
171
|
+
} else {
|
|
172
|
+
momentumDuration = params.speed * 2.5;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
} else if (params.freeMode.sticky) {
|
|
176
|
+
swiper.slideToClosest();
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (params.freeMode.momentumBounce && doBounce) {
|
|
180
|
+
swiper.updateProgress(afterBouncePosition);
|
|
181
|
+
swiper.setTransition(momentumDuration);
|
|
182
|
+
swiper.setTranslate(newPosition);
|
|
183
|
+
swiper.transitionStart(true, swiper.swipeDirection);
|
|
184
|
+
swiper.animating = true;
|
|
185
|
+
elementTransitionEnd(wrapperEl, () => {
|
|
186
|
+
if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;
|
|
187
|
+
emit('momentumBounce');
|
|
188
|
+
swiper.setTransition(params.speed);
|
|
189
|
+
setTimeout(() => {
|
|
190
|
+
swiper.setTranslate(afterBouncePosition);
|
|
191
|
+
elementTransitionEnd(wrapperEl, () => {
|
|
192
|
+
if (!swiper || swiper.destroyed) return;
|
|
193
|
+
swiper.transitionEnd();
|
|
194
|
+
});
|
|
195
|
+
}, 0);
|
|
196
|
+
});
|
|
197
|
+
} else if (swiper.velocity) {
|
|
198
|
+
emit('_freeModeNoMomentumRelease');
|
|
199
|
+
swiper.updateProgress(newPosition);
|
|
200
|
+
swiper.setTransition(momentumDuration);
|
|
201
|
+
swiper.setTranslate(newPosition);
|
|
202
|
+
swiper.transitionStart(true, swiper.swipeDirection);
|
|
203
|
+
if (!swiper.animating) {
|
|
204
|
+
swiper.animating = true;
|
|
205
|
+
elementTransitionEnd(wrapperEl, () => {
|
|
206
|
+
if (!swiper || swiper.destroyed) return;
|
|
207
|
+
swiper.transitionEnd();
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
} else {
|
|
211
|
+
swiper.updateProgress(newPosition);
|
|
212
|
+
}
|
|
213
|
+
swiper.updateActiveIndex();
|
|
214
|
+
swiper.updateSlidesClasses();
|
|
215
|
+
} else if (params.freeMode.sticky) {
|
|
216
|
+
swiper.slideToClosest();
|
|
217
|
+
return;
|
|
218
|
+
} else if (params.freeMode) {
|
|
219
|
+
emit('_freeModeNoMomentumRelease');
|
|
220
|
+
}
|
|
221
|
+
if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) {
|
|
222
|
+
emit('_freeModeStaticRelease');
|
|
223
|
+
swiper.updateProgress();
|
|
224
|
+
swiper.updateActiveIndex();
|
|
225
|
+
swiper.updateSlidesClasses();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
Object.assign(swiper, {
|
|
229
|
+
freeMode: {
|
|
230
|
+
onTouchStart,
|
|
231
|
+
onTouchMove,
|
|
232
|
+
onTouchEnd
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export { freeMode as default };
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { c as createElementIfNotDefined } from '../shared/create-element-if-not-defined.js';
|
|
2
|
+
import { m as makeElementsArray } from '../shared/utils.js';
|
|
3
|
+
|
|
4
|
+
function Navigation(_ref) {
|
|
5
|
+
let {
|
|
6
|
+
swiper,
|
|
7
|
+
extendParams,
|
|
8
|
+
on,
|
|
9
|
+
emit
|
|
10
|
+
} = _ref;
|
|
11
|
+
extendParams({
|
|
12
|
+
navigation: {
|
|
13
|
+
nextEl: null,
|
|
14
|
+
prevEl: null,
|
|
15
|
+
hideOnClick: false,
|
|
16
|
+
disabledClass: 'swiper-button-disabled',
|
|
17
|
+
hiddenClass: 'swiper-button-hidden',
|
|
18
|
+
lockClass: 'swiper-button-lock',
|
|
19
|
+
navigationDisabledClass: 'swiper-navigation-disabled'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
swiper.navigation = {
|
|
23
|
+
nextEl: null,
|
|
24
|
+
prevEl: null
|
|
25
|
+
};
|
|
26
|
+
function getEl(el) {
|
|
27
|
+
let res;
|
|
28
|
+
if (el && typeof el === 'string' && swiper.isElement) {
|
|
29
|
+
res = swiper.el.querySelector(el) || swiper.hostEl.querySelector(el);
|
|
30
|
+
if (res) return res;
|
|
31
|
+
}
|
|
32
|
+
if (el) {
|
|
33
|
+
if (typeof el === 'string') res = [...document.querySelectorAll(el)];
|
|
34
|
+
if (swiper.params.uniqueNavElements && typeof el === 'string' && res && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
|
|
35
|
+
res = swiper.el.querySelector(el);
|
|
36
|
+
} else if (res && res.length === 1) {
|
|
37
|
+
res = res[0];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (el && !res) return el;
|
|
41
|
+
// if (Array.isArray(res) && res.length === 1) res = res[0];
|
|
42
|
+
return res;
|
|
43
|
+
}
|
|
44
|
+
function toggleEl(el, disabled) {
|
|
45
|
+
const params = swiper.params.navigation;
|
|
46
|
+
el = makeElementsArray(el);
|
|
47
|
+
el.forEach(subEl => {
|
|
48
|
+
if (subEl) {
|
|
49
|
+
subEl.classList[disabled ? 'add' : 'remove'](...params.disabledClass.split(' '));
|
|
50
|
+
if (subEl.tagName === 'BUTTON') subEl.disabled = disabled;
|
|
51
|
+
if (swiper.params.watchOverflow && swiper.enabled) {
|
|
52
|
+
subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function update() {
|
|
58
|
+
// Update Navigation Buttons
|
|
59
|
+
const {
|
|
60
|
+
nextEl,
|
|
61
|
+
prevEl
|
|
62
|
+
} = swiper.navigation;
|
|
63
|
+
if (swiper.params.loop) {
|
|
64
|
+
toggleEl(prevEl, false);
|
|
65
|
+
toggleEl(nextEl, false);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind);
|
|
69
|
+
toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind);
|
|
70
|
+
}
|
|
71
|
+
function onPrevClick(e) {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;
|
|
74
|
+
swiper.slidePrev();
|
|
75
|
+
emit('navigationPrev');
|
|
76
|
+
}
|
|
77
|
+
function onNextClick(e) {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;
|
|
80
|
+
swiper.slideNext();
|
|
81
|
+
emit('navigationNext');
|
|
82
|
+
}
|
|
83
|
+
function init() {
|
|
84
|
+
const params = swiper.params.navigation;
|
|
85
|
+
swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, {
|
|
86
|
+
nextEl: 'swiper-button-next',
|
|
87
|
+
prevEl: 'swiper-button-prev'
|
|
88
|
+
});
|
|
89
|
+
if (!(params.nextEl || params.prevEl)) return;
|
|
90
|
+
let nextEl = getEl(params.nextEl);
|
|
91
|
+
let prevEl = getEl(params.prevEl);
|
|
92
|
+
Object.assign(swiper.navigation, {
|
|
93
|
+
nextEl,
|
|
94
|
+
prevEl
|
|
95
|
+
});
|
|
96
|
+
nextEl = makeElementsArray(nextEl);
|
|
97
|
+
prevEl = makeElementsArray(prevEl);
|
|
98
|
+
const initButton = (el, dir) => {
|
|
99
|
+
if (el) {
|
|
100
|
+
el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
|
|
101
|
+
}
|
|
102
|
+
if (!swiper.enabled && el) {
|
|
103
|
+
el.classList.add(...params.lockClass.split(' '));
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
nextEl.forEach(el => initButton(el, 'next'));
|
|
107
|
+
prevEl.forEach(el => initButton(el, 'prev'));
|
|
108
|
+
}
|
|
109
|
+
function destroy() {
|
|
110
|
+
let {
|
|
111
|
+
nextEl,
|
|
112
|
+
prevEl
|
|
113
|
+
} = swiper.navigation;
|
|
114
|
+
nextEl = makeElementsArray(nextEl);
|
|
115
|
+
prevEl = makeElementsArray(prevEl);
|
|
116
|
+
const destroyButton = (el, dir) => {
|
|
117
|
+
el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
|
|
118
|
+
el.classList.remove(...swiper.params.navigation.disabledClass.split(' '));
|
|
119
|
+
};
|
|
120
|
+
nextEl.forEach(el => destroyButton(el, 'next'));
|
|
121
|
+
prevEl.forEach(el => destroyButton(el, 'prev'));
|
|
122
|
+
}
|
|
123
|
+
on('init', () => {
|
|
124
|
+
if (swiper.params.navigation.enabled === false) {
|
|
125
|
+
// eslint-disable-next-line
|
|
126
|
+
disable();
|
|
127
|
+
} else {
|
|
128
|
+
init();
|
|
129
|
+
update();
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
on('toEdge fromEdge lock unlock', () => {
|
|
133
|
+
update();
|
|
134
|
+
});
|
|
135
|
+
on('destroy', () => {
|
|
136
|
+
destroy();
|
|
137
|
+
});
|
|
138
|
+
on('enable disable', () => {
|
|
139
|
+
let {
|
|
140
|
+
nextEl,
|
|
141
|
+
prevEl
|
|
142
|
+
} = swiper.navigation;
|
|
143
|
+
nextEl = makeElementsArray(nextEl);
|
|
144
|
+
prevEl = makeElementsArray(prevEl);
|
|
145
|
+
if (swiper.enabled) {
|
|
146
|
+
update();
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
[...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.add(swiper.params.navigation.lockClass));
|
|
150
|
+
});
|
|
151
|
+
on('click', (_s, e) => {
|
|
152
|
+
let {
|
|
153
|
+
nextEl,
|
|
154
|
+
prevEl
|
|
155
|
+
} = swiper.navigation;
|
|
156
|
+
nextEl = makeElementsArray(nextEl);
|
|
157
|
+
prevEl = makeElementsArray(prevEl);
|
|
158
|
+
const targetEl = e.target;
|
|
159
|
+
let targetIsButton = prevEl.includes(targetEl) || nextEl.includes(targetEl);
|
|
160
|
+
if (swiper.isElement && !targetIsButton) {
|
|
161
|
+
const path = e.path || e.composedPath && e.composedPath();
|
|
162
|
+
if (path) {
|
|
163
|
+
targetIsButton = path.find(pathEl => nextEl.includes(pathEl) || prevEl.includes(pathEl));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (swiper.params.navigation.hideOnClick && !targetIsButton) {
|
|
167
|
+
if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
|
|
168
|
+
let isHidden;
|
|
169
|
+
if (nextEl.length) {
|
|
170
|
+
isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass);
|
|
171
|
+
} else if (prevEl.length) {
|
|
172
|
+
isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass);
|
|
173
|
+
}
|
|
174
|
+
if (isHidden === true) {
|
|
175
|
+
emit('navigationShow');
|
|
176
|
+
} else {
|
|
177
|
+
emit('navigationHide');
|
|
178
|
+
}
|
|
179
|
+
[...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.toggle(swiper.params.navigation.hiddenClass));
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
const enable = () => {
|
|
183
|
+
swiper.el.classList.remove(...swiper.params.navigation.navigationDisabledClass.split(' '));
|
|
184
|
+
init();
|
|
185
|
+
update();
|
|
186
|
+
};
|
|
187
|
+
const disable = () => {
|
|
188
|
+
swiper.el.classList.add(...swiper.params.navigation.navigationDisabledClass.split(' '));
|
|
189
|
+
destroy();
|
|
190
|
+
};
|
|
191
|
+
Object.assign(swiper.navigation, {
|
|
192
|
+
enable,
|
|
193
|
+
disable,
|
|
194
|
+
update,
|
|
195
|
+
init,
|
|
196
|
+
destroy
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export { Navigation as default };
|