@jumpgroup/jump-design-system 0.3.18 → 0.3.20

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 (172) hide show
  1. package/dist/cjs/class-map-b27ebf69.js +37 -0
  2. package/dist/cjs/class-map-b27ebf69.js.map +1 -0
  3. package/dist/cjs/index-86f59981.js +1575 -0
  4. package/dist/cjs/index-86f59981.js.map +1 -0
  5. package/dist/cjs/jump-accordion.cjs.entry.js +533 -3
  6. package/dist/cjs/jump-accordion.cjs.entry.js.map +1 -1
  7. package/dist/cjs/jump-badge.cjs.entry.js +2 -2
  8. package/dist/cjs/jump-button_2.cjs.entry.js +2 -2
  9. package/dist/cjs/jump-card-ecommerce-option.cjs.entry.js +2 -2
  10. package/dist/cjs/jump-card-ecommerce.cjs.entry.js +28 -19
  11. package/dist/cjs/jump-card-ecommerce.cjs.entry.js.map +1 -1
  12. package/dist/cjs/jump-card.cjs.entry.js +3 -3
  13. package/dist/cjs/jump-design-system.cjs.js +10 -10
  14. package/dist/cjs/jump-design-system.cjs.js.map +1 -1
  15. package/dist/cjs/jump-filter-checkbox.cjs.entry.js +8 -33
  16. package/dist/cjs/jump-filter-checkbox.cjs.entry.js.map +1 -1
  17. package/dist/cjs/jump-filter.cjs.entry.js +4 -4
  18. package/dist/cjs/jump-filtergroup.cjs.entry.js +4 -4
  19. package/dist/cjs/jump-pagination-table.cjs.entry.js +4 -4
  20. package/dist/cjs/jump-pagination.cjs.entry.js +4 -4
  21. package/dist/cjs/jump-pagination.cjs.entry.js.map +1 -1
  22. package/dist/cjs/jump-quantity.cjs.entry.js +4 -4
  23. package/dist/cjs/jump-tab-item.cjs.entry.js +3 -3
  24. package/dist/cjs/jump-tab-panel.cjs.entry.js +2 -2
  25. package/dist/cjs/jump-tab.cjs.entry.js +2 -2
  26. package/dist/cjs/loader.cjs.js +2 -2
  27. package/dist/collection/collection-manifest.json +2 -2
  28. package/dist/collection/components/jump-accordion/jump-accordion.css +100 -1
  29. package/dist/collection/components/jump-accordion/jump-accordion.js +163 -1
  30. package/dist/collection/components/jump-accordion/jump-accordion.js.map +1 -1
  31. package/dist/collection/components/jump-accordion/jump-accordion.stories.js +127 -0
  32. package/dist/collection/components/jump-accordion/jump-accordion.stories.js.map +1 -0
  33. package/dist/collection/components/jump-badge/jump-badge.js +1 -1
  34. package/dist/collection/components/jump-button/jump-button.js +1 -1
  35. package/dist/collection/components/jump-card/jump-card.js +2 -2
  36. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.css +23 -2
  37. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.js +44 -17
  38. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.js.map +1 -1
  39. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.stories.js +8 -1
  40. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.stories.js.map +1 -1
  41. package/dist/collection/components/jump-card-ecommerce-option/jump-card-ecommerce-option.js +1 -1
  42. package/dist/collection/components/jump-filter/jump-filter.js +3 -3
  43. package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.js +2 -2
  44. package/dist/collection/components/jump-filtergroup/jump-filtergroup.js +3 -3
  45. package/dist/collection/components/jump-pagination/jump-pagination.js +3 -3
  46. package/dist/collection/components/jump-pagination/jump-pagination.stories.js +3 -2
  47. package/dist/collection/components/jump-pagination/jump-pagination.stories.js.map +1 -1
  48. package/dist/collection/components/jump-pagination-table/jump-pagination-table.js +3 -3
  49. package/dist/collection/components/jump-quantity/jump-quantity.js +3 -3
  50. package/dist/collection/components/jump-tab/jump-tab.js +1 -1
  51. package/dist/collection/components/jump-tab-item/jump-tab-item.js +2 -2
  52. package/dist/collection/components/jump-tab-panel/jump-tab-panel.js +1 -1
  53. package/dist/components/chunk.H33C3MRM.js +57 -57
  54. package/dist/components/chunk.H33C3MRM.js.map +1 -1
  55. package/dist/components/class-map.js +31 -0
  56. package/dist/components/class-map.js.map +1 -0
  57. package/dist/components/jump-accordion.js +548 -5
  58. package/dist/components/jump-accordion.js.map +1 -1
  59. package/dist/components/jump-badge2.js +1 -1
  60. package/dist/components/jump-button2.js +1 -1
  61. package/dist/components/jump-card-ecommerce-option.js +1 -1
  62. package/dist/components/jump-card-ecommerce.js +28 -18
  63. package/dist/components/jump-card-ecommerce.js.map +1 -1
  64. package/dist/components/jump-card.js +2 -2
  65. package/dist/components/jump-filter-checkbox.js +9 -34
  66. package/dist/components/jump-filter-checkbox.js.map +1 -1
  67. package/dist/components/jump-filter.js +3 -3
  68. package/dist/components/jump-filtergroup.js +3 -3
  69. package/dist/components/jump-pagination-table.js +3 -3
  70. package/dist/components/jump-pagination.js +3 -3
  71. package/dist/components/jump-pagination.js.map +1 -1
  72. package/dist/components/jump-quantity.js +3 -3
  73. package/dist/components/jump-tab-item.js +2 -2
  74. package/dist/components/jump-tab-panel.js +1 -1
  75. package/dist/components/jump-tab.js +1 -1
  76. package/dist/esm/{chunk.H33C3MRM-d1872e67.js → chunk.H33C3MRM-632f8755.js} +2 -2
  77. package/dist/esm/{chunk.H33C3MRM-d1872e67.js.map → chunk.H33C3MRM-632f8755.js.map} +1 -1
  78. package/dist/esm/class-map-3150cdfe.js +31 -0
  79. package/dist/esm/class-map-3150cdfe.js.map +1 -0
  80. package/dist/esm/index-a94d133e.js +1546 -0
  81. package/dist/esm/index-a94d133e.js.map +1 -0
  82. package/dist/esm/jump-accordion.entry.js +533 -3
  83. package/dist/esm/jump-accordion.entry.js.map +1 -1
  84. package/dist/esm/jump-badge.entry.js +2 -2
  85. package/dist/esm/jump-button_2.entry.js +3 -3
  86. package/dist/esm/jump-card-ecommerce-option.entry.js +2 -2
  87. package/dist/esm/jump-card-ecommerce.entry.js +28 -19
  88. package/dist/esm/jump-card-ecommerce.entry.js.map +1 -1
  89. package/dist/esm/jump-card.entry.js +3 -3
  90. package/dist/esm/jump-design-system.js +11 -11
  91. package/dist/esm/jump-design-system.js.map +1 -1
  92. package/dist/esm/jump-filter-checkbox.entry.js +10 -35
  93. package/dist/esm/jump-filter-checkbox.entry.js.map +1 -1
  94. package/dist/esm/jump-filter.entry.js +4 -4
  95. package/dist/esm/jump-filtergroup.entry.js +4 -4
  96. package/dist/esm/jump-pagination-table.entry.js +4 -4
  97. package/dist/esm/jump-pagination.entry.js +4 -4
  98. package/dist/esm/jump-pagination.entry.js.map +1 -1
  99. package/dist/esm/jump-quantity.entry.js +4 -4
  100. package/dist/esm/jump-tab-item.entry.js +3 -3
  101. package/dist/esm/jump-tab-panel.entry.js +2 -2
  102. package/dist/esm/jump-tab.entry.js +2 -2
  103. package/dist/esm/loader.js +3 -3
  104. package/dist/jump-design-system/jump-design-system.esm.js +1 -1
  105. package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
  106. package/dist/jump-design-system/{p-a5aaa1dd.entry.js → p-13950869.entry.js} +2 -2
  107. package/dist/jump-design-system/p-198cfe62.js +22 -0
  108. package/dist/jump-design-system/p-198cfe62.js.map +1 -0
  109. package/dist/jump-design-system/{p-c8733544.entry.js → p-4d0c4007.entry.js} +2 -2
  110. package/dist/jump-design-system/p-570e63e4.entry.js +2 -0
  111. package/dist/jump-design-system/{p-23d91e12.entry.js → p-6309cc45.entry.js} +2 -2
  112. package/dist/jump-design-system/{p-9d9b0076.entry.js → p-678bd41e.entry.js} +2 -2
  113. package/dist/jump-design-system/{p-27fa0ba4.entry.js → p-6ad4dc92.entry.js} +2 -2
  114. package/dist/jump-design-system/{p-5e9b8062.entry.js → p-7272666a.entry.js} +11 -31
  115. package/dist/jump-design-system/p-7272666a.entry.js.map +1 -0
  116. package/dist/jump-design-system/p-8eb8c598.entry.js +2 -0
  117. package/dist/jump-design-system/p-8eb8c598.entry.js.map +1 -0
  118. package/dist/jump-design-system/p-95462766.entry.js +117 -0
  119. package/dist/jump-design-system/p-95462766.entry.js.map +1 -0
  120. package/dist/jump-design-system/{p-60849b83.entry.js → p-acd1dac1.entry.js} +2 -2
  121. package/dist/jump-design-system/{p-4302b229.entry.js → p-c964c3d9.entry.js} +2 -2
  122. package/dist/jump-design-system/p-c964c3d9.entry.js.map +1 -0
  123. package/dist/jump-design-system/{p-a4b9515b.js → p-d33f4f1d.js} +2 -2
  124. package/dist/jump-design-system/p-d4c681a4.js +3 -0
  125. package/dist/jump-design-system/p-d4c681a4.js.map +1 -0
  126. package/dist/jump-design-system/{p-ed897778.entry.js → p-e926995e.entry.js} +2 -2
  127. package/dist/jump-design-system/{p-c1665537.entry.js → p-f0590653.entry.js} +2 -2
  128. package/dist/jump-design-system/p-f281e150.entry.js +2 -0
  129. package/dist/jump-design-system/{p-839e054d.entry.js → p-f534e22b.entry.js} +2 -2
  130. package/dist/jump-design-system-elements.json +52 -1
  131. package/dist/types/components/jump-accordion/jump-accordion.d.ts +11 -0
  132. package/dist/types/components/jump-accordion/jump-accordion.stories.d.ts +39 -0
  133. package/dist/types/components/jump-card-ecommerce/jump-card-ecommerce.d.ts +2 -0
  134. package/dist/types/components/jump-card-ecommerce/jump-card-ecommerce.stories.d.ts +6 -0
  135. package/dist/types/components.d.ts +36 -0
  136. package/dist/types/stencil-public-runtime.d.ts +3 -8
  137. package/loader/cdn.js +1 -3
  138. package/loader/index.cjs.js +1 -3
  139. package/loader/index.es2017.js +1 -3
  140. package/loader/index.js +1 -3
  141. package/package.json +1 -1
  142. package/dist/cjs/index-674508e2.js +0 -2451
  143. package/dist/cjs/index-674508e2.js.map +0 -1
  144. package/dist/esm/index-70f1949a.js +0 -2422
  145. package/dist/esm/index-70f1949a.js.map +0 -1
  146. package/dist/esm/polyfills/core-js.js +0 -11
  147. package/dist/esm/polyfills/dom.js +0 -79
  148. package/dist/esm/polyfills/es5-html-element.js +0 -1
  149. package/dist/esm/polyfills/index.js +0 -34
  150. package/dist/esm/polyfills/system.js +0 -6
  151. package/dist/jump-design-system/p-4302b229.entry.js.map +0 -1
  152. package/dist/jump-design-system/p-4d6cc90d.js +0 -3
  153. package/dist/jump-design-system/p-4d6cc90d.js.map +0 -1
  154. package/dist/jump-design-system/p-56609b82.entry.js +0 -2
  155. package/dist/jump-design-system/p-56609b82.entry.js.map +0 -1
  156. package/dist/jump-design-system/p-5e9b8062.entry.js.map +0 -1
  157. package/dist/jump-design-system/p-61a578a0.entry.js +0 -2
  158. package/dist/jump-design-system/p-61a578a0.entry.js.map +0 -1
  159. package/dist/jump-design-system/p-aee5a8c3.entry.js +0 -2
  160. package/dist/jump-design-system/p-fde99383.entry.js +0 -2
  161. /package/dist/jump-design-system/{p-a5aaa1dd.entry.js.map → p-13950869.entry.js.map} +0 -0
  162. /package/dist/jump-design-system/{p-c8733544.entry.js.map → p-4d0c4007.entry.js.map} +0 -0
  163. /package/dist/jump-design-system/{p-aee5a8c3.entry.js.map → p-570e63e4.entry.js.map} +0 -0
  164. /package/dist/jump-design-system/{p-23d91e12.entry.js.map → p-6309cc45.entry.js.map} +0 -0
  165. /package/dist/jump-design-system/{p-9d9b0076.entry.js.map → p-678bd41e.entry.js.map} +0 -0
  166. /package/dist/jump-design-system/{p-27fa0ba4.entry.js.map → p-6ad4dc92.entry.js.map} +0 -0
  167. /package/dist/jump-design-system/{p-60849b83.entry.js.map → p-acd1dac1.entry.js.map} +0 -0
  168. /package/dist/jump-design-system/{p-a4b9515b.js.map → p-d33f4f1d.js.map} +0 -0
  169. /package/dist/jump-design-system/{p-ed897778.entry.js.map → p-e926995e.entry.js.map} +0 -0
  170. /package/dist/jump-design-system/{p-c1665537.entry.js.map → p-f0590653.entry.js.map} +0 -0
  171. /package/dist/jump-design-system/{p-fde99383.entry.js.map → p-f281e150.entry.js.map} +0 -0
  172. /package/dist/jump-design-system/{p-839e054d.entry.js.map → p-f534e22b.entry.js.map} +0 -0
@@ -27,6 +27,7 @@ export class JumpCardEcommerce {
27
27
  this.addToCartText = undefined;
28
28
  this.waitingListText = undefined;
29
29
  this.addToWaitingList = false;
30
+ this.isMini = false;
30
31
  this.addedToCart = false;
31
32
  this.endAddedToCart = false;
32
33
  this.variations = [];
@@ -91,39 +92,47 @@ export class JumpCardEcommerce {
91
92
  });
92
93
  }
93
94
  render() {
94
- const backgroundClass = this.hasBackground ? 'hasBackground' : '';
95
- const iconOnlyClass = this.onlyIconButton ? 'iconOnly' : '';
95
+ const backgroundClass = this.hasBackground && !this.isMini ? 'hasBackground' : '';
96
+ const iconOnlyClass = this.onlyIconButton && !this.isMini ? 'iconOnly' : '';
96
97
  const justifyClass = this.outOfStock ? 'justify-between' : '';
97
98
  const hasImageOnHover = this.hoverImg ? 'has-hover-image' : '';
99
+ const miniCard = this.isMini ? 'is-mini' : '';
98
100
  function calculateDiscount(price, salePrice) {
99
101
  const discount = ((price - salePrice) / price) * 100;
100
102
  return discount.toFixed(0);
101
103
  }
102
104
  ;
103
- return (h(Host, null, this.badge ? h("jump-badge", { class: `${backgroundClass} ${iconOnlyClass}`, variant: "secondary", dimension: "small", label: this.badge }) : '', this.hasFavorite ?
105
+ return (h(Host, null, !this.isMini && this.badge ? h("jump-badge", { class: `${backgroundClass} ${iconOnlyClass}`, variant: "secondary", dimension: "small", label: this.badge }) : '', !this.isMini && this.hasFavorite ?
104
106
  this.favoriteHref != '' ?
105
107
  h("jump-button", { href: this.favoriteHref, 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" }))
106
108
  :
107
109
  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" }))
108
110
  :
109
- this.hasSlotForFavorite ? h("div", { class: "Favorite" }, h("slot", { name: "favorite" }), " ") : null, h("div", { class: `Media ${iconOnlyClass} ${backgroundClass}` }, 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 ? h("img", { class: "Images__OnHover", src: this.hoverImg, alt: this.hoverImgAlt }) : ''), this.videoSrc && !this.img ?
110
- 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" })) : ''), 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, " "))), this.onlyIconButton ?
111
+ 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 ? h("img", { class: "Images__OnHover", src: this.hoverImg, alt: this.hoverImgAlt }) : ''), this.videoSrc && !this.img ?
112
+ 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 ?
113
+ 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, " ")))
114
+ : null, !this.isMini && this.onlyIconButton ?
111
115
  h("div", { class: "OnlyIconButton" }, h("jump-button", { variant: "secondary", size: "large", pill: true, onlyIcon: true, onClick: () => this.addProductToCart() }, h("jump-icon", { slot: "prefix", name: 'cart-shopping', category: "regular" })))
112
- : ''), h("div", { class: `Content ${backgroundClass} ${iconOnlyClass}` }, h("div", { class: `Body ${backgroundClass} ${iconOnlyClass}` }, h("div", null, h("div", { class: "Info" }, h("div", { class: "Product" }, this.productName), this.subtitle ? h("div", { class: "Subtitle" }, this.subtitle) : null), this.price ?
113
- h("div", { class: "Price" }, this.salePrice && this.salePrice != 0 ?
116
+ : ''), h("div", { class: `Content ${backgroundClass} ${iconOnlyClass} ${miniCard}` }, h("div", { class: `Body ${backgroundClass} ${iconOnlyClass} ${miniCard}` }, h("div", null, h("div", { class: "Info" }, h("div", { class: "Product" }, this.productName), !this.isMini && this.subtitle ? h("div", { class: "Subtitle" }, this.subtitle) : null), this.price ?
117
+ h("div", { class: `Price ${miniCard}` }, !this.isMini && this.salePrice && this.salePrice < this.price ?
114
118
  h("div", { class: "Price__Discount" }, " ", calculateDiscount(this.price, this.salePrice), "% ")
115
- : null, h("div", { class: `Price__Regular ${this.salePrice ? 'sale' : ''}` }, this.currency, this.price), this.salePrice ?
119
+ : null, !this.isMini ?
120
+ h("div", { class: `Price__Regular ${this.salePrice && this.salePrice < this.price ? 'sale' : ''}` }, this.currency, this.price)
121
+ :
122
+ h("div", { class: `Price__Regular` }, this.currency, this.salePrice), !this.isMini && this.salePrice && this.salePrice < this.price ?
116
123
  h("div", { class: "Price__Sale" }, this.currency, this.salePrice)
117
124
  : null)
118
- : null), h("div", { class: "SelectVariations" }, this.variations.length != 0 ?
119
- h("select", { ref: (el) => (this.variationSelectEl = el), onChange: () => {
120
- let currentValue = this.variationSelectEl.value;
121
- let currentVariation = this.variations.find((variation) => variation.code == currentValue);
122
- this.onVariationSelected(currentVariation);
123
- } }, this.variations
124
- .filter((variation) => !variation.imgUrl)
125
- .map((variation) => (h("option", { value: variation.code }, variation.label))))
126
- : null), h("slot", { name: "quantity" })), h("div", { class: `Footer ${justifyClass} ${backgroundClass} ${iconOnlyClass}` }, this.outOfStock ? h("div", { class: "OutOfStock" }, this.outOfStockText ? this.outOfStockText : 'Esaurito') : '', this.outOfStock ?
125
+ : null), !this.isMini ?
126
+ h("div", { class: "SelectVariations" }, this.variations.length != 0 ?
127
+ h("select", { ref: (el) => (this.variationSelectEl = el), onChange: () => {
128
+ let currentValue = this.variationSelectEl.value;
129
+ let currentVariation = this.variations.find((variation) => variation.code == currentValue);
130
+ this.onVariationSelected(currentVariation);
131
+ } }, this.variations
132
+ .filter((variation) => !variation.imgUrl)
133
+ .map((variation) => (h("option", { value: variation.code }, variation.label))))
134
+ : null)
135
+ : null, !this.isMini ? h("slot", { name: "quantity" }) : null), h("div", { class: `Footer ${justifyClass} ${backgroundClass} ${iconOnlyClass} ${miniCard}` }, this.outOfStock ? h("div", { class: "OutOfStock" }, this.outOfStockText ? this.outOfStockText : 'Esaurito') : '', this.outOfStock ?
127
136
  h("jump-button", { variant: "secondary", size: "small", text: true, onClick: () => this.waitingList() }, h("jump-icon", { slot: "prefix", name: !this.outOfStock ? 'cart-shopping' : 'bell', category: "regular", size: "small" }), this.waitingListText ? this.waitingListText : 'Notifica disponibilità') : '', !this.outOfStock && !this.onlyIconButton ?
128
137
  h("jump-button", { variant: "secondary", size: "small", text: true, onClick: () => this.addProductToCart() }, h("jump-icon", { slot: "prefix", name: !this.outOfStock ? 'cart-shopping' : 'bell', category: "regular", size: "small" }), this.addToCartText ? this.addToCartText : 'Aggiungi al carrello') : ''))));
129
138
  }
@@ -592,6 +601,24 @@ export class JumpCardEcommerce {
592
601
  "reflect": false,
593
602
  "defaultValue": "false"
594
603
  },
604
+ "isMini": {
605
+ "type": "boolean",
606
+ "mutable": false,
607
+ "complexType": {
608
+ "original": "boolean",
609
+ "resolved": "boolean",
610
+ "references": {}
611
+ },
612
+ "required": false,
613
+ "optional": false,
614
+ "docs": {
615
+ "tags": [],
616
+ "text": "Indicate if the card is Mini Card"
617
+ },
618
+ "attribute": "is-mini",
619
+ "reflect": false,
620
+ "defaultValue": "false"
621
+ },
595
622
  "addedToCart": {
596
623
  "type": "boolean",
597
624
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"jump-card-ec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;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Prop, Event, EventEmitter, Element, State, Listen} 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\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 /** Indicates if the favorite button is render as an anchor, and define the url*/\n @Prop() favoriteHref: string;\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 = '';\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 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 ;\n\n /** Indicates the button class of the add to cart / notification button */\n @Prop() waitingListText: string ;\n\n /** Indicate if the user request to be notified when te product is avaible*/\n @Prop() addToWaitingList: 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 // è 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 @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(variation) {\n this.selectedVariation = variation;\n this.variationSelected.emit(variation); // verificare se corretto: emetto l'evento\n }\n\n\n /* ---------------------- @LIFECYCLE ------------------------- */\n\n componentWillLoad() {}\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\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 const payload = {\n productId: this.productId,\n addedToCart: this.addedToCart,\n quantity: this.quantity ?? null,\n variation: this.selectedVariation ?? 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 render() {\n const backgroundClass = this.hasBackground ? 'hasBackground' : '';\n const iconOnlyClass = this.onlyIconButton ? 'iconOnly' : '';\n const justifyClass = this.outOfStock ? 'justify-between' : '';\n const hasImageOnHover = this.hoverImg ? 'has-hover-image' : '';\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.badge ? <jump-badge class={`${backgroundClass} ${iconOnlyClass}`} variant=\"secondary\" dimension=\"small\" label={this.badge}></jump-badge> : ''}\n \n {this.hasFavorite ? \n this.favoriteHref != '' ? \n <jump-button href={this.favoriteHref} onClick={ () => this.onToggleFavorite() } class={`Favorite ${backgroundClass} ${iconOnlyClass}`} variant={this.favorite ? 'primary' : 'neutral'} size=\"small\" text onlyIcon>\n <jump-icon slot=\"prefix\" name=\"heart\" category={this.favorite ? 'solid' : 'light'} size=\"medium\"></jump-icon>\n </jump-button>\n :\n <jump-button onClick={ () => this.onToggleFavorite() } class={`Favorite ${backgroundClass} ${iconOnlyClass}`} variant={this.favorite ? 'primary' : 'neutral'} size=\"small\" text onlyIcon>\n <jump-icon slot=\"prefix\" name=\"heart\" category={this.favorite ? 'solid' : 'light'} size=\"medium\"></jump-icon>\n </jump-button>\n : \n this.hasSlotForFavorite ? <div class=\"Favorite\"><slot name=\"favorite\"></slot> </div> : null\n }\n\n <div class={`Media ${iconOnlyClass} ${backgroundClass}`}>\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 ? <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 <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 {this.onlyIconButton ?\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 </div>\n\n <div class={`Content ${backgroundClass} ${iconOnlyClass}`}>\n <div class={`Body ${backgroundClass} ${iconOnlyClass}`}>\n <div>\n <div class=\"Info\">\n <div class=\"Product\">{this.productName}</div>\n {this.subtitle ? <div class=\"Subtitle\">{this.subtitle}</div> : null}\n </div>\n\n {this.price ?\n <div class=\"Price\">\n {this.salePrice && this.salePrice != 0 ?\n <div class=\"Price__Discount\"> {calculateDiscount(this.price, this.salePrice)}% </div>\n : null}\n <div class={`Price__Regular ${this.salePrice ? 'sale' : ''}`}>\n {this.currency}{this.price}\n </div>\n {this.salePrice ?\n <div class=\"Price__Sale\">{this.currency}{this.salePrice}</div>\n : null}\n </div>\n : null}\n </div>\n\n <div class=\"SelectVariations\">\n {this.variations.length != 0 ?\n <select\n ref={(el) => (this.variationSelectEl = el)} //salvo questo elemento in this.variationSelectEl\n onChange={() => {\n let currentValue = this.variationSelectEl.value;\n let currentVariation = this.variations.find(\n (variation) => variation.code == currentValue,\n );\n this.onVariationSelected(currentVariation);\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 : null }\n </div>\n <slot name=\"quantity\"></slot>\n </div>\n\n <div class={`Footer ${justifyClass} ${backgroundClass} ${iconOnlyClass}`}>\n\n {this.outOfStock ? <div class=\"OutOfStock\">{this.outOfStockText ? this.outOfStockText : 'Esaurito'}</div> : ''}\n\n { this.outOfStock ?\n <jump-button variant=\"secondary\" size=\"small\" text onClick={() => this.waitingList()}>\n <jump-icon slot=\"prefix\" name={!this.outOfStock ? 'cart-shopping' : 'bell'} category=\"regular\" size=\"small\"></jump-icon>\n {this.waitingListText ? this.waitingListText : 'Notifica disponibilità'}\n </jump-button> : ''\n }\n\n { !this.outOfStock && !this.onlyIconButton ?\n <jump-button variant=\"secondary\" size=\"small\" text onClick={() => this.addProductToCart()}>\n <jump-icon slot=\"prefix\" name={!this.outOfStock ? 'cart-shopping' : 'bell'} category=\"regular\" size=\"small\"></jump-icon>\n {this.addToCartText ? this.addToCartText : 'Aggiungi al carrello'}\n </jump-button> : ''\n }\n\n </div>\n\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,IAAI,EAAE,KAAK,EAAgB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;A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AC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Prop, Event, EventEmitter, Element, State, Listen} 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\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 /** Indicates if the favorite button is render as an anchor, and define the url*/\n @Prop() favoriteHref: string;\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 = '';\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 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 ;\n\n /** Indicates the button class of the add to cart / notification button */\n @Prop() waitingListText: string ;\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 // è 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 @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(variation) {\n this.selectedVariation = variation;\n this.variationSelected.emit(variation); // verificare se corretto: emetto l'evento\n }\n\n\n /* ---------------------- @LIFECYCLE ------------------------- */\n\n componentWillLoad() {}\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\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 const payload = {\n productId: this.productId,\n addedToCart: this.addedToCart,\n quantity: this.quantity ?? null,\n variation: this.selectedVariation ?? 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 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 ? <jump-badge class={`${backgroundClass} ${iconOnlyClass}`} variant=\"secondary\" dimension=\"small\" label={this.badge}></jump-badge> : ''}\n \n { !this.isMini && this.hasFavorite ? \n this.favoriteHref != '' ? \n <jump-button href={this.favoriteHref} onClick={ () => this.onToggleFavorite() } class={`Favorite ${backgroundClass} ${iconOnlyClass}`} variant={this.favorite ? 'primary' : 'neutral'} size=\"small\" text onlyIcon>\n <jump-icon slot=\"prefix\" name=\"heart\" category={this.favorite ? 'solid' : 'light'} size=\"medium\"></jump-icon>\n </jump-button>\n :\n <jump-button onClick={ () => this.onToggleFavorite() } class={`Favorite ${backgroundClass} ${iconOnlyClass}`} variant={this.favorite ? 'primary' : 'neutral'} size=\"small\" text onlyIcon>\n <jump-icon slot=\"prefix\" name=\"heart\" category={this.favorite ? 'solid' : 'light'} size=\"medium\"></jump-icon>\n </jump-button>\n : \n this.hasSlotForFavorite ? <div class=\"Favorite\"><slot name=\"favorite\"></slot> </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 ? <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 { !this.isMini && this.onlyIconButton ?\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 </div>\n\n <div class={`Content ${backgroundClass} ${iconOnlyClass} ${miniCard}`}>\n <div class={`Body ${backgroundClass} ${iconOnlyClass} ${miniCard}`}>\n <div>\n <div class=\"Info\">\n <div class=\"Product\">{this.productName}</div>\n { !this.isMini && 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.price}\n </div> \n : \n <div class={`Price__Regular`}>\n {this.currency}{this.salePrice}\n </div> \n }\n\n {!this.isMini && this.salePrice && this.salePrice < this.price ?\n <div class=\"Price__Sale\">{this.currency}{this.salePrice}</div>\n : null}\n </div>\n : null}\n </div>\n\n {!this.isMini ? \n <div class=\"SelectVariations\">\n {this.variations.length != 0 ?\n <select\n ref={(el) => (this.variationSelectEl = el)} //salvo questo elemento in this.variationSelectEl\n onChange={() => {\n let currentValue = this.variationSelectEl.value;\n let currentVariation = this.variations.find(\n (variation) => variation.code == currentValue,\n );\n this.onVariationSelected(currentVariation);\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 : null }\n </div>\n : null}\n\n {!this.isMini ? <slot name=\"quantity\"></slot> : null}\n </div>\n\n <div class={`Footer ${justifyClass} ${backgroundClass} ${iconOnlyClass} ${miniCard}`}>\n\n {this.outOfStock ? <div class=\"OutOfStock\">{this.outOfStockText ? this.outOfStockText : 'Esaurito'}</div> : ''}\n\n { this.outOfStock ?\n <jump-button variant=\"secondary\" size=\"small\" text onClick={() => this.waitingList()}>\n <jump-icon slot=\"prefix\" name={!this.outOfStock ? 'cart-shopping' : 'bell'} category=\"regular\" size=\"small\"></jump-icon>\n {this.waitingListText ? this.waitingListText : 'Notifica disponibilità'}\n </jump-button> : ''\n }\n\n { !this.outOfStock && !this.onlyIconButton ?\n <jump-button variant=\"secondary\" size=\"small\" text onClick={() => this.addProductToCart()}>\n <jump-icon slot=\"prefix\" name={!this.outOfStock ? 'cart-shopping' : 'bell'} category=\"regular\" size=\"small\"></jump-icon>\n {this.addToCartText ? this.addToCartText : 'Aggiungi al carrello'}\n </jump-button> : ''\n }\n\n </div>\n\n </div>\n </Host>\n );\n }\n\n}\n"]}
@@ -118,7 +118,7 @@ export default {
118
118
  },
119
119
  price: {
120
120
  name: 'price',
121
- description: 'Prezzo del prodotto',
121
+ description: 'Prezzo del prodotto; Se la card è in versione Mini gli va passato il prezzo scontato',
122
122
  control: 'number',
123
123
  },
124
124
  salePrice: {
@@ -147,6 +147,12 @@ export default {
147
147
  description: 'cta per richiedere l\'avviso se il prodotto torna disponibile',
148
148
  control: 'text',
149
149
  },
150
+ isMini: {
151
+ name: 'is-mini',
152
+ description: 'Indica se la card è di dimensioni ridotte',
153
+ control: 'boolean',
154
+ defaultValue: false
155
+ },
150
156
  }
151
157
  };
152
158
  // const Template = (args) => {
@@ -263,5 +269,6 @@ CardEvent.args = {
263
269
  outOfStockText: 'Esaurito',
264
270
  addtoCartText: 'Aggiungi al carrello',
265
271
  waitingListText: 'Notifica disponibilità',
272
+ isMini: true,
266
273
  };
267
274
  //# 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-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,YAAY,EAAE;YACZ,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,mHAAmH;YAChI,OAAO,EAAE,MAAM;SAChB;QACD,kBAAkB,EAAE;YAClB,IAAI,EAAE,uBAAuB;YAC7B,WAAW,EAAE,mIAAmI;YAChJ,OAAO,EAAE,SAAS;YAClB,YAAY,EAAE,IAAI;SACnB;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iBAAiB;YAC9B,OAAO,EAAE,MAAM;SAChB;QACD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AAS;IACtB,QAAQ,EAAE,iBAAiB;IAC3B,SAAS,EAAE,GAAG;IACd,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,EAAE;IACb,QAAQ,EAAE,GAAG;IACb,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,UAAU;IAC1B,aAAa,EAAE,sBAAsB;IACrC,eAAe,EAAE,wBAAwB;CAC1C,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 favoriteHref: {\n name: 'favorite-href',\n description: 'Se l\\'icona dei preferiti deve avere un link, inserire l\\'href, altrimenti rimane un bottone che emette un evento',\n control: 'text',\n },\n hasSlotForFavorite: {\n name: 'has-slot-for-favorite',\n description: 'Di default la card ecommerce ha un bottone icona (o ancora); 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 videoSrc',\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',\n control: 'number',\n },\n salePrice: {\n name: 'sale-price',\n description: 'Prezzo scontato del prodotto',\n control: 'number',\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 addToCartText: {\n name: 'add-to-cart-text',\n description: 'Testo bottone aggiungi al carrello',\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 }\n};\n\n// const Template = (args) => {\n// const attributes = generateAttributesFromArgs(args);\n// return formatHtml(`<jump-card-ecommerce ${attributes}> </jump-card-ecommerce>`);\n// }\n\nconst Template = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n </jump-card-ecommerce>\n <style>\n jump-card-ecommerce {\n --jump-badge-background: blue;\n }\n </style>\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 favoriteHref: '/preferiti',\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 outOfStock: false,\n outOfStockText: 'Esaurito',\n addtoCartText: 'Aggiungi al carrello',\n waitingListText: 'Notifica disponibilità',\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 <div slot=\"favorite\">\n <jump-button class=\"Favorite\" variant=\"primary\" size=\"small\" text onlyIcon>\n <jump-icon slot=\"prefix\" name=\"heart\" category=\"light\" size=\"medium\"></jump-icon>\n </jump-button>\n </div>\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 </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 favorite: false,\n hasFavorite: false,\n hasSlotForFavorite: true,\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 outOfStock: false,\n outOfStockText: 'Esaurito',\n addtoCartText: 'Aggiungi al carrello',\n waitingListText: 'Notifica disponibilità',\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;I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AE,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 favoriteHref: {\n name: 'favorite-href',\n description: 'Se l\\'icona dei preferiti deve avere un link, inserire l\\'href, altrimenti rimane un bottone che emette un evento',\n control: 'text',\n },\n hasSlotForFavorite: {\n name: 'has-slot-for-favorite',\n description: 'Di default la card ecommerce ha un bottone icona (o ancora); 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 videoSrc',\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 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 addToCartText: {\n name: 'add-to-cart-text',\n description: 'Testo bottone aggiungi al carrello',\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\n// const Template = (args) => {\n// const attributes = generateAttributesFromArgs(args);\n// return formatHtml(`<jump-card-ecommerce ${attributes}> </jump-card-ecommerce>`);\n// }\n\nconst Template = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n </jump-card-ecommerce>\n <style>\n jump-card-ecommerce {\n --jump-badge-background: blue;\n }\n </style>\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 favoriteHref: '/preferiti',\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 outOfStock: false,\n outOfStockText: 'Esaurito',\n addtoCartText: 'Aggiungi al carrello',\n waitingListText: 'Notifica disponibilità',\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 <div slot=\"favorite\">\n <jump-button class=\"Favorite\" variant=\"primary\" size=\"small\" text onlyIcon>\n <jump-icon slot=\"prefix\" name=\"heart\" category=\"light\" size=\"medium\"></jump-icon>\n </jump-button>\n </div>\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 </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 favorite: false,\n hasFavorite: false,\n hasSlotForFavorite: true,\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 outOfStock: false,\n outOfStockText: 'Esaurito',\n addtoCartText: 'Aggiungi al carrello',\n waitingListText: 'Notifica disponibilità',\n isMini: true,\n};"]}
@@ -17,7 +17,7 @@ export class CardEcommerceOption {
17
17
  });
18
18
  }
19
19
  render() {
20
- return h(Host, { key: '2cb613a6943ff85b11b3daf50591377c464009c7' });
20
+ return h(Host, { key: '01f745fcf8e2c2c42f7bee83066a1b64617d3582' });
21
21
  }
22
22
  static get is() { return "jump-card-ecommerce-option"; }
23
23
  static get encapsulation() { return "shadow"; }
@@ -39,9 +39,9 @@ export class JumpFilter {
39
39
  }
40
40
  }
41
41
  render() {
42
- return (h(Host, { key: '792f2607cc6d4e4987884b4e1bf06a63e447b296', mobileFilters: this.showMobileFilters }, this.isMobile && h("jump-button", { key: '02e4a491b2d1593a26353ff3886ca5c07319596e', ref: (el) => { this.mobileToggle = el; }, buttonId: this.filterButtonIcon, variant: 'primary', outline: true }, h("slot", { key: 'bf26e0b6de709eb73245754b7bc01fc800a65f54', name: "prefix" }, this.filterButtonIcon &&
43
- h("jump-icon", { key: '7a6897ca7dcc5ae3e3d7665e938db135e80d05a2', library: "fa", category: "regular", name: this.filterButtonIcon, size: "small" }), this.filterButtonLabel), h("slot", { key: '07639a79439659f99621cbdb187f2c3774c858f7', name: "suffix" }, this.activeFilters > 0 ? `(${this.activeFilters})` : '0')), h("div", { key: '1ad1334d892c929d449cbe24763e28c31b049d47', ref: (el) => { this.filtersDrawer = el; }, class: "filtersDrawer", "data-variant": this.direction }, !this.isMobile &&
44
- h("div", { key: '7132ae093a15f6fa699beda14b6ca54f568a4fac', class: 'filtersDrawer__header' }, h("jump-icon", { key: '2ec24b4c6fe935de64048e71aff5f02be14655e9', class: "small", name: this.filterButtonIcon }), h("h3", { key: '188eb63f15bfd8426d071ab6dcc43740cd049157' }, this.filterHeading)), h("slot", { key: '6f5d6b88d61a4534060973eef110bc2891b6083b' }))));
42
+ return (h(Host, { key: '1a69c784c5b6db624ee6429ba62dd9d39af4464d', mobileFilters: this.showMobileFilters }, this.isMobile && h("jump-button", { key: 'd7d685bf59530898edbf96808d6698ed9bc8cbd1', ref: (el) => { this.mobileToggle = el; }, buttonId: this.filterButtonIcon, variant: 'primary', outline: true }, h("slot", { key: '995c601cf706391e6a07697c2df29a47294d5979', name: "prefix" }, this.filterButtonIcon &&
43
+ h("jump-icon", { key: '3a9272ac7f8c7a90939764cec46ef2747d2c0c37', library: "fa", category: "regular", name: this.filterButtonIcon, size: "small" }), this.filterButtonLabel), h("slot", { key: 'd5f4b65a97aaf640c4df6425194851f32897c553', name: "suffix" }, this.activeFilters > 0 ? `(${this.activeFilters})` : '0')), h("div", { key: 'aaac47cc408e75769c6cab47a8754c7cb1087e5b', ref: (el) => { this.filtersDrawer = el; }, class: "filtersDrawer", "data-variant": this.direction }, !this.isMobile &&
44
+ h("div", { key: 'ebb54761b44ff83c26e3f6982f305ecd4b2e10af', class: 'filtersDrawer__header' }, h("jump-icon", { key: 'efd7fa78b5c7acf918115bd04461359468f7d83f', class: "small", name: this.filterButtonIcon }), h("h3", { key: '4eb1630d8ea915ee02a8d3a565c44a770ee6faad' }, this.filterHeading)), h("slot", { key: 'e77819fc97c8f6c675cbf750a7675a2073d57ed3' }))));
45
45
  }
46
46
  static get is() { return "jump-filter"; }
47
47
  static get encapsulation() { return "shadow"; }
@@ -29,8 +29,8 @@ export class JumpFilterCheckbox {
29
29
  return this.el.checked;
30
30
  }
31
31
  render() {
32
- return (h(Host, { key: '8c7ea463a6e26c6f77962cd0295dcb41411fa074', ref: (host) => this.host = host }, this.value && this.label &&
33
- h("sl-checkbox", { key: '7467e1c364d868c7d58a58937411daf4f8c4e397', value: this.value, ref: (el) => this.el = el, checked: this.checked }, this.label), this.count && h("span", { key: 'e3add7e4ad2024096d8484b93cb276ac714d57d8', class: "count" }, this.count)));
32
+ return (h(Host, { key: '758a9ecb3ef2c18e2bbc49b08d8ff61a280343b1', ref: (host) => this.host = host }, this.value && this.label &&
33
+ h("sl-checkbox", { key: 'cb755e8fb4863967583ec43b5e50df7cc9f22f3d', value: this.value, ref: (el) => this.el = el, checked: this.checked }, this.label), this.count && h("span", { key: 'd66bd4ae9299f8987fda43b047c1b1d75c79e822', class: "count" }, this.count)));
34
34
  }
35
35
  static get is() { return "jump-filter-checkbox"; }
36
36
  static get encapsulation() { return "shadow"; }
@@ -119,10 +119,10 @@ export class JumpFiltergroup {
119
119
  //this.toggleHiddenItems();
120
120
  }
121
121
  render() {
122
- return (h(Host, { key: '41fedeb5fa5115b92a3af041d2fba3dec6cae266' }, this.heading && h("h5", { key: '18ac96c2d4eb6995afb92d6c2a7d79df08aee1aa' }, this.heading), h("div", { key: '437810fd688063f569d4a6b2000ac2a45d450572', class: "filterGroup" }, h("slot", { key: '0648a643e86e5c5d978590a8c4e14358252cfd03', ref: (el) => (this.slotItemsWrapper = el) })), this.inputs.length > this.maxElements &&
123
- h("jump-button", { key: 'bfcdf9b4c4d005a6fd7a802ec0eeb0a6c0aa99ea', variant: "primary", size: "small", text: true, name: this.showMore ? this.otherLabel : this.lessLabel, "aria-label": this.showMore ? this.otherLabel : this.lessLabel, ref: (showMoreBtn) => {
122
+ return (h(Host, { key: 'ce3016053c9b873e638053b21f57531e0b67bbe9' }, this.heading && h("h5", { key: '37ba791d0c3e7ba91bf9832dddbbc31c2778146d' }, this.heading), h("div", { key: '67cbb514b3633bd3804b930414f42b9f3281f700', class: "filterGroup" }, h("slot", { key: 'fdf5b012a9da04de96fab8f91ea856f42ac8c62b', ref: (el) => (this.slotItemsWrapper = el) })), this.inputs.length > this.maxElements &&
123
+ h("jump-button", { key: '25c97a595a2d210938483a673e511020f77435e1', variant: "primary", size: "small", text: true, name: this.showMore ? this.otherLabel : this.lessLabel, "aria-label": this.showMore ? this.otherLabel : this.lessLabel, ref: (showMoreBtn) => {
124
124
  this.showMoreBtn = showMoreBtn;
125
- }, onClick: () => this.handleShowMore() }, this.showMore ? this.otherLabel : this.lessLabel, h("jump-icon", { key: 'cf42c4ac93733a34668426eae394966171ae72c3', slot: "suffix", name: this.showMore ? 'chevron-down' : 'chevron-up' }))));
125
+ }, onClick: () => this.handleShowMore() }, this.showMore ? this.otherLabel : this.lessLabel, h("jump-icon", { key: '962d1cc09d45e12a6a998d8313ce56b337c599f4', slot: "suffix", name: this.showMore ? 'chevron-down' : 'chevron-up' }))));
126
126
  }
127
127
  static get is() { return "jump-filtergroup"; }
128
128
  static get encapsulation() { return "shadow"; }
@@ -22,7 +22,7 @@ export class JumpPagination {
22
22
  }
23
23
  /* --------------------- RENDER ------------------------------- */
24
24
  render() {
25
- return (h(Host, { key: '6ef030ab9b4e21d726894fd4a900d3483b8d641b', class: "JumpPagination" }, h("div", { key: 'd46a4d78bf52013f78da6672a7cc6bce926fb042', class: "JumpPagination__Wrapper" }, h("div", { key: '7fac451a3eeaaf7de386c43986ed77c2d76e8924', class: "indicators" }, h("div", { key: 'be9182cb5c2abfa184327f38d4986ccde82b9261', class: "elements" }, h("span", { key: 'c6cf78cdee38c5b4ad15fcee17fe9e4d4816eca6' }, h("span", { key: 'e1accb40623fd6a19ebbfb3fe479b88721f0144a' }, this.current), " ", this.pagLabel, " ", h("span", { key: 'bb763d0c1c08ca63ebcd2f03bfc5266e17fe3140' }, this.last))), h("div", { key: '3bc88641103f555344af6d0c59cbcadcfadf3a1f', class: "arrow" }, this.showFirstAndLast &&
25
+ return (h(Host, { key: '65046c855bd1191502ecbe892f623b4f10d36f26', class: "JumpPagination" }, h("div", { key: '028b565a05e0fa852245e9899bb5c6cd98263cce', class: "JumpPagination__Wrapper" }, h("div", { key: 'e6c2d1402547dd8468e28764ba7e008a1624abb4', class: "indicators" }, h("div", { key: '53f9585d4cf3f99b37e25f84626553d79876d569', class: "elements" }, h("span", { key: '734c0828eeca8698a190c81d1a50899e4fcd0989' }, h("span", { key: 'd777032abe327a870b87194ddc7361601051ff6c' }, this.current), " ", this.pagLabel, " ", h("span", { key: '68433e5f31462e39561bbcc2fbff17ae4ebaa8a7' }, this.last))), h("div", { key: '36dd0dbd2f91d97e089cfe08664b70815d7d825a', class: "arrow" }, this.showFirstAndLast &&
26
26
  // <button
27
27
  // onClick={() => {this.current = 1} }
28
28
  // disabled={(this.current === 1) ? true : false}>
@@ -30,14 +30,14 @@ export class JumpPagination {
30
30
  // disabled={(this.current === 1) ? true : false}
31
31
  // ></jump-icon>
32
32
  // </button>
33
- h("jump-button", { key: '17a5c6fed8aeaf1d01fe554a7ae6febab0ecd662', onClick: () => { this.current = 1; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === 1) ? true : false }, " ", h("jump-icon", { key: '01b4f0ebe3d010e73d1e528b18d4b52ff17ccff4', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: 'c38d217f91fa283e554acbf2f2076043ee235f67', onClick: () => { this.current--; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === 1) ? true : false }, " ", h("jump-icon", { key: '0146a1938d8eaca858957c7e3ddd2b722f7ce3f5', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: '63d84b14aedaa84411db9b2ed6cc481369951207', onClick: () => { this.current++; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === this.last) ? true : false }, " ", h("jump-icon", { key: '0aec6f6e4141694ca45d41d4c40e1523afa4ac6e', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
33
+ h("jump-button", { key: 'a5d7ebcae749f265b8efe90fc04ad18dca4bdae2', onClick: () => { this.current = 1; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === 1) ? true : false }, " ", h("jump-icon", { key: '7cdf207787fe88998e0850ec85f64b917b170c74', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: '297ff533f48da04c0da5a7ab33342c5913768fcb', onClick: () => { this.current--; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === 1) ? true : false }, " ", h("jump-icon", { key: '13167c3b923ec229ff6112d246deaf7b59c3fbc7', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: 'b06cbb03ebc2c8fc4123051fd03177a80bc5a5ae', onClick: () => { this.current++; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === this.last) ? true : false }, " ", h("jump-icon", { key: 'be3783abb94b0e7b7fc7cbc3542923ecb22e0211', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
34
34
  // <button
35
35
  // onClick={() => {this.current = this.last}}
36
36
  // disabled={(this.current === this.last) ? true : false}
37
37
  // >
38
38
  // <jump-icon library="fa" category="regular" name="chevrons-right" size="small" slot="prefix"></jump-icon>
39
39
  // </button>
40
- h("jump-button", { key: '7895c3c9e513d8a54b70b900ecd223a8c9a434a2', onClick: () => { this.current = this.last; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === this.last) ? true : false }, " ", h("jump-icon", { key: '1d4f498831de1b30c53cd60d518f05744e2e08aa', slot: "suffix", name: "chevrons-right" }), " "))))));
40
+ h("jump-button", { key: 'a2c99a817aee2a4d3382e23952f30c7248a08b58', onClick: () => { this.current = this.last; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === this.last) ? true : false }, " ", h("jump-icon", { key: '6233f7f08663f11f680b23d376a168339c3b48ec', slot: "suffix", name: "chevrons-right" }), " "))))));
41
41
  }
42
42
  static get is() { return "jump-pagination"; }
43
43
  static get encapsulation() { return "shadow"; }
@@ -40,8 +40,9 @@ const TemplateWithListenerExample = (args, data) => {
40
40
  container = document.querySelector('#story--${id}');
41
41
  container.querySelector('#page-number').innerText = ${args.current};
42
42
 
43
- container.querySelector('jump-pagination').addEventListener('jump-change-page', (ev) => {
44
- container.querySelector('#page-number').innerText = ev.detail.current;
43
+ container.querySelector('jump-pagination').addEventListener('jump-accordion-open', (ev) => {
44
+ console.log('ev', ev.detail);
45
+ // container.querySelector('#page-number').innerText = ev.detail.current;
45
46
  });
46
47
  })();
47
48
  </script>`);
@@ -1 +1 @@
1
- {"version":3,"file":"jump-pagination.stories.js","sourceRoot":"","sources":["../../../src/components/jump-pagination/jump-pagination.stories.ts"],"names":[],"mappings":"AAAA,OAA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,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEtE,iBAAiB,CAAC,IAAI,GAAG;IACvB,gBAAgB,EAAE,KAAK;IACvB,OAAO,EAAE,CAAC;IACV,IAAI,EAAC,EAAE;IACP,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEvE,kBAAkB,CAAC,IAAI,GAAG;IACxB,gBAAgB,EAAE,IAAI;IACtB,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,IAAI;CACf,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml} from '../../utils/utils';\n\nexport default {\n title: 'Components/Pagination/PaginationBase',\n tags: ['autodocs'],\n argTypes: {\n pagLabel:{\n name: \"pag-label\",\n control: 'text',\n description: 'Indica la dicitura di paginazione. Di default è \"di\".'\n },\n \n showFirstAndLast: {\n name: 'show-first-and-last',\n control: 'boolean',\n description: 'Indica se mostrare le frecce aggiuntive per navigare rapidamente nella prima o ultima pagina. Da preferire con un numero elevato di pagine.'\n },\n current: {\n name: 'current-page',\n control: 'number',\n description: 'Pagina corrente'\n },\n last: {\n name: 'last',\n control: 'number',\n description: 'Indica l\\'ultima pagina',\n },\n }\n};\n\nconst TemplatePag = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-pagination ${attributes}></jump-pagination>`);\n};\n\nconst TemplateWithListenerExample = (args, data) => {\n let id = data.id;\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-pagination ${attributes}></jump-pagination>\n <div>La pagina corrente è: <span id=\"page-number\">loading..<span></div>\n <script>\n (function() {\n let container;\n container = document.querySelector('#story--${id}');\n container.querySelector('#page-number').innerText = ${args.current};\n\n container.querySelector('jump-pagination').addEventListener('jump-change-page', (ev) => {\n container.querySelector('#page-number').innerText = ev.detail.current;\n });\n })();\n </script>`);\n};\n\nexport const Playground = TemplatePag.bind({});\n\nPlayground.args = {\n showFirstAndLast: false,\n current: 1,\n last: 10,\n pagLabel: 'di'\n};\n\nexport const PaginationRidotto = TemplateWithListenerExample.bind({});\n\nPaginationRidotto.args = {\n showFirstAndLast: false,\n current: 1,\n last:10,\n pagLabel: 'di'\n};\n\nexport const PaginationCompleto = TemplateWithListenerExample.bind({});\n\nPaginationCompleto.args = {\n showFirstAndLast: true,\n current: 1,\n last: 10,\n pagLabel: 'di'\n};"]}
1
+ {"version":3,"file":"jump-pagination.stories.js","sourceRoot":"","sources":["../../../src/components/jump-pagination/jump-pagination.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,sCAAsC;IAC7C,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,QAAQ,EAAC;YACP,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,uDAAuD;SACrE;QAED,gBAAgB,EAAE;YAChB,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,6IAA6I;SAC3J;QACD,OAAO,EAAE;YACP,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,iBAAiB;SAC/B;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,yBAAyB;SACvC;KACF;CACF,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,EAAE;IAC3B,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,oBAAoB,UAAU,qBAAqB,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;IACjD,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACjB,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,oBAAoB,UAAU;;;;;4DAKU,EAAE;oEACM,IAAI,CAAC,OAAO;;;;;;;oBAO5D,CAAC,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAE/C,UAAU,CAAC,IAAI,GAAG;IAChB,gBAAgB,EAAE,KAAK;IACvB,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEtE,iBAAiB,CAAC,IAAI,GAAG;IACvB,gBAAgB,EAAE,KAAK;IACvB,OAAO,EAAE,CAAC;IACV,IAAI,EAAC,EAAE;IACP,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEvE,kBAAkB,CAAC,IAAI,GAAG;IACxB,gBAAgB,EAAE,IAAI;IACtB,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,IAAI;CACf,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml} from '../../utils/utils';\n\nexport default {\n title: 'Components/Pagination/PaginationBase',\n tags: ['autodocs'],\n argTypes: {\n pagLabel:{\n name: \"pag-label\",\n control: 'text',\n description: 'Indica la dicitura di paginazione. Di default è \"di\".'\n },\n \n showFirstAndLast: {\n name: 'show-first-and-last',\n control: 'boolean',\n description: 'Indica se mostrare le frecce aggiuntive per navigare rapidamente nella prima o ultima pagina. Da preferire con un numero elevato di pagine.'\n },\n current: {\n name: 'current-page',\n control: 'number',\n description: 'Pagina corrente'\n },\n last: {\n name: 'last',\n control: 'number',\n description: 'Indica l\\'ultima pagina',\n },\n }\n};\n\nconst TemplatePag = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-pagination ${attributes}></jump-pagination>`);\n};\n\nconst TemplateWithListenerExample = (args, data) => {\n let id = data.id;\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-pagination ${attributes}></jump-pagination>\n <div>La pagina corrente è: <span id=\"page-number\">loading..<span></div>\n <script>\n (function() {\n let container;\n container = document.querySelector('#story--${id}');\n container.querySelector('#page-number').innerText = ${args.current};\n\n container.querySelector('jump-pagination').addEventListener('jump-accordion-open', (ev) => {\n console.log('ev', ev.detail);\n // container.querySelector('#page-number').innerText = ev.detail.current;\n });\n })();\n </script>`);\n};\n\nexport const Playground = TemplatePag.bind({});\n\nPlayground.args = {\n showFirstAndLast: false,\n current: 1,\n last: 10,\n pagLabel: 'di'\n};\n\nexport const PaginationRidotto = TemplateWithListenerExample.bind({});\n\nPaginationRidotto.args = {\n showFirstAndLast: false,\n current: 1,\n last:10,\n pagLabel: 'di'\n};\n\nexport const PaginationCompleto = TemplateWithListenerExample.bind({});\n\nPaginationCompleto.args = {\n showFirstAndLast: true,\n current: 1,\n last: 10,\n pagLabel: 'di'\n};"]}
@@ -70,9 +70,9 @@ export class JumpPaginationTable {
70
70
  /* --------------------- RENDER ------------------------------- */
71
71
  render() {
72
72
  var _a;
73
- return (h(Host, { key: '05a8599e55a445dd1e803b8df91ef2771f0b1941', class: "JumpPaginationTable" }, h("div", { key: 'd00f99f46f33558003c3754bf8a65d4cb7ea2ff5', class: "JumpPaginationTable__Wrapper" }, h("div", { key: 'c4122e55c9d7abc0ef2f52dda5613213875c8673', class: "elementsPerPage" }, h("label", { key: '67ecdd093d02469464c29a42d14216614c904440', htmlFor: "elements" }, (_a = this.labelElementsPerPage) !== null && _a !== void 0 ? _a : 'Elements per page'), h("select", { key: 'd8526fe1d2a94916c59d3e10e0b31b469a2ad225', name: "elements", id: "elements", onChange: (e) => this.setElPerPage(e) }, this.elementsRangesArray.map((range) => (h("option", { value: range, selected: (this.elPerPage == range) && true }, range))))), h("div", { key: '1af9a68cdecc2ef679037a41365668f0939651de', class: "indicators" }, h("div", { key: 'dcd792ec4ac23aa5db99766c1e27cc97acefb44c', class: "elements" }, h("span", { key: '5bfecbba59eb57848e035935fcd86fdad4218181' }, h("span", { key: '718a5e16f8fd1d780644ac6c2f66956d35c915a6' }, this.first), " - ", h("span", { key: 'f01228e484b796f9fe0eed3b33db9c0322adc2e9' }, this.last), " ", this.pagLabel, " ", h("span", { key: 'da89d447174eea2a87fc3f6436d41733c7fd75e3' }, this.total))), h("div", { key: 'b79f5d6572d149c0fc20064c30fe2a12f400eaff', class: "arrow" }, this.showFirstAndLast &&
74
- h("jump-button", { key: '362c778424564efbebfaac46d5885d0f8167b66d', onClick: () => this.doChangePage('first'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: 'd5ddb68feed790ec0acbbbb257feefb2c6b67130', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: 'f74646227bae22cd864701ed3bb7e8ccfae69fa6', onClick: () => this.doChangePage('previous'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: '6329b6de01096205dd6b5edbf31364d6583c10d3', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: 'f5c1a6298bdc00ad4a5373f66f16ed5249c069a6', onClick: () => this.doChangePage('next'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '611c0b9618d584dfd5c3bd524563086379e93bd5', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
75
- h("jump-button", { key: '0aa79cbc25c6706b60aad1dd1c98b802be0dbad5', onClick: () => this.doChangePage('last'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: 'cd3b8e1fe1335084a1f2707bfd819696f79ab66d', slot: "suffix", name: "chevrons-right" }), " "))))));
73
+ return (h(Host, { key: '9b2d529a1a4dafefe9107bedf7704d73d75b8fcb', class: "JumpPaginationTable" }, h("div", { key: 'd09e5e9b4b368332b7f92f86be272c4a12d4ffec', class: "JumpPaginationTable__Wrapper" }, h("div", { key: 'e3af23dcf805cc6f529517c91f3f2fabbc543b35', class: "elementsPerPage" }, h("label", { key: 'c7558061326b23be95e391657224792d590bb918', htmlFor: "elements" }, (_a = this.labelElementsPerPage) !== null && _a !== void 0 ? _a : 'Elements per page'), h("select", { key: '96f73a7f3f3aedd6d059b2e0dd8ce9133ab6654e', name: "elements", id: "elements", onChange: (e) => this.setElPerPage(e) }, this.elementsRangesArray.map((range) => (h("option", { value: range, selected: (this.elPerPage == range) && true }, range))))), h("div", { key: '9160bf35ac48db7d2de9644da5f590b0bf6b0a3d', class: "indicators" }, h("div", { key: '09a475d1ac56cdfeb6135fe2b97f5758490981c3', class: "elements" }, h("span", { key: '3f11d9667843fb263353f2cdaa15fcfe7a6949dd' }, h("span", { key: '93024d6f5a7d7c44cc52a8c74dda2a62de0760e0' }, this.first), " - ", h("span", { key: '86324150394c9b2703919e05414d39e189738c9c' }, this.last), " ", this.pagLabel, " ", h("span", { key: '263569874c6a61abc9b4a854123496a4a2c3e6b8' }, this.total))), h("div", { key: '33730450809d5a29e0b878991c5dc33b9b15e03f', class: "arrow" }, this.showFirstAndLast &&
74
+ h("jump-button", { key: 'a56e565e29993942be493299fdcf7e52ca771f26', onClick: () => this.doChangePage('first'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: '996ac7867f6216d82f19367c5ffa68f2e76a62d5', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: '981929a37256f2b5dec3a7cee990bb48b49a4cc4', onClick: () => this.doChangePage('previous'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: '2b52a244117ec4b788ca0c09c6e5d43cdb61ef2d', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: '1150e0c8b53c344d3217224873b2303257070e16', onClick: () => this.doChangePage('next'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '7877f5b820eee313b898c1f60d81643217a84b62', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
75
+ h("jump-button", { key: '2a28e054e8fb46b256f5d6ea3d35a68e1f510458', onClick: () => this.doChangePage('last'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '913d1c6baaed22a5e746322866dc17b409c46cde', slot: "suffix", name: "chevrons-right" }), " "))))));
76
76
  }
77
77
  static get is() { return "jump-pagination-table"; }
78
78
  static get originalStyleUrls() {
@@ -44,11 +44,11 @@ export class JumpQuantity {
44
44
  }
45
45
  }
46
46
  render() {
47
- return (h(Host, { key: 'e0057c54218f8b181669d9d71ca4ffdd81be352d', value: this.value, "data-variant": this.variant, "data-hasbuttons": this.showButtons }, this.label && h("label", { key: '6e22578bc3c99d43674227a32828af7b1d021a6e' }, this.label), h("div", { key: 'e7fcdf05facc434247711e1b22e1ecb1dd1af870', class: `jump-quantity__InnerWrapper` }, this.showButtons &&
48
- h("jump-button", { key: 'e95187c85caa499e69a3ab99d25c66c1748b2435', onClick: () => this.value = this.value - this.step, disabled: this.value <= this.min, variant: 'neutral', size: 'custom' }, h("jump-icon", { key: '1940100b15763362a83b459344aa17bbcba6dcbb', library: "lucide", name: "minus", size: "small" })), h("input", { key: '60c9c2d3a8c05c8ebcef1ecc57ec9c1eb03708a5', ref: (el) => {
47
+ return (h(Host, { key: 'e6811567495ec8f0f16869fe2b212dab943a4270', value: this.value, "data-variant": this.variant, "data-hasbuttons": this.showButtons }, this.label && h("label", { key: 'dd4d955b9a235c21332047bc095c82a1d094c88a' }, this.label), h("div", { key: 'aef877055f40d01b7d10380ca6ed31e43361cf48', class: `jump-quantity__InnerWrapper` }, this.showButtons &&
48
+ h("jump-button", { key: '9475c6106e9b671e43ccf152b4ee2cb7ff08792a', onClick: () => this.value = this.value - this.step, disabled: this.value <= this.min, variant: 'neutral', size: 'custom' }, h("jump-icon", { key: '5f8035d8f1247efb13b5cc10740ed371d2b6a692', library: "lucide", name: "minus", size: "small" })), h("input", { key: '980ab6a976445d76346b3819d0656bbb38072f31', ref: (el) => {
49
49
  this.inputEl = el;
50
50
  }, type: 'number', value: this.value, onInput: (event) => this.handleChange(event), min: this.min, max: this.max, step: this.step, "aria-hasbuttons": this.showButtons }), this.showButtons &&
51
- h("jump-button", { key: '425df591c28196a39e783b48ea9cb505d6b45de8', onClick: () => this.value = this.value + this.step, disabled: this.value >= this.max, variant: 'neutral', size: 'custom' }, h("jump-icon", { key: 'c87adbc6aa13c8405026fcab77ad0f4b0a589b24', library: "lucide", name: "plus", size: "small" })))));
51
+ h("jump-button", { key: '9ebffb55fe109434fd5816bb9eb3772880f6bbe6', onClick: () => this.value = this.value + this.step, disabled: this.value >= this.max, variant: 'neutral', size: 'custom' }, h("jump-icon", { key: '348f7746cdbf81dc3661ee94655d594e52349463', library: "lucide", name: "plus", size: "small" })))));
52
52
  }
53
53
  static get is() { return "jump-quantity"; }
54
54
  static get encapsulation() { return "shadow"; }
@@ -72,7 +72,7 @@ export class JumpTab {
72
72
  }
73
73
  }
74
74
  render() {
75
- return (h(Host, { key: '8bee60d35e49d0afbc66a258108abc0242897206', class: "JumpTab", id: this.tabGroupName, ref: (el) => { this.JumpTabEl = el; } }, h("div", { key: '8328fe6bee0408102e0cba38f90c58b883908d3d', class: "Wrapper " + this.variant }, h("slot", { key: '0e4fd0e4d93148cdf01ff78abc36373dda53ae93', name: "tab-item" })), h("div", { key: '9540449ea09f1373e8aefd3fa1c503553e2077ae' }, h("slot", { key: 'e3bca29c3edb9f3ac12816ddebc8ac7b760d40a2', name: "tab-content" }))));
75
+ return (h(Host, { key: '3a44a455188ba68c8a032673181732b78cd9354e', class: "JumpTab", id: this.tabGroupName, ref: (el) => { this.JumpTabEl = el; } }, h("div", { key: 'c96a5609bbe3f72f1d587376cfae0e2dba5df433', class: "Wrapper " + this.variant }, h("slot", { key: 'aca6f37c75035073855dafcfb811065b23c40b75', name: "tab-item" })), h("div", { key: 'c16d14edc24c21f69e4bb72bc4a118b5011411df' }, h("slot", { key: 'ca9bf6d369db3be19d716c6395d6f922f0d477e2', name: "tab-content" }))));
76
76
  }
77
77
  static get is() { return "jump-tab"; }
78
78
  static get encapsulation() { return "shadow"; }
@@ -19,8 +19,8 @@ export class JumpTabItem {
19
19
  this.variant = parentVariant;
20
20
  }
21
21
  render() {
22
- return (h(Host, { key: 'ec76b7696f1bfe7383b816ef98aa4eda777d4db6', ref: (el) => { this.tabEl = el; }, class: "JumpTabItem " + (this.active ? 'active' : '') + " " + (this.variant) }, h("div", { key: '2aba84741fcbed6a07c403f3f99aa8013c8bd3b9', class: "Content " + (this.iconName ? this.iconPosition : '') + " " + (this.variant) + " " + (this.active ? 'active' : '') + " " + (this.disabled ? 'disabled' : ''), onClick: () => this.changeTab(this.identifier), id: this.identifier }, (this.iconName && (this.variant == 'inline' || this.variant == 'boxed')) &&
23
- h("jump-icon", { key: '69b1e176bc299254220f5f8993168952c5390b8e', library: "fa", category: "regular", name: this.iconName, size: "small" }), h("span", { key: 'aad7e1ce02c76e0a1dd2edc954a1d00c80e2ab4f', class: "label" }, this.label))));
22
+ return (h(Host, { key: '0bc03e23fbe7133b152ee378b40437975cabf5f8', ref: (el) => { this.tabEl = el; }, class: "JumpTabItem " + (this.active ? 'active' : '') + " " + (this.variant) }, h("div", { key: 'f34ea1bf3292b6ae1995f3b4d055d811fd3f8d80', class: "Content " + (this.iconName ? this.iconPosition : '') + " " + (this.variant) + " " + (this.active ? 'active' : '') + " " + (this.disabled ? 'disabled' : ''), onClick: () => this.changeTab(this.identifier), id: this.identifier }, (this.iconName && (this.variant == 'inline' || this.variant == 'boxed')) &&
23
+ h("jump-icon", { key: 'd2c483a3a4b997227336d31fe25f342951aeaf60', library: "fa", category: "regular", name: this.iconName, size: "small" }), h("span", { key: 'e4b14bbec4dee6288b618c2c6cfb1b1377b070c8', class: "label" }, this.label))));
24
24
  }
25
25
  static get is() { return "jump-tab-item"; }
26
26
  static get encapsulation() { return "shadow"; }
@@ -5,7 +5,7 @@ export class JumpTabPanel {
5
5
  this.active = false;
6
6
  }
7
7
  render() {
8
- return (h(Host, { key: 'cbfc39294110b805fa22518b6d8d169267d4b12b', class: "JumpTabPanel", id: this.identifier }, h("div", { key: '69b7bf0909ab5d36d1a04492ee1e2d9234f766cc', class: "JumpTabPanel__Content " + (this.active ? 'active' : '') }, h("slot", { key: '15176a1a4877ce88539c74b3d80fe9e8ab052bb7' }))));
8
+ return (h(Host, { key: 'f1915ec3ee0123aa64a1b7e5fca21617ccbc4ee0', class: "JumpTabPanel", id: this.identifier }, h("div", { key: 'd559e4945498ec4d17fd0ed6c4cc7fd79410b94b', class: "JumpTabPanel__Content " + (this.active ? 'active' : '') }, h("slot", { key: 'cddc57310ed0fc0a9090267a3f61eabd4770f8ee' }))));
9
9
  }
10
10
  static get is() { return "jump-tab-panel"; }
11
11
  static get encapsulation() { return "shadow"; }