vviinn-widgets 2.1.0 → 2.2.2
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/cjs/Handler-d1a8a86a.js +329 -0
- package/dist/{vviinn-widgets/app-globals-e0943e34.js → cjs/app-globals-30781f30.js} +15 -925
- package/{www/build/cropper-handler.entry.js → dist/cjs/cropper-handler.cjs.entry.js} +11 -7
- package/dist/{vviinn-widgets/customized-slots-f3449695.js → cjs/customized-slots-5d904d8e.js} +6 -3
- package/dist/cjs/highlight-box_22.cjs.entry.js +737 -0
- package/{www/build/imageSearch.store-407f49f0.js → dist/cjs/imageSearch.store-128957a4.js} +11573 -11902
- package/dist/cjs/index-741a970d.js +1354 -0
- package/dist/cjs/index-c493804d.js +41 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +23 -0
- package/dist/cjs/vviinn-carousel_5.cjs.entry.js +1232 -0
- package/dist/{vviinn-widgets/vviinn-error.entry.js → cjs/vviinn-error.cjs.entry.js} +8 -4
- package/{www/build/vviinn-preloader.entry.js → dist/cjs/vviinn-preloader.cjs.entry.js} +11 -10
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +43 -0
- package/{www/build/vviinn-vps-widget.entry.js → dist/cjs/vviinn-vps-widget.cjs.entry.js} +31 -30
- package/dist/cjs/vviinn-widgets.cjs.js +21 -0
- package/dist/collection/Image/error.js +14 -0
- package/dist/collection/Image/form.js +5 -0
- package/dist/collection/Image/fromFile.js +18 -0
- package/dist/collection/Image/imageToB64.js +9 -0
- package/dist/collection/Image/index.js +0 -0
- package/dist/collection/Image/renderPromise.js +6 -0
- package/dist/collection/Image/resizeImage.js +28 -0
- package/dist/collection/Image/sizing.js +39 -0
- package/dist/collection/Image/toFile.js +17 -0
- package/dist/collection/analytics/GAnalytics.js +32 -0
- package/dist/collection/analytics/GeneralAnalytics.js +9 -0
- package/dist/collection/analytics/GtagAnalytics.js +35 -0
- package/dist/collection/analytics/ProductAnalytics.js +1 -0
- package/dist/collection/campaign/Campaign.js +8 -0
- package/dist/collection/campaign/CampaignService.js +5 -0
- package/dist/collection/campaign/VCSCampaign.js +1 -0
- package/dist/collection/campaign/VCSCampaignResponse.js +1 -0
- package/dist/collection/campaign/VCSCampaignService.js +5 -0
- package/dist/collection/campaign/VPRCampaignResponse.js +1 -0
- package/dist/collection/campaign/VPRCampaignService.js +5 -0
- package/dist/collection/collection-manifest.json +43 -0
- package/dist/collection/components/customized-slots.js +47 -0
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.css +71 -0
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.js +25 -0
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.css +49 -0
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js +64 -0
- package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.css +33 -0
- package/dist/{vviinn-widgets/image-cropper.entry.js → collection/components/image-search/image-view/image-cropper/image-cropper.js} +54 -32
- package/dist/collection/components/image-search/search-filters/search-filters.css +120 -0
- package/dist/collection/components/image-search/search-filters/search-filters.js +102 -0
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +138 -0
- package/{www/build/vviinn-carousel.entry.js → dist/collection/components/vviinn-carousel/vviinn-carousel.js} +115 -18
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.css +7 -0
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +36 -0
- package/dist/collection/components/vviinn-error/vviinn-error.css +38 -0
- package/dist/collection/components/vviinn-error/vviinn-error.js +18 -0
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.css +3 -0
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +34 -0
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.css +3 -0
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +34 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.css +34 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +129 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.css +19 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +80 -0
- package/dist/{vviinn-widgets/index-c9483145.js → collection/components/vviinn-icons/index.js} +13 -12
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.css +25 -0
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +64 -0
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.css +47 -0
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +83 -0
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +31 -0
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +61 -0
- package/dist/collection/components/vviinn-modal/vviinn-modal.css +105 -0
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +98 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/onboarding-card.css +41 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +26 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +26 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +26 -0
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.css +58 -0
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +28 -0
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.css +33 -0
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +15 -0
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.css +29 -0
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +71 -0
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.css +37 -0
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +20 -0
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.css +19 -0
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +27 -0
- package/dist/collection/components/vviinn-product-card/render-helpers.js +32 -0
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.css +95 -0
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +425 -0
- package/dist/collection/components/vviinn-slider/arrow.js +11 -0
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.css +4 -0
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +15 -0
- package/dist/collection/components/vviinn-slider/vviinn-slider.css +109 -0
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +181 -0
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.css +14 -0
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +29 -0
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +238 -0
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +200 -0
- package/dist/collection/components/vviinn-vpr-button/stories/kek.stories.js +18 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.css +35 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +149 -0
- package/dist/collection/components/vviinn-vpr-widget/GridMode.js +1 -0
- package/dist/collection/components/vviinn-vpr-widget/token-helpers.js +11 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +441 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +74 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +0 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +177 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +350 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +247 -0
- package/dist/collection/cropper/Cropper.js +1 -0
- package/dist/collection/cropper/Handler.js +61 -0
- package/dist/collection/dom/index.js +3 -0
- package/dist/collection/error.js +14 -0
- package/dist/collection/file/index.js +4 -0
- package/dist/collection/geometry/Clip.js +14 -0
- package/dist/collection/geometry/Point.js +32 -0
- package/dist/collection/geometry/Rectangle.js +95 -0
- package/dist/collection/geometry/RectangleAlt.js +1 -0
- package/dist/collection/geometry/Sized.js +8 -0
- package/dist/collection/global.js +19 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/interfaces/generated.js +5 -0
- package/dist/collection/interfaces/recommendation.js +1 -0
- package/dist/collection/network/apiClient.js +9 -0
- package/dist/collection/network/ion/File.js +14 -0
- package/dist/collection/network/ion/Form.js +64 -0
- package/dist/collection/network/ion/Link.js +8 -0
- package/dist/collection/network/ion/ValueObject.js +23 -0
- package/dist/collection/network/request.js +19 -0
- package/dist/collection/network/utils.js +37 -0
- package/dist/collection/recommendation/recommendation.js +1 -0
- package/dist/collection/searchSession/searchSession.js +26 -0
- package/dist/collection/sentry.js +14 -0
- package/dist/collection/slider/GridMode.js +1 -0
- package/dist/collection/store/file-processing.js +13 -0
- package/dist/collection/store/imageSearch.store.js +138 -0
- package/dist/collection/store/store.js +11 -0
- package/dist/collection/stories/Button.js +21 -0
- package/dist/collection/stories/Button.stories.js +42 -0
- package/dist/collection/stories/Header.js +45 -0
- package/dist/collection/stories/Header.stories.js +15 -0
- package/dist/collection/stories/Page.js +61 -0
- package/dist/collection/stories/Page.stories.js +19 -0
- package/dist/collection/stories/assets/code-brackets.svg +1 -0
- package/dist/collection/stories/assets/colors.svg +1 -0
- package/dist/collection/stories/assets/comments.svg +1 -0
- package/dist/collection/stories/assets/direction.svg +1 -0
- package/dist/collection/stories/assets/flow.svg +1 -0
- package/dist/collection/stories/assets/plugin.svg +1 -0
- package/dist/collection/stories/assets/repo.svg +1 -0
- package/dist/collection/stories/assets/stackalt.svg +1 -0
- package/dist/collection/stories/image-selector.stories.js +6 -0
- package/dist/collection/stories/image-view.stories.js +6 -0
- package/dist/collection/stories/modal.stories.js +12 -0
- package/dist/collection/stories/onboarding.stories.js +11 -0
- package/dist/collection/stories/overlay.stories.js +5 -0
- package/dist/collection/stories/overlayedModal.stories.js +8 -0
- package/dist/collection/stories/privacy-badge.stories.js +11 -0
- package/dist/collection/stories/slider.stories.js +17 -0
- package/dist/collection/stories/teaser.stories.js +5 -0
- package/dist/collection/stories/vps-widget.stories.js +47 -0
- package/dist/collection/stories/vviinn-product.stories.js +19 -0
- package/dist/collection/utils/collections/collectionsUtils.js +5 -0
- package/dist/collection/utils/either.js +3 -0
- package/dist/collection/utils/enum/enumUtils.js +3 -0
- package/dist/collection/utils/event/Events.js +1 -0
- package/dist/collection/utils/number/index.js +4 -0
- package/dist/collection/utils/option/option.js +4 -0
- package/dist/collection/utils/semigroup/semigroupDiff.js +6 -0
- package/dist/collection/utils/token/tokenUtils.js +9 -0
- package/dist/esm/Handler-639a4cb3.js +308 -0
- package/{www/build/app-globals-e0943e34.js → dist/esm/app-globals-345e497d.js} +10 -922
- package/dist/{vviinn-widgets → esm}/cropper-handler.entry.js +2 -2
- package/{www/build/customized-slots-f3449695.js → dist/esm/customized-slots-a76a8d41.js} +1 -1
- package/dist/esm/highlight-box_22.entry.js +712 -0
- package/dist/{vviinn-widgets/imageSearch.store-407f49f0.js → esm/imageSearch.store-8eab0da1.js} +11510 -11872
- package/dist/esm/index-6fa21e24.js +1323 -0
- package/{www/build/index-c9483145.js → dist/esm/index-8cb063df.js} +6 -4
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +19 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/vviinn-carousel_5.entry.js +1224 -0
- package/{www/build → dist/esm}/vviinn-error.entry.js +1 -1
- package/dist/{vviinn-widgets → esm}/vviinn-preloader.entry.js +3 -6
- package/dist/{vviinn-widgets → esm}/vviinn-vps-button.entry.js +3 -3
- package/dist/{vviinn-widgets → esm}/vviinn-vps-widget.entry.js +4 -7
- package/dist/esm/vviinn-widgets.js +19 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +3 -0
- package/dist/loader/index.cjs.js +3 -0
- package/dist/loader/index.d.ts +12 -0
- package/dist/loader/index.es2017.js +3 -0
- package/dist/loader/index.js +4 -0
- package/dist/loader/package.json +10 -0
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +1 -0
- package/dist/types/components/vviinn-icons/index.d.ts +2 -0
- package/dist/types/components/vviinn-product-card/render-helpers.d.ts +3 -2
- package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +2 -0
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +25 -0
- package/dist/types/components/vviinn-vpr-button/stories/kek.stories.d.ts +7 -0
- package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +14 -0
- package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +13 -3
- package/dist/types/components.d.ts +54 -0
- package/dist/vviinn-widgets/index.esm.js +0 -1
- package/dist/vviinn-widgets/p-04b06ea9.entry.js +1 -0
- package/dist/vviinn-widgets/p-400eb62f.entry.js +1 -0
- package/dist/vviinn-widgets/p-56fc949a.js +1 -0
- package/dist/vviinn-widgets/p-59edfbe2.js +1 -0
- package/dist/vviinn-widgets/p-78ccc9eb.js +15 -0
- package/dist/vviinn-widgets/p-9d24f51e.entry.js +1 -0
- package/dist/vviinn-widgets/p-d085199d.entry.js +1 -0
- package/dist/vviinn-widgets/p-e1ba8626.js +1 -0
- package/dist/vviinn-widgets/p-e38f4aa2.entry.js +1 -0
- package/dist/vviinn-widgets/p-e67cae57.js +1 -0
- package/dist/vviinn-widgets/p-f47e82b2.entry.js +1 -0
- package/dist/vviinn-widgets/p-f582db5c.js +1 -0
- package/dist/vviinn-widgets/p-fb14e3cc.entry.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.css +1 -6
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -125
- package/package.json +3 -1
- package/www/build/index.esm.js +0 -1
- package/www/build/p-04b06ea9.entry.js +1 -0
- package/www/build/p-400eb62f.entry.js +1 -0
- package/www/build/p-56fc949a.js +1 -0
- package/www/build/p-59edfbe2.js +1 -0
- package/www/build/p-78ccc9eb.js +15 -0
- package/www/build/p-7e4978d5.js +1 -0
- package/www/build/p-9d24f51e.entry.js +1 -0
- package/www/build/p-a67898be.css +1 -0
- package/www/build/p-d085199d.entry.js +1 -0
- package/www/build/p-e1ba8626.js +1 -0
- package/www/build/p-e38f4aa2.entry.js +1 -0
- package/www/build/p-e67cae57.js +1 -0
- package/www/build/p-f47e82b2.entry.js +1 -0
- package/www/build/p-f582db5c.js +1 -0
- package/www/build/p-fb14e3cc.entry.js +1 -0
- package/www/build/vviinn-widgets.css +1 -6
- package/www/build/vviinn-widgets.esm.js +1 -125
- package/www/index.html +6 -13
- package/dist/vviinn-widgets/Array-4b9f84cf.js +0 -4295
- package/dist/vviinn-widgets/Handler-47db9890.js +0 -1428
- package/dist/vviinn-widgets/NonEmptyArray-6ef0d207.js +0 -4370
- package/dist/vviinn-widgets/css-shim-f0027935.js +0 -4
- package/dist/vviinn-widgets/dom-db0073f0.js +0 -73
- package/dist/vviinn-widgets/highlight-box.entry.js +0 -41
- package/dist/vviinn-widgets/index-b6d739a9.js +0 -3010
- package/dist/vviinn-widgets/number-98d54dd6.js +0 -1533
- package/dist/vviinn-widgets/search-filters.entry.js +0 -73
- package/dist/vviinn-widgets/shadow-css-c1fdfa9f.js +0 -389
- package/dist/vviinn-widgets/vviinn-carousel.entry.js +0 -205
- package/dist/vviinn-widgets/vviinn-detected-object.entry.js +0 -52
- package/dist/vviinn-widgets/vviinn-empty-results.entry.js +0 -16
- package/dist/vviinn-widgets/vviinn-example-image.entry.js +0 -38
- package/dist/vviinn-widgets/vviinn-example-images.entry.js +0 -28
- package/dist/vviinn-widgets/vviinn-image-selector.entry.js +0 -31
- package/dist/vviinn-widgets/vviinn-image-view.entry.js +0 -55
- package/dist/vviinn-widgets/vviinn-modal.entry.js +0 -30
- package/dist/vviinn-widgets/vviinn-onboarding-card-1.entry.js +0 -21
- package/dist/vviinn-widgets/vviinn-onboarding-card-2.entry.js +0 -21
- package/dist/vviinn-widgets/vviinn-onboarding-card-3.entry.js +0 -21
- package/dist/vviinn-widgets/vviinn-onboarding.entry.js +0 -20
- package/dist/vviinn-widgets/vviinn-overlay.entry.js +0 -15
- package/dist/vviinn-widgets/vviinn-overlayed-modal.entry.js +0 -18
- package/dist/vviinn-widgets/vviinn-privacy-badge.entry.js +0 -20
- package/dist/vviinn-widgets/vviinn-product-card.entry.js +0 -176
- package/dist/vviinn-widgets/vviinn-server-error.entry.js +0 -16
- package/dist/vviinn-widgets/vviinn-slide.entry.js +0 -15
- package/dist/vviinn-widgets/vviinn-slider.entry.js +0 -120
- package/dist/vviinn-widgets/vviinn-teaser.entry.js +0 -20
- package/dist/vviinn-widgets/vviinn-vpr-widget.entry.js +0 -128
- package/dist/vviinn-widgets/vviinn-wrong-format.entry.js +0 -16
- package/www/build/Array-4b9f84cf.js +0 -4295
- package/www/build/Handler-47db9890.js +0 -1428
- package/www/build/NonEmptyArray-6ef0d207.js +0 -4370
- package/www/build/css-shim-f0027935.js +0 -4
- package/www/build/dom-db0073f0.js +0 -73
- package/www/build/highlight-box.entry.js +0 -41
- package/www/build/image-cropper.entry.js +0 -113
- package/www/build/index-b6d739a9.js +0 -3010
- package/www/build/number-98d54dd6.js +0 -1533
- package/www/build/search-filters.entry.js +0 -73
- package/www/build/shadow-css-c1fdfa9f.js +0 -389
- package/www/build/vviinn-detected-object.entry.js +0 -52
- package/www/build/vviinn-empty-results.entry.js +0 -16
- package/www/build/vviinn-example-image.entry.js +0 -38
- package/www/build/vviinn-example-images.entry.js +0 -28
- package/www/build/vviinn-image-selector.entry.js +0 -31
- package/www/build/vviinn-image-view.entry.js +0 -55
- package/www/build/vviinn-modal.entry.js +0 -30
- package/www/build/vviinn-onboarding-card-1.entry.js +0 -21
- package/www/build/vviinn-onboarding-card-2.entry.js +0 -21
- package/www/build/vviinn-onboarding-card-3.entry.js +0 -21
- package/www/build/vviinn-onboarding.entry.js +0 -20
- package/www/build/vviinn-overlay.entry.js +0 -15
- package/www/build/vviinn-overlayed-modal.entry.js +0 -18
- package/www/build/vviinn-privacy-badge.entry.js +0 -20
- package/www/build/vviinn-product-card.entry.js +0 -176
- package/www/build/vviinn-server-error.entry.js +0 -16
- package/www/build/vviinn-slide.entry.js +0 -15
- package/www/build/vviinn-slider.entry.js +0 -120
- package/www/build/vviinn-teaser.entry.js +0 -20
- package/www/build/vviinn-vpr-widget.entry.js +0 -128
- package/www/build/vviinn-vps-button.entry.js +0 -39
- package/www/build/vviinn-wrong-format.entry.js +0 -16
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { Component, Host, h, Element, State, Prop, Watch } from "@stencil/core";
|
|
2
|
+
import { range } from "fp-ts/lib/NonEmptyArray";
|
|
3
|
+
import { pipe } from "fp-ts/lib/function";
|
|
4
|
+
import * as O from "fp-ts/lib/Option";
|
|
5
|
+
import * as N from "fp-ts/number";
|
|
6
|
+
import { sequenceToOption } from "../../utils/option/option";
|
|
7
|
+
import { Arrow } from "./arrow";
|
|
8
|
+
export class VviinnSlider {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.elementsCount = 0;
|
|
11
|
+
this.internalPosition = 0;
|
|
12
|
+
this.swipeStartPosition = O.none;
|
|
13
|
+
this.showBullets = true;
|
|
14
|
+
this.position = 0;
|
|
15
|
+
this.showArrows = false;
|
|
16
|
+
}
|
|
17
|
+
positionWatchHandler(newValue) {
|
|
18
|
+
this.internalPosition = newValue;
|
|
19
|
+
this.el.style.setProperty("--position", `${newValue}`);
|
|
20
|
+
this.setActiveCssClassToSlide(newValue);
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
this.handleDomContentChanges();
|
|
24
|
+
}
|
|
25
|
+
handleDomContentChanges() {
|
|
26
|
+
const items = this.el.querySelectorAll("vviinn-slide");
|
|
27
|
+
this.elementsCount = items.length;
|
|
28
|
+
this.el.style.setProperty("--num-items", `${this.elementsCount}`);
|
|
29
|
+
this.setActiveCssClassToSlide(0);
|
|
30
|
+
}
|
|
31
|
+
setActiveCssClassToSlide(index) {
|
|
32
|
+
const items = this.el.querySelectorAll("vviinn-slide");
|
|
33
|
+
items.forEach((i) => i.classList.remove("active"));
|
|
34
|
+
items[index].classList.add("active");
|
|
35
|
+
}
|
|
36
|
+
goToSlide(index) {
|
|
37
|
+
this.internalPosition = index;
|
|
38
|
+
this.el.style.setProperty("--position", `${index}`);
|
|
39
|
+
this.setActiveCssClassToSlide(index);
|
|
40
|
+
}
|
|
41
|
+
renderBullets() {
|
|
42
|
+
return this.showBullets ? (h("div", { class: "controls" }, range(0, this.elementsCount - 1).map((i) => (h("div", { class: {
|
|
43
|
+
bullet: true,
|
|
44
|
+
active: i == this.internalPosition % this.elementsCount,
|
|
45
|
+
}, onClick: () => this.goToSlide(i) }))))) : null;
|
|
46
|
+
}
|
|
47
|
+
nextSlide() {
|
|
48
|
+
this.internalPosition++;
|
|
49
|
+
this.renderSlidePosition();
|
|
50
|
+
}
|
|
51
|
+
prevSlide() {
|
|
52
|
+
const nextPostion = this.internalPosition - 1;
|
|
53
|
+
this.internalPosition =
|
|
54
|
+
nextPostion > -1 ? nextPostion : this.elementsCount - 1;
|
|
55
|
+
this.renderSlidePosition();
|
|
56
|
+
}
|
|
57
|
+
renderSlidePosition() {
|
|
58
|
+
requestAnimationFrame(() => {
|
|
59
|
+
this.el.style.setProperty("--position", `${this.internalPosition % this.elementsCount}`);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
handleKeyDown(event) {
|
|
63
|
+
if (event.key !== "Space" && event.key !== "Enter")
|
|
64
|
+
return;
|
|
65
|
+
const target = event.target;
|
|
66
|
+
const direction = target.className.includes("prev") ? "prev" : "next";
|
|
67
|
+
switch (direction) {
|
|
68
|
+
case "prev":
|
|
69
|
+
this.prevSlide();
|
|
70
|
+
break;
|
|
71
|
+
case "next":
|
|
72
|
+
this.nextSlide();
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
handleTouchStart(event) {
|
|
77
|
+
if (!this.showBullets)
|
|
78
|
+
return;
|
|
79
|
+
this.swipeStartPosition = pipe(event.touches[0], O.fromNullable, O.map((t) => t.clientX));
|
|
80
|
+
}
|
|
81
|
+
handleTouchEnd(event) {
|
|
82
|
+
if (!this.showBullets)
|
|
83
|
+
return;
|
|
84
|
+
const swipeEndPosition = pipe(event.changedTouches[0], O.fromNullable, O.map((t) => t.clientX));
|
|
85
|
+
pipe(sequenceToOption(this.swipeStartPosition, swipeEndPosition), O.map(([start, end]) => N.Ord.compare(start, end)), O.map((swipeDirection) => {
|
|
86
|
+
switch (swipeDirection) {
|
|
87
|
+
case 1:
|
|
88
|
+
return this.nextSlide();
|
|
89
|
+
case -1:
|
|
90
|
+
return this.prevSlide();
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
render() {
|
|
95
|
+
return (h(Host, null,
|
|
96
|
+
h("div", { class: "items-wrapper" },
|
|
97
|
+
h("div", { class: "items", onTouchStart: (e) => this.handleTouchStart(e), onTouchEnd: (e) => this.handleTouchEnd(e) },
|
|
98
|
+
h("slot", null))),
|
|
99
|
+
this.showArrows
|
|
100
|
+
? [
|
|
101
|
+
h(Arrow, { kind: "prev", onClick: () => this.prevSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 1, disabled: false }),
|
|
102
|
+
h(Arrow, { kind: "next", onClick: () => this.nextSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 0, disabled: false }),
|
|
103
|
+
]
|
|
104
|
+
: null,
|
|
105
|
+
this.renderBullets()));
|
|
106
|
+
}
|
|
107
|
+
static get is() { return "vviinn-slider"; }
|
|
108
|
+
static get encapsulation() { return "shadow"; }
|
|
109
|
+
static get originalStyleUrls() { return {
|
|
110
|
+
"$": ["vviinn-slider.css"]
|
|
111
|
+
}; }
|
|
112
|
+
static get styleUrls() { return {
|
|
113
|
+
"$": ["vviinn-slider.css"]
|
|
114
|
+
}; }
|
|
115
|
+
static get properties() { return {
|
|
116
|
+
"showBullets": {
|
|
117
|
+
"type": "boolean",
|
|
118
|
+
"mutable": false,
|
|
119
|
+
"complexType": {
|
|
120
|
+
"original": "boolean",
|
|
121
|
+
"resolved": "boolean",
|
|
122
|
+
"references": {}
|
|
123
|
+
},
|
|
124
|
+
"required": false,
|
|
125
|
+
"optional": false,
|
|
126
|
+
"docs": {
|
|
127
|
+
"tags": [],
|
|
128
|
+
"text": ""
|
|
129
|
+
},
|
|
130
|
+
"attribute": "show-bullets",
|
|
131
|
+
"reflect": false,
|
|
132
|
+
"defaultValue": "true"
|
|
133
|
+
},
|
|
134
|
+
"position": {
|
|
135
|
+
"type": "number",
|
|
136
|
+
"mutable": false,
|
|
137
|
+
"complexType": {
|
|
138
|
+
"original": "number",
|
|
139
|
+
"resolved": "number",
|
|
140
|
+
"references": {}
|
|
141
|
+
},
|
|
142
|
+
"required": false,
|
|
143
|
+
"optional": false,
|
|
144
|
+
"docs": {
|
|
145
|
+
"tags": [],
|
|
146
|
+
"text": ""
|
|
147
|
+
},
|
|
148
|
+
"attribute": "position",
|
|
149
|
+
"reflect": true,
|
|
150
|
+
"defaultValue": "0"
|
|
151
|
+
},
|
|
152
|
+
"showArrows": {
|
|
153
|
+
"type": "boolean",
|
|
154
|
+
"mutable": false,
|
|
155
|
+
"complexType": {
|
|
156
|
+
"original": "boolean",
|
|
157
|
+
"resolved": "boolean",
|
|
158
|
+
"references": {}
|
|
159
|
+
},
|
|
160
|
+
"required": false,
|
|
161
|
+
"optional": false,
|
|
162
|
+
"docs": {
|
|
163
|
+
"tags": [],
|
|
164
|
+
"text": ""
|
|
165
|
+
},
|
|
166
|
+
"attribute": "show-arrows",
|
|
167
|
+
"reflect": false,
|
|
168
|
+
"defaultValue": "false"
|
|
169
|
+
}
|
|
170
|
+
}; }
|
|
171
|
+
static get states() { return {
|
|
172
|
+
"elementsCount": {},
|
|
173
|
+
"internalPosition": {},
|
|
174
|
+
"swipeStartPosition": {}
|
|
175
|
+
}; }
|
|
176
|
+
static get elementRef() { return "el"; }
|
|
177
|
+
static get watchers() { return [{
|
|
178
|
+
"propName": "position",
|
|
179
|
+
"methodName": "positionWatchHandler"
|
|
180
|
+
}]; }
|
|
181
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Component, Host, h, Element } from "@stencil/core";
|
|
2
|
+
import { slotChangeListener } from "../customized-slots";
|
|
3
|
+
export class VviinnTeaser {
|
|
4
|
+
componentWillLoad() {
|
|
5
|
+
slotChangeListener(this, this.el);
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, null,
|
|
9
|
+
h("slot", null,
|
|
10
|
+
h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "64", height: "64", fill: "none" },
|
|
11
|
+
h("defs", null),
|
|
12
|
+
h("path", { fill: "#C6C6C6", d: "M48 28a11.98 11.98 0 00-9.77 18.942L28 57.172 30.828 60l10.23-10.23A11.994 11.994 0 1048 28zm0 20a8 8 0 118-8 8.009 8.009 0 01-8 8zM34 24a6 6 0 10-6-6 6.006 6.006 0 006 6zm0-8a2 2 0 110 4 2 2 0 010-4z" }),
|
|
13
|
+
h("path", { fill: "#C6C6C6", d: "M24 48H8V35.993L18 26l11.172 11.172L32 34.336 20.828 23.165a4 4 0 00-5.656 0L8 30.336V8h40v12h4V8a4.004 4.004 0 00-4-4H8a4.004 4.004 0 00-4 4v40a4.005 4.005 0 004 4h16v-4z" })),
|
|
14
|
+
h("span", { class: "vviinn-teaser-text" },
|
|
15
|
+
h("slot", { name: "vviinn-teaser-text" },
|
|
16
|
+
"Finde Produkte auf ",
|
|
17
|
+
h("br", null),
|
|
18
|
+
" einem Foto")))));
|
|
19
|
+
}
|
|
20
|
+
static get is() { return "vviinn-teaser"; }
|
|
21
|
+
static get encapsulation() { return "shadow"; }
|
|
22
|
+
static get originalStyleUrls() { return {
|
|
23
|
+
"$": ["vviinn-teaser.css"]
|
|
24
|
+
}; }
|
|
25
|
+
static get styleUrls() { return {
|
|
26
|
+
"$": ["vviinn-teaser.css"]
|
|
27
|
+
}; }
|
|
28
|
+
static get elementRef() { return "el"; }
|
|
29
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--vviinn-carousel-columns: 0;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: block;
|
|
5
|
+
display: flex;
|
|
6
|
+
height: 100vh;
|
|
7
|
+
left: 0;
|
|
8
|
+
position: fixed;
|
|
9
|
+
top: 0;
|
|
10
|
+
transition: background 0.1s ease-in-out;
|
|
11
|
+
width: 100vw;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host(.open) {
|
|
15
|
+
background: rgba(0, 0, 0, 0.2);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host(.bottom) {
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
justify-content: end;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host(.right) {
|
|
24
|
+
flex-direction: row;
|
|
25
|
+
justify-content: flex-end;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
header {
|
|
29
|
+
position: relative;
|
|
30
|
+
text-align: center;
|
|
31
|
+
padding: 32px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
header.contains-source-img {
|
|
35
|
+
display: grid;
|
|
36
|
+
justify-items: center;
|
|
37
|
+
grid-gap: 12px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
img.source-image {
|
|
41
|
+
width: 64px;
|
|
42
|
+
height: 64px;
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
|
|
45
|
+
padding: 8px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host(.right) header {
|
|
49
|
+
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
main {
|
|
53
|
+
padding: 0 24px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host(.right) main {
|
|
57
|
+
overflow: auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.sidebar {
|
|
61
|
+
background: white;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host(.bottom.idle) .sidebar,
|
|
68
|
+
:host(.bottom.closed) .sidebar {
|
|
69
|
+
transform: translateY(100%);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host(.bottom.closed) .sidebar {
|
|
73
|
+
-webkit-animation-name: slideOutFromBottom;
|
|
74
|
+
animation-name: slideOutFromBottom;
|
|
75
|
+
-webkit-animation-duration: 0.5s;
|
|
76
|
+
animation-duration: 0.5s;
|
|
77
|
+
-webkit-animation-fill-mode: forwards;
|
|
78
|
+
animation-fill-mode: forwards;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host(.bottom.open) .sidebar {
|
|
82
|
+
-webkit-animation-name: slideInFromBottom;
|
|
83
|
+
animation-name: slideInFromBottom;
|
|
84
|
+
-webkit-animation-duration: 0.5s;
|
|
85
|
+
animation-duration: 0.5s;
|
|
86
|
+
-webkit-animation-fill-mode: forwards;
|
|
87
|
+
animation-fill-mode: forwards;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host(.right.idle) .sidebar {
|
|
91
|
+
transform: translateX(100%);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host(.right.closed) .sidebar {
|
|
95
|
+
-webkit-animation-name: slideOutFromRight;
|
|
96
|
+
animation-name: slideOutFromRight;
|
|
97
|
+
-webkit-animation-duration: 0.5s;
|
|
98
|
+
animation-duration: 0.5s;
|
|
99
|
+
-webkit-animation-fill-mode: forwards;
|
|
100
|
+
animation-fill-mode: forwards;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host(.right.open) .sidebar {
|
|
104
|
+
-webkit-animation-name: slideInFromRight;
|
|
105
|
+
animation-name: slideInFromRight;
|
|
106
|
+
-webkit-animation-duration: 0.5s;
|
|
107
|
+
animation-duration: 0.5s;
|
|
108
|
+
-webkit-animation-fill-mode: forwards;
|
|
109
|
+
animation-fill-mode: forwards;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:host(.right) .sidebar {
|
|
113
|
+
max-width: 480px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host(.right) vviinn-vpr-widget::part(recommendations-grid) {
|
|
117
|
+
display: grid;
|
|
118
|
+
grid-template-columns: repeat(2, 1fr);
|
|
119
|
+
grid-gap: 24px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host(.right) vviinn-vpr-widget {
|
|
123
|
+
overflow: auto;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:host(.right) vviinn-vpr-widget::part(image) {
|
|
127
|
+
border: none;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.title {
|
|
131
|
+
font-style: normal;
|
|
132
|
+
font-weight: 500;
|
|
133
|
+
font-size: 28px;
|
|
134
|
+
line-height: 40px;
|
|
135
|
+
text-align: center;
|
|
136
|
+
color: #000000;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
vviinn-vpr-widget::part(title),
|
|
140
|
+
vviinn-vpr-widget::part(brand),
|
|
141
|
+
vviinn-vpr-widget::part(type) {
|
|
142
|
+
text-align: left;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
vviinn-vpr-widget::part(price-container) {
|
|
146
|
+
align-self: start;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.close-sidebar {
|
|
150
|
+
background: transparent;
|
|
151
|
+
border: none;
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
margin: 0;
|
|
154
|
+
padding: 0;
|
|
155
|
+
position: absolute;
|
|
156
|
+
right: 24px;
|
|
157
|
+
top: 24px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@-webkit-keyframes slideInFromBottom {
|
|
161
|
+
from {
|
|
162
|
+
transform: translateY(100%);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
to {
|
|
166
|
+
transform: translateY(0);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@keyframes slideInFromBottom {
|
|
171
|
+
from {
|
|
172
|
+
transform: translateY(100%);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
to {
|
|
176
|
+
transform: translateY(0);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@-webkit-keyframes slideOutFromBottom {
|
|
181
|
+
from {
|
|
182
|
+
transform: translateY(0);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
to {
|
|
186
|
+
transform: translateY(100%);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@keyframes slideOutFromBottom {
|
|
191
|
+
from {
|
|
192
|
+
transform: translateY(0);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
to {
|
|
196
|
+
transform: translateY(100%);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@-webkit-keyframes slideInFromRight {
|
|
201
|
+
from {
|
|
202
|
+
transform: translateX(100%);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
to {
|
|
206
|
+
transform: translateX(0);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@keyframes slideInFromRight {
|
|
211
|
+
from {
|
|
212
|
+
transform: translateX(100%);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
to {
|
|
216
|
+
transform: translateX(0);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@-webkit-keyframes slideOutFromRight {
|
|
221
|
+
from {
|
|
222
|
+
transform: translateX(0);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
to {
|
|
226
|
+
transform: translateX(100%);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@keyframes slideOutFromRight {
|
|
231
|
+
from {
|
|
232
|
+
transform: translateX(0);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
to {
|
|
236
|
+
transform: translateX(100%);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { Component, Host, h, Prop, State, Listen, Element, Event, } from "@stencil/core";
|
|
2
|
+
import { CrossIcon } from "../../vviinn-icons";
|
|
3
|
+
export class RecommendationsSidebar {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.position = "bottom";
|
|
6
|
+
this.sourceImage = null;
|
|
7
|
+
this.widgetScrollbar = false;
|
|
8
|
+
this.state = "idle";
|
|
9
|
+
}
|
|
10
|
+
bodyClickListener(event) {
|
|
11
|
+
const { clientX, clientY } = event;
|
|
12
|
+
const sidebarRect = this.getSidebarRectangle();
|
|
13
|
+
if (!sidebarRect)
|
|
14
|
+
return;
|
|
15
|
+
const inLeftBound = clientX >= sidebarRect.left;
|
|
16
|
+
const inRightBound = clientX <= sidebarRect.right;
|
|
17
|
+
const inTopBound = clientY >= sidebarRect.top;
|
|
18
|
+
const inBottomBound = clientY <= sidebarRect.bottom;
|
|
19
|
+
const inBound = inLeftBound && inRightBound && inTopBound && inBottomBound;
|
|
20
|
+
if (!inBound) {
|
|
21
|
+
this.state = "closed";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
getClassMap() {
|
|
25
|
+
return {
|
|
26
|
+
[this.position]: true,
|
|
27
|
+
[this.state]: true,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
getSidebarRectangle() {
|
|
31
|
+
var _a;
|
|
32
|
+
return (_a = this.el.shadowRoot.querySelector("aside")) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (h(Host, { class: this.getClassMap() },
|
|
36
|
+
h("aside", { class: "sidebar", part: "body", onAnimationEnd: (e) => this.handleAnimationEnd(e) },
|
|
37
|
+
h("header", { class: { "contains-source-img": this.isSourceImageValid() }, part: "sidebar-header" },
|
|
38
|
+
this.isSourceImageValid() ? this.renderSourceImage() : null,
|
|
39
|
+
h("span", { class: "title", part: "title" }, this.sidebarTitle),
|
|
40
|
+
h("button", { class: "close-sidebar", onClick: () => (this.state = "closed") },
|
|
41
|
+
h(CrossIcon, null))),
|
|
42
|
+
h("main", { part: "sidebar-content" },
|
|
43
|
+
h("vviinn-vpr-widget", { exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title: product-title", token: this.token, productId: this.productId, imageWidth: 300, blockTitle: "", mode: this.position === "bottom" ? "continuity" : "grid", useCarousel: this.position === "bottom", onRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar })))));
|
|
44
|
+
}
|
|
45
|
+
renderSourceImage() {
|
|
46
|
+
return (h("img", { class: "source-image", part: "source-image", src: this.sourceImage }));
|
|
47
|
+
}
|
|
48
|
+
isSourceImageValid() {
|
|
49
|
+
var _a;
|
|
50
|
+
return ((_a = this.sourceImage) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
51
|
+
}
|
|
52
|
+
handleAnimationEnd({ animationName }) {
|
|
53
|
+
const isClosingAnimation = animationName.includes("slideOut");
|
|
54
|
+
if (!isClosingAnimation)
|
|
55
|
+
return;
|
|
56
|
+
this.modalClosed.emit();
|
|
57
|
+
}
|
|
58
|
+
static get is() { return "vviinn-recommendations-sidebar"; }
|
|
59
|
+
static get encapsulation() { return "shadow"; }
|
|
60
|
+
static get originalStyleUrls() { return {
|
|
61
|
+
"$": ["recommendations-sidebar.css"]
|
|
62
|
+
}; }
|
|
63
|
+
static get styleUrls() { return {
|
|
64
|
+
"$": ["recommendations-sidebar.css"]
|
|
65
|
+
}; }
|
|
66
|
+
static get properties() { return {
|
|
67
|
+
"sidebarTitle": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"mutable": false,
|
|
70
|
+
"complexType": {
|
|
71
|
+
"original": "string",
|
|
72
|
+
"resolved": "string",
|
|
73
|
+
"references": {}
|
|
74
|
+
},
|
|
75
|
+
"required": false,
|
|
76
|
+
"optional": false,
|
|
77
|
+
"docs": {
|
|
78
|
+
"tags": [],
|
|
79
|
+
"text": ""
|
|
80
|
+
},
|
|
81
|
+
"attribute": "sidebar-title",
|
|
82
|
+
"reflect": false
|
|
83
|
+
},
|
|
84
|
+
"token": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"mutable": false,
|
|
87
|
+
"complexType": {
|
|
88
|
+
"original": "string",
|
|
89
|
+
"resolved": "string",
|
|
90
|
+
"references": {}
|
|
91
|
+
},
|
|
92
|
+
"required": false,
|
|
93
|
+
"optional": false,
|
|
94
|
+
"docs": {
|
|
95
|
+
"tags": [],
|
|
96
|
+
"text": ""
|
|
97
|
+
},
|
|
98
|
+
"attribute": "token",
|
|
99
|
+
"reflect": false
|
|
100
|
+
},
|
|
101
|
+
"productId": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"mutable": false,
|
|
104
|
+
"complexType": {
|
|
105
|
+
"original": "string",
|
|
106
|
+
"resolved": "string",
|
|
107
|
+
"references": {}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": false,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": ""
|
|
114
|
+
},
|
|
115
|
+
"attribute": "product-id",
|
|
116
|
+
"reflect": false
|
|
117
|
+
},
|
|
118
|
+
"position": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"mutable": false,
|
|
121
|
+
"complexType": {
|
|
122
|
+
"original": "\"bottom\" | \"right\"",
|
|
123
|
+
"resolved": "\"bottom\" | \"right\"",
|
|
124
|
+
"references": {}
|
|
125
|
+
},
|
|
126
|
+
"required": false,
|
|
127
|
+
"optional": false,
|
|
128
|
+
"docs": {
|
|
129
|
+
"tags": [],
|
|
130
|
+
"text": ""
|
|
131
|
+
},
|
|
132
|
+
"attribute": "position",
|
|
133
|
+
"reflect": false,
|
|
134
|
+
"defaultValue": "\"bottom\""
|
|
135
|
+
},
|
|
136
|
+
"sourceImage": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"mutable": false,
|
|
139
|
+
"complexType": {
|
|
140
|
+
"original": "string | null",
|
|
141
|
+
"resolved": "string",
|
|
142
|
+
"references": {}
|
|
143
|
+
},
|
|
144
|
+
"required": false,
|
|
145
|
+
"optional": false,
|
|
146
|
+
"docs": {
|
|
147
|
+
"tags": [],
|
|
148
|
+
"text": ""
|
|
149
|
+
},
|
|
150
|
+
"attribute": "source-image",
|
|
151
|
+
"reflect": false,
|
|
152
|
+
"defaultValue": "null"
|
|
153
|
+
},
|
|
154
|
+
"widgetScrollbar": {
|
|
155
|
+
"type": "boolean",
|
|
156
|
+
"mutable": false,
|
|
157
|
+
"complexType": {
|
|
158
|
+
"original": "boolean",
|
|
159
|
+
"resolved": "boolean",
|
|
160
|
+
"references": {}
|
|
161
|
+
},
|
|
162
|
+
"required": false,
|
|
163
|
+
"optional": false,
|
|
164
|
+
"docs": {
|
|
165
|
+
"tags": [],
|
|
166
|
+
"text": ""
|
|
167
|
+
},
|
|
168
|
+
"attribute": "widget-scrollbar",
|
|
169
|
+
"reflect": false,
|
|
170
|
+
"defaultValue": "false"
|
|
171
|
+
}
|
|
172
|
+
}; }
|
|
173
|
+
static get states() { return {
|
|
174
|
+
"state": {}
|
|
175
|
+
}; }
|
|
176
|
+
static get events() { return [{
|
|
177
|
+
"method": "modalClosed",
|
|
178
|
+
"name": "modalClosed",
|
|
179
|
+
"bubbles": true,
|
|
180
|
+
"cancelable": true,
|
|
181
|
+
"composed": true,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [],
|
|
184
|
+
"text": ""
|
|
185
|
+
},
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "void",
|
|
188
|
+
"resolved": "void",
|
|
189
|
+
"references": {}
|
|
190
|
+
}
|
|
191
|
+
}]; }
|
|
192
|
+
static get elementRef() { return "el"; }
|
|
193
|
+
static get listeners() { return [{
|
|
194
|
+
"name": "click",
|
|
195
|
+
"method": "bodyClickListener",
|
|
196
|
+
"target": "body",
|
|
197
|
+
"capture": false,
|
|
198
|
+
"passive": false
|
|
199
|
+
}]; }
|
|
200
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { withDesign } from "storybook-addon-designs";
|
|
2
|
+
export default {
|
|
3
|
+
title: "Widgets/Visual Recommendation Button",
|
|
4
|
+
component: "vviinn-vpr-button",
|
|
5
|
+
decorators: [withDesign],
|
|
6
|
+
};
|
|
7
|
+
const Template = (args) => `<vviinn-vpr-button token="${args.token}" product-id="${args.productId}"></vviinn-vpr-button>`;
|
|
8
|
+
export const Default = Template.bind({});
|
|
9
|
+
Default.args = {
|
|
10
|
+
token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOjgzLCJqdGkiOiI3ZTg2Y2I1YS00ZTFjLTRhYjctYjU2My1lN2FjMTYzZTYyZDIiLCJzY29wZXMiOlsidnByIiwidnBzIiwidnBjIl19.SbaQnBkvoXer3GPCWUthFQStFKLHZNMBfj4Qu44WHM8nzaIt48I74yVy4gVbX29vtd6jIkDPdakqEXRXmAxOCtv7_nsd4iBs1yMegfOWW5g8f10PKfZqmWJcfhwKIEElnUMFmP6rXpogntZ7iFfeTBbiRNzQPhkaa7jUjgQkCC4",
|
|
11
|
+
productId: "4114460310",
|
|
12
|
+
};
|
|
13
|
+
Default.parameters = {
|
|
14
|
+
design: {
|
|
15
|
+
type: "figma",
|
|
16
|
+
url: "https://www.figma.com/file/YR5ZK1s4z9ZRUXytB8uVuj/Widgets?node-id=591%3A3859",
|
|
17
|
+
},
|
|
18
|
+
};
|