@jumpgroup/jump-design-system 0.3.79 → 0.3.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/cjs/jump-card-ecommerce.cjs.entry.js +32 -5
  2. package/dist/cjs/jump-card-ecommerce.cjs.entry.js.map +1 -1
  3. package/dist/cjs/jump-design-system.cjs.js +1 -1
  4. package/dist/cjs/jump-filter-range.cjs.entry.js +44 -74
  5. package/dist/cjs/jump-filter-range.cjs.entry.js.map +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.css +10 -0
  8. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.js +99 -4
  9. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.js.map +1 -1
  10. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.stories.js +47 -0
  11. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.stories.js.map +1 -1
  12. package/dist/collection/components/jump-filter-range/jump-filter-range.js +76 -128
  13. package/dist/collection/components/jump-filter-range/jump-filter-range.js.map +1 -1
  14. package/dist/collection/components/jump-filter-range/jump-filter-range.stories.js +13 -4
  15. package/dist/collection/components/jump-filter-range/jump-filter-range.stories.js.map +1 -1
  16. package/dist/components/jump-card-ecommerce.js +35 -5
  17. package/dist/components/jump-card-ecommerce.js.map +1 -1
  18. package/dist/components/jump-filter-range.js +51 -81
  19. package/dist/components/jump-filter-range.js.map +1 -1
  20. package/dist/esm/jump-card-ecommerce.entry.js +32 -5
  21. package/dist/esm/jump-card-ecommerce.entry.js.map +1 -1
  22. package/dist/esm/jump-design-system.js +1 -1
  23. package/dist/esm/jump-filter-range.entry.js +44 -74
  24. package/dist/esm/jump-filter-range.entry.js.map +1 -1
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/jump-design-system/jump-design-system.esm.js +1 -1
  27. package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
  28. package/dist/jump-design-system/p-7f7935f0.entry.js +2 -0
  29. package/dist/jump-design-system/p-7f7935f0.entry.js.map +1 -0
  30. package/dist/jump-design-system/p-e30da431.entry.js +2 -0
  31. package/dist/jump-design-system/p-e30da431.entry.js.map +1 -0
  32. package/dist/jump-design-system-elements.json +20 -0
  33. package/dist/types/components/jump-card-ecommerce/jump-card-ecommerce.d.ts +11 -0
  34. package/dist/types/components/jump-card-ecommerce/jump-card-ecommerce.stories.d.ts +8 -0
  35. package/dist/types/components/jump-filter-range/jump-filter-range.d.ts +10 -36
  36. package/dist/types/components/jump-filter-range/jump-filter-range.stories.d.ts +1 -0
  37. package/dist/types/components.d.ts +43 -20
  38. package/package.json +1 -1
  39. package/dist/jump-design-system/p-7ac9382b.entry.js +0 -2
  40. package/dist/jump-design-system/p-7ac9382b.entry.js.map +0 -1
  41. package/dist/jump-design-system/p-d70793e3.entry.js +0 -2
  42. package/dist/jump-design-system/p-d70793e3.entry.js.map +0 -1
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["jump-card-ecommerce.cjs",[[1,"jump-card-ecommerce",{"onlyIconButton":[4,"only-icon-button"],"hasBackground":[4,"has-background"],"badge":[1],"favorite":[1540],"hasFavorite":[4,"has-favorite"],"hasSlotForFavorite":[4,"has-slot-for-favorite"],"hasSlotAddToCart":[4,"has-slot-add-to-cart"],"link":[1],"img":[1],"imgAlt":[1,"img-alt"],"hoverImg":[1,"hover-img"],"hoverImgAlt":[1,"hover-img-alt"],"videoSrc":[1,"video-src"],"notificationUrl":[1,"notification-url"],"notificationText":[1,"notification-text"],"productName":[1,"product-name"],"subtitle":[1],"productId":[1,"product-id"],"price":[2],"salePrice":[2,"sale-price"],"currency":[1],"addToCartColor":[1,"add-to-cart-color"],"badgeColor":[1,"badge-color"],"outOfStock":[1540,"out-of-stock"],"outOfStockText":[1,"out-of-stock-text"],"addToCartText":[1,"add-to-cart-text"],"waitingListText":[1,"waiting-list-text"],"addToWaitingList":[4,"add-to-waiting-list"],"isMini":[4,"is-mini"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32],"priceFormatted":[32],"salePriceFormatted":[32],"setPrice":[64]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["jump-filter.cjs",[[1,"jump-filter",{"direction":[1],"filterHeading":[1,"filter-heading"],"filterButtonLabel":[1,"filter-button-label"],"filterButtonIcon":[1,"filter-button-icon"],"mobileThreshold":[2,"mobile-threshold"],"filters":[8],"showCount":[4,"show-count"],"offCanvasOverlay":[4,"off-canvas-overlay"],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"offCanvasClasses":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]],{"showMobileFilters":["watchHandler"]}]]],["jump-filtergroup.cjs",[[1,"jump-filtergroup",{"name":[1],"heading":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"label":[32],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]},null,{"showMore":["watchShowMore"]}]]],["jump-navbar.cjs",[[1,"jump-navbar",{"logo":[16],"navItems":[16],"secondaryNavItems":[16],"mobileThreshold":[2,"mobile-threshold"],"type":[1],"navPosition":[1,"nav-position"],"megaMenuAlignment":[1,"mega-menu-alignment"],"sticky":[4],"stickyThreshold":[2,"sticky-threshold"],"mobileLogo":[16],"user":[16],"isMobile":[32]},[[9,"resize","handleResize"]]]]],["jump-pagination.cjs",[[1,"jump-pagination",{"pagLabel":[1,"pag-label"],"last":[2],"showFirstAndLast":[4,"show-first-and-last"],"current":[32]},null,{"current":["watchcurrent"]}]]],["jump-pagination-table.cjs",[[0,"jump-pagination-table",{"elementsRanges":[1,"elements-ranges"],"elPerPage":[2,"el-per-page"],"pagLabel":[513,"pag-label"],"labelElementsPerPage":[513,"label-elements-per-page"],"total":[514],"first":[514],"last":[514],"showFirstAndLast":[516,"show-first-and-last"],"elementsRangesArray":[32]},null,{"elementsRanges":["elementsRangesChanged"],"elPerPage":["elPerPageChanged"]}]]],["jump-quantity.cjs",[[65,"jump-quantity",{"min":[2],"max":[2],"step":[2],"label":[1],"type":[1],"variant":[1],"showButtons":[4,"show-buttons"],"value":[2],"internalValue":[32],"getValue":[64],"setMax":[64],"reset":[64]},null,{"value":["onValueChange"]}]]],["jump-search-bar.cjs",[[1,"jump-search-bar",{"searchValue":[1025,"search-value"],"placeholder":[1],"noResultText":[1,"no-result-text"],"loadingText":[1,"loading-text"],"resultsText":[1,"results-text"],"showAllResText":[1,"show-all-res-text"],"identifier":[1],"debounceTime":[2,"debounce-time"],"variant":[1],"withBtn":[4,"with-btn"],"recentsTitle":[1,"recents-title"],"recents":[16],"results":[16],"dropdown":[4],"linearIconOnly":[4,"linear-icon-only"],"dropdownPosition":[1,"dropdown-position"],"dropdownVisible":[32],"resType":[32],"innerResults":[32],"totalResults":[32],"isExpanded":[32],"setResults":[64]},[[0,"jump-search-bar-dropdown-item-connected","addOption"]],{"searchValue":["searchValueChanged"]}]]],["jump-search-bar-mobile.cjs",[[1,"jump-search-bar-mobile",{"identifier":[1],"placeholder":[1],"recents":[16],"recentsTitle":[1,"recents-title"],"debounceTime":[2,"debounce-time"],"loadingText":[1,"loading-text"],"noResultText":[1,"no-result-text"],"results":[16],"resultsText":[1,"results-text"],"showAllResText":[1,"show-all-res-text"],"isOpen":[32],"innerResults":[32],"totalResults":[32],"resType":[32],"searchValue":[32],"setResults":[64]},[[0,"jump-search-bar-dropdown-item-connected","addOption"]],{"searchValue":["searchValueChanged"]}]]],["jump-accordion.cjs",[[1,"jump-accordion",{"variant":[1],"summary":[1],"disabled":[4],"open":[516],"icon":[1],"identifier":[1]},[[0,"sl-show","handleShow"]]]]],["jump-side-cart-example.cjs",[[1,"jump-side-cart-example",{"isCartOpen":[32],"position":[32],"cartItems":[32]}]]],["jump-tab-item.cjs",[[1,"jump-tab-item",{"identifier":[1],"iconName":[1,"icon-name"],"iconPosition":[1,"icon-position"],"label":[1],"active":[4],"disabled":[4],"variant":[32]}]]],["jump-accordion-group.cjs",[[1,"jump-accordion-group",{"variant":[1],"groupIdentifier":[1,"group-identifier"]}]]],["jump-card.cjs",[[4,"jump-card",{"horizontal":[4],"dark":[4],"shadow":[4],"border":[4],"borderRadius":[4,"border-radius"],"topBorderContentRadius":[4,"top-border-content-radius"],"boxed":[4],"roundedMedia":[4,"rounded-media"],"imgSrc":[1,"img-src"],"imgAlt":[1,"img-alt"],"videoSrc":[1,"video-src"]}]]],["jump-card-ecommerce-option.cjs",[[1,"jump-card-ecommerce-option",{"code":[1],"imgUrl":[1,"img-url"],"label":[1],"sku":[1],"taxonomy":[1]}]]],["jump-filter-checkbox.cjs",[[1,"jump-filter-checkbox",{"value":[1],"label":[1],"checked":[516],"count":[8],"isChecked":[64]}]]],["jump-filter-range.cjs",[[1,"jump-filter-range",{"name":[1],"labelMinBefore":[1,"label-min-before"],"labelMinAfter":[1,"label-min-after"],"labelMaxBefore":[1,"label-max-before"],"labelMaxAfter":[1,"label-max-after"],"min":[2],"max":[2],"step":[2],"value":[1040],"disabled":[516],"minVal":[32],"maxVal":[32],"setValue":[64],"getValues":[64],"getName":[64]},null,{"value":["valueWatcher"]}]]],["jump-filter-select.cjs",[[1,"jump-filter-select",{"value":[1537],"placeholder":[1],"label":[1],"name":[1],"options":[1],"disabled":[516],"multiple":[4],"required":[4],"loading":[4],"open":[32],"values":[32],"getSelectedValue":[64],"getSelectedOption":[64],"getValues":[64],"getName":[64],"setValue":[64]}]]],["jump-filter-switch.cjs",[[1,"jump-filter-switch",{"value":[1],"label":[1],"name":[1],"checked":[1540],"disabled":[516],"values":[32],"setValue":[64],"isChecked":[64],"getValues":[64],"getName":[64]},null,{"checked":["checkedChanged"]}]]],["jump-search-bar-dropdown-item.cjs",[[1,"jump-search-bar-dropdown-item",{"value":[1],"img":[1],"href":[1],"details":[32]}]]],["jump-tab.cjs",[[1,"jump-tab",{"disabled":[4],"alignment":[1],"fullBorder":[4,"full-border"],"tabGroupName":[1,"tab-group-name"],"variant":[1]},[[0,"jump-change-active-tab","changeActiveTabHandler"]]]]],["jump-tab-panel.cjs",[[1,"jump-tab-panel",{"identifier":[1],"active":[4]}]]],["jump-side-cart.cjs",[[1,"jump-side-cart",{"isOpen":[4,"is-open"],"position":[1],"items":[16],"discountThreshold":[16],"freeShippingThreshold":[2,"free-shipping-threshold"],"progressPercentage":[2,"progress-percentage"],"checkoutLabel":[1,"checkout-label"],"viewCartLabel":[1,"view-cart-label"],"shippingInfo":[1,"shipping-info"],"cartItems":[32]}]]],["jump-badge.cjs",[[1,"jump-badge",{"label":[1],"variant":[513],"dimension":[513],"soft":[516],"outline":[516]}]]],["jump-button_2.cjs",[[1,"jump-button",{"disabled":[4],"variant":[1],"outline":[4],"size":[1],"full":[4],"pill":[4],"text":[4],"onlyIcon":[4,"only-icon"],"href":[1],"target":[1],"type":[1],"name":[1],"value":[1],"ariaLabel":[1,"aria-label"],"class":[1],"buttonId":[1,"button-id"]}],[1,"jump-icon",{"class":[1],"library":[1],"name":[1],"category":[1],"size":[1],"label":[1],"src":[1]}]]]], options);
11
+ return index.bootstrapLazy([["jump-card-ecommerce.cjs",[[1,"jump-card-ecommerce",{"onlyIconButton":[4,"only-icon-button"],"hasBackground":[4,"has-background"],"badge":[1],"favorite":[1540],"hasFavorite":[4,"has-favorite"],"hasSlotForFavorite":[4,"has-slot-for-favorite"],"hasSlotAddToCart":[4,"has-slot-add-to-cart"],"link":[1],"img":[1],"imgAlt":[1,"img-alt"],"hoverImg":[1,"hover-img"],"hoverImgAlt":[1,"hover-img-alt"],"videoSrc":[1,"video-src"],"notificationUrl":[1,"notification-url"],"notificationText":[1,"notification-text"],"productName":[1,"product-name"],"subtitle":[1],"productId":[1,"product-id"],"price":[2],"salePrice":[2,"sale-price"],"currency":[1],"addToCartColor":[1,"add-to-cart-color"],"badgeColor":[1,"badge-color"],"outOfStock":[1540,"out-of-stock"],"outOfStockText":[1,"out-of-stock-text"],"addToCartText":[1,"add-to-cart-text"],"waitingListText":[1,"waiting-list-text"],"addToWaitingList":[4,"add-to-waiting-list"],"isMini":[4,"is-mini"],"disallowAddToCart":[4,"disallow-add-to-cart"],"disallowAddToCartLabel":[1,"disallow-add-to-cart-label"],"enableZoom":[4,"enable-zoom"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32],"priceFormatted":[32],"salePriceFormatted":[32],"setPrice":[64]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["jump-filter.cjs",[[1,"jump-filter",{"direction":[1],"filterHeading":[1,"filter-heading"],"filterButtonLabel":[1,"filter-button-label"],"filterButtonIcon":[1,"filter-button-icon"],"mobileThreshold":[2,"mobile-threshold"],"filters":[8],"showCount":[4,"show-count"],"offCanvasOverlay":[4,"off-canvas-overlay"],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"offCanvasClasses":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]],{"showMobileFilters":["watchHandler"]}]]],["jump-filtergroup.cjs",[[1,"jump-filtergroup",{"name":[1],"heading":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"label":[32],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]},null,{"showMore":["watchShowMore"]}]]],["jump-navbar.cjs",[[1,"jump-navbar",{"logo":[16],"navItems":[16],"secondaryNavItems":[16],"mobileThreshold":[2,"mobile-threshold"],"type":[1],"navPosition":[1,"nav-position"],"megaMenuAlignment":[1,"mega-menu-alignment"],"sticky":[4],"stickyThreshold":[2,"sticky-threshold"],"mobileLogo":[16],"user":[16],"isMobile":[32]},[[9,"resize","handleResize"]]]]],["jump-pagination.cjs",[[1,"jump-pagination",{"pagLabel":[1,"pag-label"],"last":[2],"showFirstAndLast":[4,"show-first-and-last"],"current":[32]},null,{"current":["watchcurrent"]}]]],["jump-pagination-table.cjs",[[0,"jump-pagination-table",{"elementsRanges":[1,"elements-ranges"],"elPerPage":[2,"el-per-page"],"pagLabel":[513,"pag-label"],"labelElementsPerPage":[513,"label-elements-per-page"],"total":[514],"first":[514],"last":[514],"showFirstAndLast":[516,"show-first-and-last"],"elementsRangesArray":[32]},null,{"elementsRanges":["elementsRangesChanged"],"elPerPage":["elPerPageChanged"]}]]],["jump-quantity.cjs",[[65,"jump-quantity",{"min":[2],"max":[2],"step":[2],"label":[1],"type":[1],"variant":[1],"showButtons":[4,"show-buttons"],"value":[2],"internalValue":[32],"getValue":[64],"setMax":[64],"reset":[64]},null,{"value":["onValueChange"]}]]],["jump-search-bar.cjs",[[1,"jump-search-bar",{"searchValue":[1025,"search-value"],"placeholder":[1],"noResultText":[1,"no-result-text"],"loadingText":[1,"loading-text"],"resultsText":[1,"results-text"],"showAllResText":[1,"show-all-res-text"],"identifier":[1],"debounceTime":[2,"debounce-time"],"variant":[1],"withBtn":[4,"with-btn"],"recentsTitle":[1,"recents-title"],"recents":[16],"results":[16],"dropdown":[4],"linearIconOnly":[4,"linear-icon-only"],"dropdownPosition":[1,"dropdown-position"],"dropdownVisible":[32],"resType":[32],"innerResults":[32],"totalResults":[32],"isExpanded":[32],"setResults":[64]},[[0,"jump-search-bar-dropdown-item-connected","addOption"]],{"searchValue":["searchValueChanged"]}]]],["jump-search-bar-mobile.cjs",[[1,"jump-search-bar-mobile",{"identifier":[1],"placeholder":[1],"recents":[16],"recentsTitle":[1,"recents-title"],"debounceTime":[2,"debounce-time"],"loadingText":[1,"loading-text"],"noResultText":[1,"no-result-text"],"results":[16],"resultsText":[1,"results-text"],"showAllResText":[1,"show-all-res-text"],"isOpen":[32],"innerResults":[32],"totalResults":[32],"resType":[32],"searchValue":[32],"setResults":[64]},[[0,"jump-search-bar-dropdown-item-connected","addOption"]],{"searchValue":["searchValueChanged"]}]]],["jump-accordion.cjs",[[1,"jump-accordion",{"variant":[1],"summary":[1],"disabled":[4],"open":[516],"icon":[1],"identifier":[1]},[[0,"sl-show","handleShow"]]]]],["jump-side-cart-example.cjs",[[1,"jump-side-cart-example",{"isCartOpen":[32],"position":[32],"cartItems":[32]}]]],["jump-tab-item.cjs",[[1,"jump-tab-item",{"identifier":[1],"iconName":[1,"icon-name"],"iconPosition":[1,"icon-position"],"label":[1],"active":[4],"disabled":[4],"variant":[32]}]]],["jump-accordion-group.cjs",[[1,"jump-accordion-group",{"variant":[1],"groupIdentifier":[1,"group-identifier"]}]]],["jump-card.cjs",[[4,"jump-card",{"horizontal":[4],"dark":[4],"shadow":[4],"border":[4],"borderRadius":[4,"border-radius"],"topBorderContentRadius":[4,"top-border-content-radius"],"boxed":[4],"roundedMedia":[4,"rounded-media"],"imgSrc":[1,"img-src"],"imgAlt":[1,"img-alt"],"videoSrc":[1,"video-src"]}]]],["jump-card-ecommerce-option.cjs",[[1,"jump-card-ecommerce-option",{"code":[1],"imgUrl":[1,"img-url"],"label":[1],"sku":[1],"taxonomy":[1]}]]],["jump-filter-checkbox.cjs",[[1,"jump-filter-checkbox",{"value":[1],"label":[1],"checked":[516],"count":[8],"isChecked":[64]}]]],["jump-filter-range.cjs",[[1,"jump-filter-range",{"name":[1],"labelMinBefore":[1,"label-min-before"],"labelMinAfter":[1,"label-min-after"],"labelMaxBefore":[1,"label-max-before"],"labelMaxAfter":[1,"label-max-after"],"min":[2],"max":[2],"step":[2],"minVal":[2,"min-val"],"maxVal":[2,"max-val"],"disabled":[516],"internalMinVal":[32],"internalMaxVal":[32],"getValues":[64]},null,{"minVal":["watchMinVal"],"maxVal":["watchMaxVal"]}]]],["jump-filter-select.cjs",[[1,"jump-filter-select",{"value":[1537],"placeholder":[1],"label":[1],"name":[1],"options":[1],"disabled":[516],"multiple":[4],"required":[4],"loading":[4],"open":[32],"values":[32],"getSelectedValue":[64],"getSelectedOption":[64],"getValues":[64],"getName":[64],"setValue":[64]}]]],["jump-filter-switch.cjs",[[1,"jump-filter-switch",{"value":[1],"label":[1],"name":[1],"checked":[1540],"disabled":[516],"values":[32],"setValue":[64],"isChecked":[64],"getValues":[64],"getName":[64]},null,{"checked":["checkedChanged"]}]]],["jump-search-bar-dropdown-item.cjs",[[1,"jump-search-bar-dropdown-item",{"value":[1],"img":[1],"href":[1],"details":[32]}]]],["jump-tab.cjs",[[1,"jump-tab",{"disabled":[4],"alignment":[1],"fullBorder":[4,"full-border"],"tabGroupName":[1,"tab-group-name"],"variant":[1]},[[0,"jump-change-active-tab","changeActiveTabHandler"]]]]],["jump-tab-panel.cjs",[[1,"jump-tab-panel",{"identifier":[1],"active":[4]}]]],["jump-side-cart.cjs",[[1,"jump-side-cart",{"isOpen":[4,"is-open"],"position":[1],"items":[16],"discountThreshold":[16],"freeShippingThreshold":[2,"free-shipping-threshold"],"progressPercentage":[2,"progress-percentage"],"checkoutLabel":[1,"checkout-label"],"viewCartLabel":[1,"view-cart-label"],"shippingInfo":[1,"shipping-info"],"cartItems":[32]}]]],["jump-badge.cjs",[[1,"jump-badge",{"label":[1],"variant":[513],"dimension":[513],"soft":[516],"outline":[516]}]]],["jump-button_2.cjs",[[1,"jump-button",{"disabled":[4],"variant":[1],"outline":[4],"size":[1],"full":[4],"pill":[4],"text":[4],"onlyIcon":[4,"only-icon"],"href":[1],"target":[1],"type":[1],"name":[1],"value":[1],"ariaLabel":[1,"aria-label"],"class":[1],"buttonId":[1,"button-id"]}],[1,"jump-icon",{"class":[1],"library":[1],"name":[1],"category":[1],"size":[1],"label":[1],"src":[1]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -69,6 +69,16 @@
69
69
  :host .Media .Images.has-hover-image:hover .Images__Front {
70
70
  opacity: 0;
71
71
  }
72
+ :host .Media .Images.enable-zoom {
73
+ overflow: hidden;
74
+ }
75
+ :host .Media .Images.enable-zoom .Images__Front {
76
+ transition: transform 0s ease-out;
77
+ cursor: zoom-in;
78
+ }
79
+ :host .Media .Images.enable-zoom:hover .Images__Front {
80
+ transform: scale(1.5);
81
+ }
72
82
  :host .Media.hasBackground {
73
83
  background-color: var(--neutral-white);
74
84
  }
@@ -1,6 +1,22 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  export class JumpCardEcommerce {
3
3
  constructor() {
4
+ /* ---------------------- @METHODS ------------------------- */
5
+ this.handleMouseMove = (e) => {
6
+ if (!this.enableZoom || !this.imageEl)
7
+ return;
8
+ const { left, top, width, height } = e.currentTarget.getBoundingClientRect();
9
+ const x = e.clientX - left;
10
+ const y = e.clientY - top;
11
+ const moveX = (x / width - 0.5) * -80; // Controlla l'ampiezza del movimento
12
+ const moveY = (y / height - 0.5) * -80; // Controlla l'ampiezza del movimento
13
+ this.imageEl.style.transform = `scale(1.5) translate(${moveX}px, ${moveY}px)`;
14
+ };
15
+ this.handleMouseLeave = () => {
16
+ if (!this.enableZoom || !this.imageEl)
17
+ return;
18
+ this.imageEl.style.transform = 'scale(1) translate(0, 0)';
19
+ };
4
20
  this.onlyIconButton = false;
5
21
  this.hasBackground = false;
6
22
  this.badge = undefined;
@@ -30,6 +46,9 @@ export class JumpCardEcommerce {
30
46
  this.waitingListText = 'Notifica disponibilità';
31
47
  this.addToWaitingList = false;
32
48
  this.isMini = false;
49
+ this.disallowAddToCart = false;
50
+ this.disallowAddToCartLabel = 'Scopri';
51
+ this.enableZoom = false;
33
52
  this.addedToCart = false;
34
53
  this.endAddedToCart = false;
35
54
  this.variations = [];
@@ -84,7 +103,6 @@ export class JumpCardEcommerce {
84
103
  this.jumpQuantityEl.removeEventListener('jump-change', this.onQuantityChange);
85
104
  }
86
105
  }
87
- /* ---------------------- @METHODS ------------------------- */
88
106
  onQuantityChange(e) {
89
107
  var _a;
90
108
  this.quantity = (_a = e.detail.value) !== null && _a !== void 0 ? _a : false;
@@ -96,6 +114,12 @@ export class JumpCardEcommerce {
96
114
  favorite: this.favorite,
97
115
  });
98
116
  }
117
+ goToProduct() {
118
+ this.goToProductPage.emit({
119
+ productId: this.productId,
120
+ link: this.link,
121
+ });
122
+ }
99
123
  addProductToCart() {
100
124
  var _a;
101
125
  this.addedToCart = true;
@@ -140,6 +164,7 @@ export class JumpCardEcommerce {
140
164
  const justifyClass = this.outOfStock ? 'justify-between' : '';
141
165
  const hasImageOnHover = this.hoverImg ? 'has-hover-image' : '';
142
166
  const miniCard = this.isMini ? 'is-mini' : '';
167
+ const enableZoomClass = this.enableZoom ? 'enable-zoom' : '';
143
168
  function calculateDiscount(price, salePrice) {
144
169
  const discount = ((price - salePrice) / price) * 100;
145
170
  return discount.toFixed(0);
@@ -149,7 +174,7 @@ export class JumpCardEcommerce {
149
174
  h("jump-badge", { class: `${backgroundClass} ${iconOnlyClass}`, variant: this.badgeColor, dimension: "small", label: this.badge }) : '', !this.isMini && this.hasFavorite ?
150
175
  h("jump-button", { onClick: () => this.onToggleFavorite(), class: `Favorite ${backgroundClass} ${iconOnlyClass}`, variant: this.favorite ? 'primary' : 'neutral', size: "small", text: true, onlyIcon: true }, h("jump-icon", { slot: "prefix", name: "heart", category: this.favorite ? 'solid' : 'light', size: "medium" }))
151
176
  :
152
- this.hasSlotForFavorite ? h("div", { class: "Favorite" }, h("slot", { name: "favorite" })) : null, h("div", { class: `Media ${iconOnlyClass} ${backgroundClass} ${miniCard}` }, h("a", { href: this.link }, h("figure", { class: `Images ${hasImageOnHover} ` }, this.img && !this.videoSrc ? h("img", { class: "Images__Front", src: this.img, alt: this.imgAlt }) : '', this.hoverImg && !this.videoSrc ?
177
+ this.hasSlotForFavorite ? h("div", { class: "Favorite" }, h("slot", { name: "favorite" })) : null, h("div", { class: `Media ${iconOnlyClass} ${backgroundClass} ${miniCard}`, onMouseMove: this.handleMouseMove, onMouseLeave: this.handleMouseLeave }, h("a", { href: this.link }, h("figure", { class: `Images ${hasImageOnHover} ${enableZoomClass}` }, this.img && !this.videoSrc ? h("img", { class: "Images__Front", src: this.img, alt: this.imgAlt, ref: el => this.imageEl = el }) : '', this.hoverImg && !this.videoSrc ?
153
178
  h("img", { class: "Images__OnHover", src: this.hoverImg, alt: this.hoverImgAlt }) : ''), this.videoSrc && !this.img ?
154
179
  h("video", { autoplay: true }, h("source", { src: this.videoSrc, type: "video/mp4" }), h("source", { src: this.videoSrc, type: "video/mov" }), h("source", { src: this.videoSrc, type: "video/webm" })) : ''), !this.isMini ?
155
180
  h("div", { class: `NotificationCart ${this.addedToCart == true ? 'is-active fade-in-out' : ''}` }, h("jump-button", { href: this.notificationUrl, variant: "white", text: true }, h("jump-icon", { slot: "prefix", name: "check" }), h("span", null, " ", this.notificationText, " ")))
@@ -176,10 +201,11 @@ export class JumpCardEcommerce {
176
201
  : null, h("slot", { name: "quantity" }))
177
202
  : null), h("div", { class: `Footer ${justifyClass} ${backgroundClass} ${iconOnlyClass} ${miniCard}` }, this.outOfStock && !this.isMini ?
178
203
  h("div", { class: "OutOfStock" }, this.outOfStockText ? this.outOfStockText : 'Esaurito') : '', this.outOfStock ?
179
- h("jump-button", { class: "Footer__AddToCart", variant: this.addToCartColor, size: "small", text: true, onClick: () => this.waitingList() }, h("jump-icon", { slot: "prefix", name: "bell", category: "regular", size: "small" }), this.waitingListText) : '', !this.outOfStock && !this.onlyIconButton && !this.hasSlotAddToCart ?
204
+ h("jump-button", { class: "Footer__AddToCart", variant: this.addToCartColor, size: "small", text: true, onClick: () => this.waitingList() }, h("jump-icon", { slot: "prefix", name: "bell", category: "regular", size: "small" }), this.waitingListText) : '', !this.outOfStock && !this.onlyIconButton && !this.hasSlotAddToCart && !this.disallowAddToCart ?
180
205
  h("jump-button", { class: "Footer__AddToCart", variant: this.addToCartColor, size: "small", text: true, onClick: () => this.addProductToCart() }, h("jump-icon", { slot: "prefix", name: "cart-shopping", category: "regular", size: "small" }), this.addToCartText) : '', !this.outOfStock && !this.onlyIconButton && this.hasSlotAddToCart ?
181
206
  h("slot", { name: "add-to-cart" })
182
- : null))));
207
+ : null, !this.outOfStock && this.disallowAddToCart ?
208
+ h("jump-button", { class: "Footer__AddToCart", variant: this.addToCartColor, size: "small", text: true, onClick: () => this.goToProduct() }, h("jump-icon", { slot: "suffix", name: "arrow-right" }), " ", this.disallowAddToCartLabel) : ''))));
183
209
  }
184
210
  static get is() { return "jump-card-ecommerce"; }
185
211
  static get encapsulation() { return "shadow"; }
@@ -703,6 +729,60 @@ export class JumpCardEcommerce {
703
729
  "reflect": false,
704
730
  "defaultValue": "false"
705
731
  },
732
+ "disallowAddToCart": {
733
+ "type": "boolean",
734
+ "mutable": false,
735
+ "complexType": {
736
+ "original": "boolean",
737
+ "resolved": "boolean",
738
+ "references": {}
739
+ },
740
+ "required": false,
741
+ "optional": false,
742
+ "docs": {
743
+ "tags": [],
744
+ "text": "Indica se si tratta di un prodotto che pu\u00F2 essere aggiunto al carrello solo dalla pagina prodotto"
745
+ },
746
+ "attribute": "disallow-add-to-cart",
747
+ "reflect": false,
748
+ "defaultValue": "false"
749
+ },
750
+ "disallowAddToCartLabel": {
751
+ "type": "string",
752
+ "mutable": false,
753
+ "complexType": {
754
+ "original": "string",
755
+ "resolved": "string",
756
+ "references": {}
757
+ },
758
+ "required": false,
759
+ "optional": false,
760
+ "docs": {
761
+ "tags": [],
762
+ "text": "Label del pulsante che appare quando il prodotto non pu\u00F2 essere aggiunto al carrello"
763
+ },
764
+ "attribute": "disallow-add-to-cart-label",
765
+ "reflect": false,
766
+ "defaultValue": "'Scopri'"
767
+ },
768
+ "enableZoom": {
769
+ "type": "boolean",
770
+ "mutable": false,
771
+ "complexType": {
772
+ "original": "boolean",
773
+ "resolved": "boolean",
774
+ "references": {}
775
+ },
776
+ "required": false,
777
+ "optional": false,
778
+ "docs": {
779
+ "tags": [],
780
+ "text": "Indica se \u00E8 attivo lo zoom all'hover"
781
+ },
782
+ "attribute": "enable-zoom",
783
+ "reflect": false,
784
+ "defaultValue": "false"
785
+ },
706
786
  "addedToCart": {
707
787
  "type": "boolean",
708
788
  "mutable": false,
@@ -810,6 +890,21 @@ export class JumpCardEcommerce {
810
890
  "resolved": "any",
811
891
  "references": {}
812
892
  }
893
+ }, {
894
+ "method": "goToProductPage",
895
+ "name": "jump-card-go-to-product-page",
896
+ "bubbles": true,
897
+ "cancelable": true,
898
+ "composed": true,
899
+ "docs": {
900
+ "tags": [],
901
+ "text": ""
902
+ },
903
+ "complexType": {
904
+ "original": "any",
905
+ "resolved": "any",
906
+ "references": {}
907
+ }
813
908
  }];
814
909
  }
815
910
  static get methods() {
@@ -1 +1 @@
1
- {"version":3,"file":"jump-card-ecommerce.js","sourceRoot":"","sources":["../../../src/components/jump-card-ecommerce/jump-card-ecommerce.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAe9G,MAAM,OAAO,iBAAiB;;8BAQM,KAAK;6BAGN,KAAK;;wBAMsB,KAAK;2BAGlC,KAAK;kCAGE,KAAK;gCAGP,KAAK;;;;;;;;gCAwBN,sBAAsB;;;;;;wBAkB9B,GAAG;8BAGsC,WAAW;0BAGc,WAAW;0BAG1C,KAAK;;6BAMnC,sBAAsB;+BAGpB,wBAAwB;gCAGtB,KAAK;sBAGf,KAAK;2BAKA,KAAK;8BAEF,KAAK;0BAEJ,EAAE;;;;;IAuBrC;;;;OAIG;IAEH,KAAK,CAAC,QAAQ,CAAC,KAAa,EAAE,SAAiB;QAC7C,IAAI,YAAY,GAAG,KAAK,CAAC;QACzB,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACvB,YAAY,GAAG,IAAI,CAAC;YACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Prop, Event, EventEmitter, Element, State, Listen, Method } from '@stencil/core';\n\ninterface Variation {\n code: string;\n imgUrl: string;\n label: string;\n taxonomy: string;\n // Add more keys as needed\n}\n\n@Component({\n tag: 'jump-card-ecommerce',\n styleUrl: 'jump-card-ecommerce.scss',\n shadow: true,\n})\nexport class JumpCardEcommerce {\n\n @Element() JumpCardEcommerce: HTMLElement;\n jumpQuantityEl;\n\n /* ---------------------- @PROPERTIES ------------------------- */\n\n /** Indicate if card has only icon button*/\n @Prop() onlyIconButton: boolean = false;\n\n /** Indicate if card has background*/\n @Prop() hasBackground: boolean = false;\n\n /** Indicates the badge of the card*/\n @Prop() badge: string;\n\n /** Indicates if the product is favorite */\n @Prop({ mutable: true, reflect: true }) favorite: boolean = false;\n\n /** Indicate if the whislist is active in shop*/\n @Prop() hasFavorite: boolean = false;\n\n /** Indicate if the whislist will be slotted*/\n @Prop() hasSlotForFavorite: boolean = false;\n\n /** Indicate if the add to cart btn will be slotted*/\n @Prop() hasSlotAddToCart: boolean = false;\n\n /** Indicates the link of the card*/\n @Prop() link: string;\n\n /** Indicates the image's src of the card*/\n @Prop() img: string;\n\n /** Indicates the img's alt of the card*/\n @Prop() imgAlt: string;\n\n /** Indicates the over image's src of the card*/\n @Prop() hoverImg: string;\n\n /** Indicates the hover img's alt of the card*/\n @Prop() hoverImgAlt: string;\n\n /** Indicates the videoSrc of the card*/\n @Prop() videoSrc: string;\n\n /** Indicates the notificationUrl of the card*/\n @Prop() notificationUrl: string;\n\n /** Indicates the notificationText of the card*/\n @Prop() notificationText: string = 'Aggiunto al carrello';\n\n /** Indicates the title of the card*/\n @Prop() productName: string;\n\n /** Indicates the subtitle of the card*/\n @Prop() subtitle: string;\n\n /** Indicates the ID of the product, can be also a SKU*/\n @Prop() productId: string;\n\n /** Indicates the price of the card */\n @Prop() price: number;\n\n /** Indicates the sale price of the card */\n @Prop() salePrice: number;\n\n /** Indicates the currency of the card */\n @Prop() currency: string = '€';\n\n /** Indicates the variant of the button */\n @Prop() addToCartColor: 'primary' | 'secondary'|'white'|'neutral' = 'secondary';\n\n /** Indicates the variant of the button */\n @Prop() badgeColor: 'primary' | 'secondary' | 'neutral' | 'warning' | 'success' | 'danger' = 'secondary';\n\n /** Indicates if the product is outOfStock */\n @Prop({ mutable: true, reflect: true }) outOfStock: boolean = false;\n\n /** Indicates the outOfStockText of the product*/\n @Prop() outOfStockText: string;\n\n /** Indicates the button class of the add to cart / notification button */\n @Prop() addToCartText: string = 'Aggiungi al carrello';\n\n /** Indicates the button class of the add to cart / notification button */\n @Prop() waitingListText: string = 'Notifica disponibilità';\n\n /** Indicate if the user request to be notified when te product is avaible*/\n @Prop() addToWaitingList: boolean = false;\n\n /** Indicate if the card is Mini Card*/\n @Prop() isMini: boolean = false;\n\n /* ---------------------- @STATE ------------------------- */\n\n /** Indicate if the product is added to cart --> non deve esserci nelle storie! */\n @Prop() addedToCart: boolean = false;\n\n @Prop() endAddedToCart: boolean = false;\n\n @State() variations: Variation[] = [];\n\n @State() selectedVariation: Variation;\n\n @State() priceFormatted: string;\n\n @State() salePriceFormatted: string;\n\n // è una proprietà che viene cambiata solo da dentro\n quantity: number;\n\n variationSelectEl: HTMLSelectElement;\n\n /* ---------------------- @EVENTS ------------------------- */\n\n @Event({ eventName: 'jump-toggle-favorite' }) toggleFavorite: EventEmitter;\n\n @Event({ eventName: 'jump-add-to-cart' }) productAddToCart: EventEmitter;\n\n @Event({ eventName: 'jump-add-to-waiting-list' }) productWaitingList: EventEmitter;\n\n @Event({ eventName: 'jump-variation-selected' }) variationSelected: EventEmitter; // verificare se corretto: aggiungo un evento\n\n /**\n * Set the price of the product\n * @param price\n * @param salePrice\n */\n @Method()\n async setPrice(price: number, salePrice: number) {\n let shouldFormat = false;\n if (price && price > 0) {\n shouldFormat = true;\n this.price = price;\n }\n\n if (salePrice && salePrice > 0) {\n this.salePrice = salePrice;\n }\n\n if (shouldFormat) {\n this.formatPrices();\n }\n }\n\n @Listen('jump-card-ecommerce-option-connected')\n addOption(e) {\n let props = e.detail; // es {code: 'sku1', imageUrl: 'https://google.com/'}\n this.variations = [...this.variations, { ...props }];\n }\n\n onVariationSelected() {\n let currentValue = this.variationSelectEl.value;\n let variation = this.variations.find(\n (variation) => variation.code == currentValue,\n );\n this.selectedVariation = variation;\n this.variationSelected.emit(variation); // verificare se corretto: emetto l'evento\n }\n\n /* ---------------------- @LIFECYCLE ------------------------- */\n\n componentWillLoad() {\n }\n\n componentDidLoad() {\n this.jumpQuantityEl = this.JumpCardEcommerce.querySelector('jump-quantity');\n\n if (this.jumpQuantityEl) {\n this.jumpQuantityEl.addEventListener('jump-change', this.onQuantityChange.bind(this));\n this.quantity = this.jumpQuantityEl.getValue().then((quantity) => {\n this.quantity = quantity;\n });\n }\n\n this.formatPrices();\n }\n\n disconnectedCallback() {\n this.jumpQuantityEl = this.JumpCardEcommerce.querySelector('jump-quantity');\n if (this.jumpQuantityEl) {\n this.jumpQuantityEl.removeEventListener('jump-change', this.onQuantityChange);\n }\n }\n\n /* ---------------------- @METHODS ------------------------- */\n onQuantityChange(e) {\n this.quantity = e.detail.value ?? false;\n }\n\n onToggleFavorite() {\n this.favorite = !this.favorite;\n this.toggleFavorite.emit(\n {\n productId: this.productId,\n favorite: this.favorite,\n },\n );\n }\n\n addProductToCart() {\n this.addedToCart = true;\n let variations = this.selectedVariation;\n if (!variations && this.variations.length > 0) {\n variations = this.variations[0];\n }\n\n const payload = {\n productId: this.productId,\n addedToCart: this.addedToCart,\n quantity: this.quantity ?? null,\n variation: variations ?? null,\n };\n this.productAddToCart.emit(payload);\n\n setTimeout(() => {\n this.addedToCart = false;\n }, 6000);\n }\n\n waitingList() {\n this.addToWaitingList = true;\n this.productWaitingList.emit(\n {\n productId: this.productId,\n addToWaitingList: this.addToWaitingList,\n },\n );\n }\n\n formatPrices() {\n let locale = document.documentElement.lang ?? 'it-IT';\n if (locale.length == 2) {\n locale = `${locale}-${locale.toUpperCase()}`;\n }\n\n // Format price with 2 decimal digits and in locale\n this.priceFormatted = this.price.toLocaleString(locale, { minimumFractionDigits: 2, maximumFractionDigits: 2 });\n this.salePriceFormatted = this.salePrice.toLocaleString(locale, {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n });\n }\n\n render() {\n const backgroundClass = this.hasBackground && !this.isMini ? 'hasBackground' : '';\n const iconOnlyClass = this.onlyIconButton && !this.isMini ? 'iconOnly' : '';\n const justifyClass = this.outOfStock ? 'justify-between' : '';\n const hasImageOnHover = this.hoverImg ? 'has-hover-image' : '';\n const miniCard = this.isMini ? 'is-mini' : '';\n\n function calculateDiscount(price: number, salePrice: number): string {\n const discount = ((price - salePrice) / price) * 100;\n return discount.toFixed(0);\n };\n\n return (\n <Host>\n {!this.isMini && this.badge ?\n <jump-badge class={`${backgroundClass} ${iconOnlyClass}`} variant={this.badgeColor} dimension=\"small\"\n label={this.badge}></jump-badge> : ''}\n\n {!this.isMini && this.hasFavorite ?\n <jump-button onClick={() => this.onToggleFavorite()} class={`Favorite ${backgroundClass} ${iconOnlyClass}`}\n variant={this.favorite ? 'primary' : 'neutral'} size=\"small\" text onlyIcon>\n <jump-icon slot=\"prefix\" name=\"heart\" category={this.favorite ? 'solid' : 'light'}\n size=\"medium\"></jump-icon>\n </jump-button>\n :\n this.hasSlotForFavorite ? <div class=\"Favorite\">\n <slot name=\"favorite\"></slot>\n </div> : null\n }\n\n <div class={`Media ${iconOnlyClass} ${backgroundClass} ${miniCard}`}>\n <a href={this.link}>\n <figure class={`Images ${hasImageOnHover} `}>\n {this.img && !this.videoSrc ? <img class=\"Images__Front\" src={this.img} alt={this.imgAlt}></img> : ''}\n {this.hoverImg && !this.videoSrc ?\n <img class=\"Images__OnHover\" src={this.hoverImg} alt={this.hoverImgAlt}></img> : ''}\n </figure>\n {this.videoSrc && !this.img ?\n <video autoplay>\n <source src={this.videoSrc} type=\"video/mp4\" />\n <source src={this.videoSrc} type=\"video/mov\" />\n <source src={this.videoSrc} type=\"video/webm\" />\n </video> : ''}\n </a>\n {!this.isMini ?\n <div class={`NotificationCart ${this.addedToCart == true ? 'is-active fade-in-out' : ''}`}>\n <jump-button href={this.notificationUrl} variant=\"white\" text>\n <jump-icon slot=\"prefix\" name=\"check\"></jump-icon>\n <span> {this.notificationText} </span>\n </jump-button>\n </div>\n : null\n }\n\n {!this.isMini && this.onlyIconButton && !this.hasSlotAddToCart ?\n <div class=\"OnlyIconButton\">\n <jump-button variant=\"secondary\" size=\"large\" pill onlyIcon onClick={() => this.addProductToCart()}>\n <jump-icon slot=\"prefix\" name=\"cart-shopping\" category=\"regular\"></jump-icon>\n </jump-button>\n </div>\n : ''\n }\n\n {!this.isMini && this.onlyIconButton && this.hasSlotAddToCart ?\n <div class=\"OnlyIconButton\">\n <slot name=\"add-to-cart\"></slot>\n </div>\n : ''\n }\n </div>\n\n <div class={`Content ${backgroundClass} ${iconOnlyClass} ${miniCard}`}>\n <div class={`Body ${backgroundClass} ${iconOnlyClass} ${miniCard}`}>\n <div>\n <div class=\"Info\">\n <a href={this.link} class=\"Product\">{this.productName}</a>\n {this.subtitle ? <div class=\"Subtitle\">{this.subtitle}</div> : null}\n </div>\n\n {this.price ?\n <div class={`Price ${miniCard}`}>\n {!this.isMini && this.salePrice && this.salePrice < this.price ?\n <div class=\"Price__Discount\"> {calculateDiscount(this.price, this.salePrice)}% </div>\n : null}\n\n {!this.isMini ?\n <div class={`Price__Regular ${this.salePrice && this.salePrice < this.price ? 'sale' : ''}`}>\n {this.currency}{this.priceFormatted}\n </div>\n :\n <div class={`Price__Regular`}>\n {this.currency}{this.salePrice && this.salePrice < this.price ? this.salePriceFormatted : this.priceFormatted}\n </div>\n }\n\n {!this.isMini && this.salePrice && this.salePrice < this.price ?\n <div class=\"Price__Sale\">{this.currency}{this.salePriceFormatted}</div>\n : null}\n </div>\n : null}\n </div>\n\n {!this.isMini || this.variations.length != 0 ?\n <div>\n {this.variations.length != 0 ?\n <div class=\"SelectVariations\">\n <select\n ref={(el) => (this.variationSelectEl = el)} //salvo questo elemento in this.variationSelectEl\n onChange={() => {\n this.onVariationSelected();\n }}\n >\n {this.variations\n .filter((variation) => !variation.imgUrl)\n .map((variation) => (\n <option value={variation.code}>{variation.label}</option>\n ))}\n </select>\n </div>\n : null}\n <slot name=\"quantity\"></slot>\n </div>\n : null}\n </div>\n\n <div class={`Footer ${justifyClass} ${backgroundClass} ${iconOnlyClass} ${miniCard}`}>\n\n {this.outOfStock && !this.isMini?\n <div class=\"OutOfStock\">{this.outOfStockText ? this.outOfStockText : 'Esaurito'}</div> : ''}\n\n {this.outOfStock ?\n <jump-button class=\"Footer__AddToCart\" variant={this.addToCartColor} size=\"small\" text onClick={() => this.waitingList()}>\n <jump-icon slot=\"prefix\" name=\"bell\" category=\"regular\" size=\"small\"></jump-icon>\n {this.waitingListText}\n </jump-button> : ''\n }\n\n {!this.outOfStock && !this.onlyIconButton && !this.hasSlotAddToCart ?\n <jump-button class=\"Footer__AddToCart\" variant={this.addToCartColor} size=\"small\" text onClick={() => this.addProductToCart()}>\n <jump-icon slot=\"prefix\" name=\"cart-shopping\" category=\"regular\" size=\"small\"></jump-icon>\n {this.addToCartText}\n </jump-button> : ''\n }\n\n {!this.outOfStock && !this.onlyIconButton && this.hasSlotAddToCart ?\n <slot name=\"add-to-cart\"></slot>\n : null\n }\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"]}
1
+ {"version":3,"file":"jump-card-ecommerce.js","sourceRoot":"","sources":["../../../src/components/jump-card-ecommerce/jump-card-ecommerce.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Prop, Event, EventEmitter, Element, State, Listen, Method } from '@stencil/core';\n\ninterface Variation {\n code: string;\n imgUrl: string;\n label: string;\n taxonomy: string;\n // Add more keys as needed\n}\n\n@Component({\n tag: 'jump-card-ecommerce',\n styleUrl: 'jump-card-ecommerce.scss',\n shadow: true,\n})\nexport class JumpCardEcommerce {\n\n @Element() JumpCardEcommerce: HTMLElement;\n jumpQuantityEl;\n private imageEl: HTMLImageElement;\n\n /* ---------------------- @PROPERTIES ------------------------- */\n\n /** Indicate if card has only icon button*/\n @Prop() onlyIconButton: boolean = false;\n\n /** Indicate if card has background*/\n @Prop() hasBackground: boolean = false;\n\n /** Indicates the badge of the card*/\n @Prop() badge: string;\n\n /** Indicates if the product is favorite */\n @Prop({ mutable: true, reflect: true }) favorite: boolean = false;\n\n /** Indicate if the whislist is active in shop*/\n @Prop() hasFavorite: boolean = false;\n\n /** Indicate if the whislist will be slotted*/\n @Prop() hasSlotForFavorite: boolean = false;\n\n /** Indicate if the add to cart btn will be slotted*/\n @Prop() hasSlotAddToCart: boolean = false;\n\n /** Indicates the link of the card*/\n @Prop() link: string;\n\n /** Indicates the image's src of the card*/\n @Prop() img: string;\n\n /** Indicates the img's alt of the card*/\n @Prop() imgAlt: string;\n\n /** Indicates the over image's src of the card*/\n @Prop() hoverImg: string;\n\n /** Indicates the hover img's alt of the card*/\n @Prop() hoverImgAlt: string;\n\n /** Indicates the videoSrc of the card*/\n @Prop() videoSrc: string;\n\n /** Indicates the notificationUrl of the card*/\n @Prop() notificationUrl: string;\n\n /** Indicates the notificationText of the card*/\n @Prop() notificationText: string = 'Aggiunto al carrello';\n\n /** Indicates the title of the card*/\n @Prop() productName: string;\n\n /** Indicates the subtitle of the card*/\n @Prop() subtitle: string;\n\n /** Indicates the ID of the product, can be also a SKU*/\n @Prop() productId: string;\n\n /** Indicates the price of the card */\n @Prop() price: number;\n\n /** Indicates the sale price of the card */\n @Prop() salePrice: number;\n\n /** Indicates the currency of the card */\n @Prop() currency: string = '€';\n\n /** Indicates the variant of the button */\n @Prop() addToCartColor: 'primary' | 'secondary'|'white'|'neutral' = 'secondary';\n\n /** Indicates the variant of the button */\n @Prop() badgeColor: 'primary' | 'secondary' | 'neutral' | 'warning' | 'success' | 'danger' = 'secondary';\n\n /** Indicates if the product is outOfStock */\n @Prop({ mutable: true, reflect: true }) outOfStock: boolean = false;\n\n /** Indicates the outOfStockText of the product*/\n @Prop() outOfStockText: string;\n\n /** Indicates the button class of the add to cart / notification button */\n @Prop() addToCartText: string = 'Aggiungi al carrello';\n\n /** Indicates the button class of the add to cart / notification button */\n @Prop() waitingListText: string = 'Notifica disponibilità';\n\n /** Indicate if the user request to be notified when te product is avaible*/\n @Prop() addToWaitingList: boolean = false;\n\n /** Indicate if the card is Mini Card*/\n @Prop() isMini: boolean = false;\n\n /** Indica se si tratta di un prodotto che può essere aggiunto al carrello solo dalla pagina prodotto */\n @Prop() disallowAddToCart: boolean = false;\n\n /** Label del pulsante che appare quando il prodotto non può essere aggiunto al carrello */\n @Prop() disallowAddToCartLabel: string = 'Scopri';\n\n /** Indica se è attivo lo zoom all'hover */\n @Prop() enableZoom: boolean = false;\n\n /* ---------------------- @STATE ------------------------- */\n\n /** Indicate if the product is added to cart --> non deve esserci nelle storie! */\n @Prop() addedToCart: boolean = false;\n\n @Prop() endAddedToCart: boolean = false;\n\n @State() variations: Variation[] = [];\n\n @State() selectedVariation: Variation;\n\n @State() priceFormatted: string;\n\n @State() salePriceFormatted: string;\n\n // è una proprietà che viene cambiata solo da dentro\n quantity: number;\n\n variationSelectEl: HTMLSelectElement;\n\n /* ---------------------- @EVENTS ------------------------- */\n\n @Event({ eventName: 'jump-toggle-favorite' }) toggleFavorite: EventEmitter;\n\n @Event({ eventName: 'jump-add-to-cart' }) productAddToCart: EventEmitter;\n\n @Event({ eventName: 'jump-add-to-waiting-list' }) productWaitingList: EventEmitter;\n\n @Event({ eventName: 'jump-variation-selected' }) variationSelected: EventEmitter; // verificare se corretto: aggiungo un evento\n\n @Event({ eventName: 'jump-card-go-to-product-page' }) goToProductPage: EventEmitter;\n\n /**\n * Set the price of the product\n * @param price\n * @param salePrice\n */\n @Method()\n async setPrice(price: number, salePrice: number) {\n let shouldFormat = false;\n if (price && price > 0) {\n shouldFormat = true;\n this.price = price;\n }\n\n if (salePrice && salePrice > 0) {\n this.salePrice = salePrice;\n }\n\n if (shouldFormat) {\n this.formatPrices();\n }\n }\n\n @Listen('jump-card-ecommerce-option-connected')\n addOption(e) {\n let props = e.detail; // es {code: 'sku1', imageUrl: 'https://google.com/'}\n this.variations = [...this.variations, { ...props }];\n }\n\n onVariationSelected() {\n let currentValue = this.variationSelectEl.value;\n let variation = this.variations.find(\n (variation) => variation.code == currentValue,\n );\n this.selectedVariation = variation;\n this.variationSelected.emit(variation); // verificare se corretto: emetto l'evento\n }\n\n /* ---------------------- @LIFECYCLE ------------------------- */\n\n componentWillLoad() {\n }\n\n componentDidLoad() {\n this.jumpQuantityEl = this.JumpCardEcommerce.querySelector('jump-quantity');\n\n if (this.jumpQuantityEl) {\n this.jumpQuantityEl.addEventListener('jump-change', this.onQuantityChange.bind(this));\n this.quantity = this.jumpQuantityEl.getValue().then((quantity) => {\n this.quantity = quantity;\n });\n }\n\n this.formatPrices();\n }\n\n disconnectedCallback() {\n this.jumpQuantityEl = this.JumpCardEcommerce.querySelector('jump-quantity');\n if (this.jumpQuantityEl) {\n this.jumpQuantityEl.removeEventListener('jump-change', this.onQuantityChange);\n }\n }\n\n /* ---------------------- @METHODS ------------------------- */\n\n private handleMouseMove = (e: MouseEvent) => {\n if (!this.enableZoom || !this.imageEl) return;\n\n const { left, top, width, height } = (e.currentTarget as HTMLElement).getBoundingClientRect();\n const x = e.clientX - left;\n const y = e.clientY - top;\n\n const moveX = (x / width - 0.5) * -80; // Controlla l'ampiezza del movimento\n const moveY = (y / height - 0.5) * -80; // Controlla l'ampiezza del movimento\n\n this.imageEl.style.transform = `scale(1.5) translate(${moveX}px, ${moveY}px)`;\n };\n\n private handleMouseLeave = () => {\n if (!this.enableZoom || !this.imageEl) return;\n this.imageEl.style.transform = 'scale(1) translate(0, 0)';\n };\n\n onQuantityChange(e) {\n this.quantity = e.detail.value ?? false;\n }\n\n onToggleFavorite() {\n this.favorite = !this.favorite;\n this.toggleFavorite.emit(\n {\n productId: this.productId,\n favorite: this.favorite,\n },\n );\n }\n\n goToProduct(){\n this.goToProductPage.emit({\n productId: this.productId,\n link: this.link,\n });\n }\n\n addProductToCart() {\n this.addedToCart = true;\n let variations = this.selectedVariation;\n if (!variations && this.variations.length > 0) {\n variations = this.variations[0];\n }\n\n const payload = {\n productId: this.productId,\n addedToCart: this.addedToCart,\n quantity: this.quantity ?? null,\n variation: variations ?? null,\n };\n this.productAddToCart.emit(payload);\n\n setTimeout(() => {\n this.addedToCart = false;\n }, 6000);\n }\n\n waitingList() {\n this.addToWaitingList = true;\n this.productWaitingList.emit(\n {\n productId: this.productId,\n addToWaitingList: this.addToWaitingList,\n },\n );\n }\n\n formatPrices() {\n let locale = document.documentElement.lang ?? 'it-IT';\n if (locale.length == 2) {\n locale = `${locale}-${locale.toUpperCase()}`;\n }\n\n // Format price with 2 decimal digits and in locale\n this.priceFormatted = this.price.toLocaleString(locale, { minimumFractionDigits: 2, maximumFractionDigits: 2 });\n this.salePriceFormatted = this.salePrice.toLocaleString(locale, {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n });\n }\n\n render() {\n const backgroundClass = this.hasBackground && !this.isMini ? 'hasBackground' : '';\n const iconOnlyClass = this.onlyIconButton && !this.isMini ? 'iconOnly' : '';\n const justifyClass = this.outOfStock ? 'justify-between' : '';\n const hasImageOnHover = this.hoverImg ? 'has-hover-image' : '';\n const miniCard = this.isMini ? 'is-mini' : '';\n const enableZoomClass = this.enableZoom ? 'enable-zoom' : '';\n\n function calculateDiscount(price: number, salePrice: number): string {\n const discount = ((price - salePrice) / price) * 100;\n return discount.toFixed(0);\n };\n\n return (\n <Host>\n {!this.isMini && this.badge ?\n <jump-badge class={`${backgroundClass} ${iconOnlyClass}`} variant={this.badgeColor} dimension=\"small\"\n label={this.badge}></jump-badge> : ''}\n\n {!this.isMini && this.hasFavorite ?\n <jump-button onClick={() => this.onToggleFavorite()} class={`Favorite ${backgroundClass} ${iconOnlyClass}`}\n variant={this.favorite ? 'primary' : 'neutral'} size=\"small\" text onlyIcon>\n <jump-icon slot=\"prefix\" name=\"heart\" category={this.favorite ? 'solid' : 'light'}\n size=\"medium\"></jump-icon>\n </jump-button>\n :\n this.hasSlotForFavorite ? <div class=\"Favorite\">\n <slot name=\"favorite\"></slot>\n </div> : null\n }\n\n <div\n class={`Media ${iconOnlyClass} ${backgroundClass} ${miniCard}`}\n onMouseMove={this.handleMouseMove}\n onMouseLeave={this.handleMouseLeave}\n >\n <a href={this.link}>\n <figure class={`Images ${hasImageOnHover} ${enableZoomClass}`}>\n {this.img && !this.videoSrc ? <img class=\"Images__Front\" src={this.img} alt={this.imgAlt} ref={el => this.imageEl = el as HTMLImageElement}></img> : ''}\n {this.hoverImg && !this.videoSrc ?\n <img class=\"Images__OnHover\" src={this.hoverImg} alt={this.hoverImgAlt}></img> : ''}\n </figure>\n {this.videoSrc && !this.img ?\n <video autoplay>\n <source src={this.videoSrc} type=\"video/mp4\" />\n <source src={this.videoSrc} type=\"video/mov\" />\n <source src={this.videoSrc} type=\"video/webm\" />\n </video> : ''}\n </a>\n {!this.isMini ?\n <div class={`NotificationCart ${this.addedToCart == true ? 'is-active fade-in-out' : ''}`}>\n <jump-button href={this.notificationUrl} variant=\"white\" text>\n <jump-icon slot=\"prefix\" name=\"check\"></jump-icon>\n <span> {this.notificationText} </span>\n </jump-button>\n </div>\n : null\n }\n\n {!this.isMini && this.onlyIconButton && !this.hasSlotAddToCart ?\n <div class=\"OnlyIconButton\">\n <jump-button variant=\"secondary\" size=\"large\" pill onlyIcon onClick={() => this.addProductToCart()}>\n <jump-icon slot=\"prefix\" name=\"cart-shopping\" category=\"regular\"></jump-icon>\n </jump-button>\n </div>\n : ''\n }\n\n {!this.isMini && this.onlyIconButton && this.hasSlotAddToCart ?\n <div class=\"OnlyIconButton\">\n <slot name=\"add-to-cart\"></slot>\n </div>\n : ''\n }\n\n \n </div>\n\n <div class={`Content ${backgroundClass} ${iconOnlyClass} ${miniCard}`}>\n <div class={`Body ${backgroundClass} ${iconOnlyClass} ${miniCard}`}>\n <div>\n <div class=\"Info\">\n <a href={this.link} class=\"Product\">{this.productName}</a>\n {this.subtitle ? <div class=\"Subtitle\">{this.subtitle}</div> : null}\n </div>\n\n {this.price ?\n <div class={`Price ${miniCard}`}>\n {!this.isMini && this.salePrice && this.salePrice < this.price ?\n <div class=\"Price__Discount\"> {calculateDiscount(this.price, this.salePrice)}% </div>\n : null}\n\n {!this.isMini ?\n <div class={`Price__Regular ${this.salePrice && this.salePrice < this.price ? 'sale' : ''}`}>\n {this.currency}{this.priceFormatted}\n </div>\n :\n <div class={`Price__Regular`}>\n {this.currency}{this.salePrice && this.salePrice < this.price ? this.salePriceFormatted : this.priceFormatted}\n </div>\n }\n\n {!this.isMini && this.salePrice && this.salePrice < this.price ?\n <div class=\"Price__Sale\">{this.currency}{this.salePriceFormatted}</div>\n : null}\n </div>\n : null}\n </div>\n\n {!this.isMini || this.variations.length != 0 ?\n <div>\n {this.variations.length != 0 ?\n <div class=\"SelectVariations\">\n <select\n ref={(el) => (this.variationSelectEl = el)} //salvo questo elemento in this.variationSelectEl\n onChange={() => {\n this.onVariationSelected();\n }}\n >\n {this.variations\n .filter((variation) => !variation.imgUrl)\n .map((variation) => (\n <option value={variation.code}>{variation.label}</option>\n ))}\n </select>\n </div>\n : null}\n <slot name=\"quantity\"></slot>\n </div>\n : null}\n </div>\n\n <div class={`Footer ${justifyClass} ${backgroundClass} ${iconOnlyClass} ${miniCard}`}>\n\n {this.outOfStock && !this.isMini?\n <div class=\"OutOfStock\">{this.outOfStockText ? this.outOfStockText : 'Esaurito'}</div> : ''}\n\n {this.outOfStock ?\n <jump-button class=\"Footer__AddToCart\" variant={this.addToCartColor} size=\"small\" text onClick={() => this.waitingList()}>\n <jump-icon slot=\"prefix\" name=\"bell\" category=\"regular\" size=\"small\"></jump-icon>\n {this.waitingListText}\n </jump-button> : ''\n }\n\n {!this.outOfStock && !this.onlyIconButton && !this.hasSlotAddToCart && !this.disallowAddToCart ?\n <jump-button class=\"Footer__AddToCart\" variant={this.addToCartColor} size=\"small\" text onClick={() => this.addProductToCart()}>\n <jump-icon slot=\"prefix\" name=\"cart-shopping\" category=\"regular\" size=\"small\"></jump-icon>\n {this.addToCartText}\n </jump-button> : ''\n }\n\n {!this.outOfStock && !this.onlyIconButton && this.hasSlotAddToCart ?\n <slot name=\"add-to-cart\"></slot>\n : null\n }\n\n {!this.outOfStock && this.disallowAddToCart ?\n <jump-button class=\"Footer__AddToCart\" variant={this.addToCartColor} size=\"small\" text onClick={() => this.goToProduct()}>\n <jump-icon slot=\"suffix\" name=\"arrow-right\"></jump-icon> {this.disallowAddToCartLabel}\n </jump-button> : ''\n }\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"]}
@@ -178,6 +178,12 @@ export default {
178
178
  control: 'boolean',
179
179
  defaultValue: false
180
180
  },
181
+ enableZoom: {
182
+ name: 'enable-zoom',
183
+ description: 'Indica se è attivo lo zoom all\'hover',
184
+ control: 'boolean',
185
+ defaultValue: false
186
+ },
181
187
  }
182
188
  };
183
189
  const Template = (args) => {
@@ -216,6 +222,7 @@ Card.args = {
216
222
  outOfStockText: 'Esaurito',
217
223
  waitingListText: 'Notifica disponibilità',
218
224
  isMini: false,
225
+ enableZoom: false,
219
226
  };
220
227
  const TemplateWithEvent = (args, data) => {
221
228
  let id = data.id;
@@ -291,4 +298,44 @@ CardEvent.args = {
291
298
  waitingListText: 'Notifica disponibilità',
292
299
  isMini: true,
293
300
  };
301
+ const TemplateDisallowAllowCart = (args) => {
302
+ const attributes = generateAttributesFromArgs(args);
303
+ return formatHtml(`
304
+ <jump-card-ecommerce ${attributes}>
305
+ </jump-card-ecommerce>
306
+ `);
307
+ };
308
+ export const CardWithZoom = Template.bind({});
309
+ CardWithZoom.args = Object.assign(Object.assign({}, Card.args), { enableZoom: true, hoverImg: '', hoverImgAlt: '' });
310
+ export const CardDisallow = TemplateDisallowAllowCart.bind({});
311
+ CardDisallow.args = {
312
+ hasBackground: true,
313
+ onlyIconButton: false,
314
+ badge: 'In offerta',
315
+ favorite: false,
316
+ hasFavorite: true,
317
+ hasSlotForFavorite: false,
318
+ link: '/prodotto',
319
+ img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
320
+ imgAlt: 'Immagine',
321
+ hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
322
+ hoverImgAlt: 'immagine in hover',
323
+ notificationUrl: '/cart',
324
+ notificationText: 'Aggiunto al carrello',
325
+ productName: 'T-shirt',
326
+ subtitle: 'T-shirt da uomo',
327
+ productId: '1',
328
+ price: 15,
329
+ salePrice: 10,
330
+ addToCartText: 'Aggiungi al carrello',
331
+ addToCartColor: 'secondary',
332
+ hasSlotAddToCart: false,
333
+ badgeColor: 'secondary',
334
+ currency: '€',
335
+ outOfStock: false,
336
+ outOfStockText: 'Esaurito',
337
+ waitingListText: 'Notifica disponibilità',
338
+ isMini: false,
339
+ disallowAddToCart: true,
340
+ };
294
341
  //# sourceMappingURL=jump-card-ecommerce.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jump-card-ecommerce.stories.js","sourceRoot":"","sources":["../../../src/components/jump-card-ecommerce/jump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ACnB,cAAc,EAAE,KAAK;IACrB,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,KAAK;IAClB,kBAAkB,EAAE,KAAK;IACzB,IAAI,EAAE,WAAW;IACjB,GAAG,EAAE,iHAAiH;IACtH,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,iHAAiH;IAC3H,WAAW,EAAE,mBAAmB;IAChC,eAAe,EAAE,OAAO;IACxB,gBAAgB,EAAE,sBAAsB;IACxC,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,iBAAiB;IAC3B,SAAS,EAAE,GAAG;IACd,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,EAAE;IACb,QAAQ,EAAE,GAAG;IACb,aAAa,EAAE,sBAAsB;IACrC,cAAc,EAAE,SAAS;IACzB,gBAAgB,EAAE,KAAK;IACvB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,UAAU;IAC1B,eAAe,EAAE,wBAAwB;IACzC,MAAM,EAAE,IAAI;CACb,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml} from '../../utils/utils';\n\nexport default {\n title: 'Components/CardEcommerce/Card',\n tags: ['autodocs'],\n argTypes: {\n hasBackground: {\n name: 'has-background',\n description: 'Aggiungi o meno il background alla card',\n control: 'boolean',\n },\n onlyIconButton: {\n name: 'only-icon-button',\n description: 'Cambia lo stile della card mostrando solo il bottone icona',\n control: 'boolean',\n },\n badge: {\n name: 'badge',\n description: 'Badge della card',\n control: 'text',\n },\n favorite: {\n name: 'favorite',\n description: 'Aggiunge il prodotto ai preferiti',\n control: 'boolean',\n },\n hasFavorite: {\n name: 'has-favorite',\n description: 'Aggiunge il prodotto ai preferiti',\n control: 'boolean',\n },\n hasSlotForFavorite: {\n name: 'has-slot-for-favorite',\n description: 'Di default la card ecommerce ha un bottone icona per il favorite che emette un evento; Se hasSlotForFavorite è true il bottone viene sostituito da uno slot',\n control: 'boolean',\n defaultValue: true,\n },\n link: {\n name: 'link',\n description: 'Link della card',\n control: 'text',\n },\n img: {\n name: 'img',\n description: 'Url dell\\'immagine da visualizzare, si attiva solo se non è presente video-src',\n control: 'text',\n defaultValue: 'https://content-management-files.canva.com/cdn-cgi/image/f=auto,q=70/2fdbd7ab-f378-4c63-8b21-c944ad2633fd/header_t-shirts2.jpg',\n if:{\n arg: 'videoSrc',\n exists: false\n }\n },\n imgAlt: {\n name: 'img-alt',\n description: 'Alt dell\\'immagine da visualizzare, si attiva solo se è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: true\n }\n },\n hoverImg: {\n name: 'hover-img',\n description: 'Url dell\\'immagine in hover da visualizzare, si attiva solo se non è presente videoSrc',\n control: 'text',\n defaultValue: 'https://ch.benetton.com/dw/image/v2/BBSF_PRD/on/demandware.static/-/Sites-ucb-master/default/dwf2799586/images/Full_Card_v/UCB-Bambino_24P_3096C10JA_0Z3_FS_Full_Card_v.jpg?sw=600&sh=800',\n if:{\n arg: 'videoSrc',\n exists: false\n }\n },\n hoverImgAlt: {\n name: 'hover-img-alt',\n description: 'Alt dell\\'immagine in hover da visualizzare, si attiva solo se è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: true\n }\n },\n videoSrc: {\n name: 'video-src',\n description: 'Url del video da visualizzare, si attiva solo se non è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: false\n }\n },\n notificationUrl: {\n name: 'notification-url',\n description: 'Url della notifica da visualizzare',\n control: 'text',\n },\n notificationText: {\n name: 'notification-text',\n description: 'Testo della notifica da visualizzare',\n control: 'text',\n },\n productName: {\n name: 'product-name',\n description: 'Nome del prodotto',\n control: 'text',\n },\n subtitle: {\n name: 'subtitle',\n description: 'Sottotitolo della card',\n control: 'text',\n },\n productId: {\n name: 'product-id',\n description: 'ID del prodotto',\n control: 'text',\n },\n price: {\n name: 'price',\n description: 'Prezzo del prodotto; Se la card è in versione Mini gli va passato il prezzo scontato',\n control: 'number',\n },\n salePrice: {\n name: 'sale-price',\n description: 'Prezzo scontato del prodotto',\n control: 'number',\n },\n addToCartText: {\n name: 'add-to-cart-text',\n description: 'Testo bottone aggiungi al carrello',\n control: 'text',\n },\n addToCartColor: {\n name: 'add-to-cart-color',\n description: 'Colore del bottone aggiungi al carrello',\n control: 'select',\n options: [\n 'primary',\n 'secondary',\n 'neutral',\n 'white'\n ],\n },\n hasSlotAddToCart: {\n name: 'has-slot-add-to-cart',\n description: 'Di default la card ecommerce ha un bottone per l\\'aggiunta al carrello; Se has-slot-add-to-cart è true il bottone viene sostituito da uno slot',\n control: 'boolean',\n defaultValue: false,\n },\n badgeColor: {\n name: 'badge-color',\n description: 'Colore del badge',\n control: 'select',\n options: [\n 'primary',\n 'secondary',\n 'neutral',\n 'warning',\n 'success',\n 'danger',\n ],\n },\n outOfStock: {\n name: 'out-of-stock',\n description: 'Indica se il prodotto è esaurito',\n control: 'boolean',\n defaultValue: false\n },\n outOfStockText: {\n name: 'out-of-stock-text',\n description: 'Testo da visualizzare se il prodotto è esaurito',\n control: 'text',\n },\n waitingListText: {\n name: 'waiting-list-text',\n description: 'cta per richiedere l\\'avviso se il prodotto torna disponibile',\n control: 'text',\n },\n isMini: {\n name: 'is-mini',\n description: 'Indica se la card è di dimensioni ridotte',\n control: 'boolean',\n defaultValue: false\n },\n }\n};\n\nconst Template = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n </jump-card-ecommerce>\n `);\n}\n\nexport const Card = Template.bind({});\nCard.args = {\n hasBackground: true,\n onlyIconButton: false,\n badge: 'In offerta',\n favorite: false,\n hasFavorite: true,\n hasSlotForFavorite: false,\n link: '/prodotto',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n imgAlt: 'Immagine',\n hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n hoverImgAlt: 'immagine in hover',\n notificationUrl: '/cart',\n notificationText: 'Aggiunto al carrello',\n productName: 'T-shirt',\n subtitle: 'T-shirt da uomo',\n productId: '1',\n price: 15,\n salePrice: 10,\n addToCartText: 'Aggiungi al carrello',\n addToCartColor: 'secondary',\n hasSlotAddToCart: false,\n badgeColor: 'secondary',\n currency: '€',\n outOfStock: false,\n outOfStockText: 'Esaurito',\n waitingListText: 'Notifica disponibilità',\n isMini: false,\n};\n\nconst TemplateWithEvent = (args, data) => {\n let id = data.id;\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n\n <jump-card-ecommerce-option code=\"size1\" label=\"sono una select un pò lunga\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"size2\" label=\"L\" sku=\"cod123\"></jump-card-ecommerce-option>\n\n <div slot=\"addtocart\"><a href=\"\">Sono un bottone dentro lo slot addotocart</a></div>\n </jump-card-ecommerce>\n <script>\n\n (function() {\n let container;\n container = document.querySelector('#story--${id}');\n\n container.querySelector('jump-card-ecommerce').addEventListener( 'jump-toggle-favorite', ev => {\n let productId = ev.detail.productId;\n let favorite = ev.detail.favorite;\n if(favorite){\n console.log( 'Prodotto ' + productId + ' aggiunto ai preferiti');\n } else {\n console.log( 'Prodotto ' + productId + ' rimosso dai preferiti');\n }\n })\n\n container.querySelector('jump-card-ecommerce').addEventListener( 'jump-add-to-cart', ev => {\n let productId = ev.detail.productId;\n let addedToCart = ev.detail.addedToCart;\n if(addedToCart){\n console.log( 'Prodotto ' + productId + ' aggiunto al carrello');\n }\n })\n\n container.querySelector('jump-card-ecommerce').addEventListener('jump-variation-selected', ev => {\n let variation = ev.detail;\n console.log('Variation selected', variation);\n });\n\n })();\n\n </script>\n ` );\n}\n\nexport const CardEvent = TemplateWithEvent.bind({});\nCardEvent.args = {\n hasBackground: true,\n onlyIconButton: false,\n badge: 'In offerta',\n hasFavorite: false,\n hasSlotForFavorite: false,\n link: '/prodotto',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n imgAlt: 'Immagine',\n hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n hoverImgAlt: 'immagine in hover',\n notificationUrl: '/cart',\n notificationText: 'Aggiunto al carrello',\n productName: 'T-shirt',\n subtitle: 'T-shirt da uomo',\n productId: '1',\n price: 15,\n salePrice: 10,\n currency: '€',\n addToCartText: 'Aggiungi al carrello',\n addToCartColor: 'primary',\n hasSlotAddToCart: false,\n badgeColor: 'primary',\n outOfStock: false,\n outOfStockText: 'Esaurito',\n waitingListText: 'Notifica disponibilità',\n isMini: true,\n};\n"]}
1
+ {"version":3,"file":"jump-card-ecommerce.stories.js","sourceRoot":"","sources":["../../../src/components/jump-card-ecommerce/jump-card-ecommerce.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,+BAA+B;IACtC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,aAAa,EAAE;YACb,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,yCAAyC;YACtD,OAAO,EAAE,SAAS;SACnB;QACD,cAAc,EAAE;YACd,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,4DAA4D;YACzE,OAAO,EAAE,SAAS;SACnB;QACD,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,kBAAkB;YAC/B,OAAO,EAAE,MAAM;SAChB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,mCAAmC;YAChD,OAAO,EAAE,SAAS;SACnB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,mCAAmC;YAChD,OAAO,EAAE,SAAS;SACnB;QACD,kBAAkB,EAAE;YAClB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BAAwB;IACzC,MAAM,EAAE,KAAK;IACb,iBAAiB,EAAE,IAAI;CACxB,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml} from '../../utils/utils';\n\nexport default {\n title: 'Components/CardEcommerce/Card',\n tags: ['autodocs'],\n argTypes: {\n hasBackground: {\n name: 'has-background',\n description: 'Aggiungi o meno il background alla card',\n control: 'boolean',\n },\n onlyIconButton: {\n name: 'only-icon-button',\n description: 'Cambia lo stile della card mostrando solo il bottone icona',\n control: 'boolean',\n },\n badge: {\n name: 'badge',\n description: 'Badge della card',\n control: 'text',\n },\n favorite: {\n name: 'favorite',\n description: 'Aggiunge il prodotto ai preferiti',\n control: 'boolean',\n },\n hasFavorite: {\n name: 'has-favorite',\n description: 'Aggiunge il prodotto ai preferiti',\n control: 'boolean',\n },\n hasSlotForFavorite: {\n name: 'has-slot-for-favorite',\n description: 'Di default la card ecommerce ha un bottone icona per il favorite che emette un evento; Se hasSlotForFavorite è true il bottone viene sostituito da uno slot',\n control: 'boolean',\n defaultValue: true,\n },\n link: {\n name: 'link',\n description: 'Link della card',\n control: 'text',\n },\n img: {\n name: 'img',\n description: 'Url dell\\'immagine da visualizzare, si attiva solo se non è presente video-src',\n control: 'text',\n defaultValue: 'https://content-management-files.canva.com/cdn-cgi/image/f=auto,q=70/2fdbd7ab-f378-4c63-8b21-c944ad2633fd/header_t-shirts2.jpg',\n if:{\n arg: 'videoSrc',\n exists: false\n }\n },\n imgAlt: {\n name: 'img-alt',\n description: 'Alt dell\\'immagine da visualizzare, si attiva solo se è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: true\n }\n },\n hoverImg: {\n name: 'hover-img',\n description: 'Url dell\\'immagine in hover da visualizzare, si attiva solo se non è presente videoSrc',\n control: 'text',\n defaultValue: 'https://ch.benetton.com/dw/image/v2/BBSF_PRD/on/demandware.static/-/Sites-ucb-master/default/dwf2799586/images/Full_Card_v/UCB-Bambino_24P_3096C10JA_0Z3_FS_Full_Card_v.jpg?sw=600&sh=800',\n if:{\n arg: 'videoSrc',\n exists: false\n }\n },\n hoverImgAlt: {\n name: 'hover-img-alt',\n description: 'Alt dell\\'immagine in hover da visualizzare, si attiva solo se è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: true\n }\n },\n videoSrc: {\n name: 'video-src',\n description: 'Url del video da visualizzare, si attiva solo se non è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: false\n }\n },\n notificationUrl: {\n name: 'notification-url',\n description: 'Url della notifica da visualizzare',\n control: 'text',\n },\n notificationText: {\n name: 'notification-text',\n description: 'Testo della notifica da visualizzare',\n control: 'text',\n },\n productName: {\n name: 'product-name',\n description: 'Nome del prodotto',\n control: 'text',\n },\n subtitle: {\n name: 'subtitle',\n description: 'Sottotitolo della card',\n control: 'text',\n },\n productId: {\n name: 'product-id',\n description: 'ID del prodotto',\n control: 'text',\n },\n price: {\n name: 'price',\n description: 'Prezzo del prodotto; Se la card è in versione Mini gli va passato il prezzo scontato',\n control: 'number',\n },\n salePrice: {\n name: 'sale-price',\n description: 'Prezzo scontato del prodotto',\n control: 'number',\n },\n addToCartText: {\n name: 'add-to-cart-text',\n description: 'Testo bottone aggiungi al carrello',\n control: 'text',\n },\n addToCartColor: {\n name: 'add-to-cart-color',\n description: 'Colore del bottone aggiungi al carrello',\n control: 'select',\n options: [\n 'primary',\n 'secondary',\n 'neutral',\n 'white'\n ],\n },\n hasSlotAddToCart: {\n name: 'has-slot-add-to-cart',\n description: 'Di default la card ecommerce ha un bottone per l\\'aggiunta al carrello; Se has-slot-add-to-cart è true il bottone viene sostituito da uno slot',\n control: 'boolean',\n defaultValue: false,\n },\n badgeColor: {\n name: 'badge-color',\n description: 'Colore del badge',\n control: 'select',\n options: [\n 'primary',\n 'secondary',\n 'neutral',\n 'warning',\n 'success',\n 'danger',\n ],\n },\n outOfStock: {\n name: 'out-of-stock',\n description: 'Indica se il prodotto è esaurito',\n control: 'boolean',\n defaultValue: false\n },\n outOfStockText: {\n name: 'out-of-stock-text',\n description: 'Testo da visualizzare se il prodotto è esaurito',\n control: 'text',\n },\n waitingListText: {\n name: 'waiting-list-text',\n description: 'cta per richiedere l\\'avviso se il prodotto torna disponibile',\n control: 'text',\n },\n isMini: {\n name: 'is-mini',\n description: 'Indica se la card è di dimensioni ridotte',\n control: 'boolean',\n defaultValue: false\n },\n enableZoom: {\n name: 'enable-zoom',\n description: 'Indica se è attivo lo zoom all\\'hover',\n control: 'boolean',\n defaultValue: false\n },\n }\n};\n\nconst Template = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n </jump-card-ecommerce>\n `);\n}\n\nexport const Card = Template.bind({});\nCard.args = {\n hasBackground: true,\n onlyIconButton: false,\n badge: 'In offerta',\n favorite: false,\n hasFavorite: true,\n hasSlotForFavorite: false,\n link: '/prodotto',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n imgAlt: 'Immagine',\n hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n hoverImgAlt: 'immagine in hover',\n notificationUrl: '/cart',\n notificationText: 'Aggiunto al carrello',\n productName: 'T-shirt',\n subtitle: 'T-shirt da uomo',\n productId: '1',\n price: 15,\n salePrice: 10,\n addToCartText: 'Aggiungi al carrello',\n addToCartColor: 'secondary',\n hasSlotAddToCart: false,\n badgeColor: 'secondary',\n currency: '€',\n outOfStock: false,\n outOfStockText: 'Esaurito',\n waitingListText: 'Notifica disponibilità',\n isMini: false,\n enableZoom: false,\n};\n\nconst TemplateWithEvent = (args, data) => {\n let id = data.id;\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n\n <jump-card-ecommerce-option code=\"size1\" label=\"sono una select un pò lunga\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"size2\" label=\"L\" sku=\"cod123\"></jump-card-ecommerce-option>\n\n <div slot=\"addtocart\"><a href=\"\">Sono un bottone dentro lo slot addotocart</a></div>\n </jump-card-ecommerce>\n <script>\n\n (function() {\n let container;\n container = document.querySelector('#story--${id}');\n\n container.querySelector('jump-card-ecommerce').addEventListener( 'jump-toggle-favorite', ev => {\n let productId = ev.detail.productId;\n let favorite = ev.detail.favorite;\n if(favorite){\n console.log( 'Prodotto ' + productId + ' aggiunto ai preferiti');\n } else {\n console.log( 'Prodotto ' + productId + ' rimosso dai preferiti');\n }\n })\n\n container.querySelector('jump-card-ecommerce').addEventListener( 'jump-add-to-cart', ev => {\n let productId = ev.detail.productId;\n let addedToCart = ev.detail.addedToCart;\n if(addedToCart){\n console.log( 'Prodotto ' + productId + ' aggiunto al carrello');\n }\n })\n\n container.querySelector('jump-card-ecommerce').addEventListener('jump-variation-selected', ev => {\n let variation = ev.detail;\n console.log('Variation selected', variation);\n });\n\n })();\n\n </script>\n ` );\n}\n\nexport const CardEvent = TemplateWithEvent.bind({});\nCardEvent.args = {\n hasBackground: true,\n onlyIconButton: false,\n badge: 'In offerta',\n hasFavorite: false,\n hasSlotForFavorite: false,\n link: '/prodotto',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n imgAlt: 'Immagine',\n hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n hoverImgAlt: 'immagine in hover',\n notificationUrl: '/cart',\n notificationText: 'Aggiunto al carrello',\n productName: 'T-shirt',\n subtitle: 'T-shirt da uomo',\n productId: '1',\n price: 15,\n salePrice: 10,\n currency: '€',\n addToCartText: 'Aggiungi al carrello',\n addToCartColor: 'primary',\n hasSlotAddToCart: false,\n badgeColor: 'primary',\n outOfStock: false,\n outOfStockText: 'Esaurito',\n waitingListText: 'Notifica disponibilità',\n isMini: true,\n};\n\nconst TemplateDisallowAllowCart = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n </jump-card-ecommerce>\n `);\n}\n\nexport const CardWithZoom = Template.bind({});\nCardWithZoom.args = {\n ...Card.args,\n enableZoom: true,\n hoverImg: '',\n hoverImgAlt: '',\n};\n\nexport const CardDisallow = TemplateDisallowAllowCart.bind({});\nCardDisallow.args = {\n hasBackground: true,\n onlyIconButton: false,\n badge: 'In offerta',\n favorite: false,\n hasFavorite: true,\n hasSlotForFavorite: false,\n link: '/prodotto',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n imgAlt: 'Immagine',\n hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n hoverImgAlt: 'immagine in hover',\n notificationUrl: '/cart',\n notificationText: 'Aggiunto al carrello',\n productName: 'T-shirt',\n subtitle: 'T-shirt da uomo',\n productId: '1',\n price: 15,\n salePrice: 10,\n addToCartText: 'Aggiungi al carrello',\n addToCartColor: 'secondary',\n hasSlotAddToCart: false,\n badgeColor: 'secondary',\n currency: '€',\n outOfStock: false,\n outOfStockText: 'Esaurito',\n waitingListText: 'Notifica disponibilità',\n isMini: false,\n disallowAddToCart: true,\n};"]}