mealz-components 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/accordion-Unx2E22K.js +19 -0
- package/dist/assets/product-card-wIoU7Z_5.js +189 -0
- package/dist/assets/promotion-badge-CDaL7Tqv.js +12 -0
- package/dist/basket-transfer-modal/basket-transfer-modal.min.js +5 -5
- package/dist/catalog/basket-preview/basket-preview.min.js +14 -14
- package/dist/catalog/catalog-category/catalog-category.min.js +1 -1
- package/dist/catalog/catalog-favorites/catalog-favorites.min.js +1 -1
- package/dist/catalog/catalog-history/catalog-history.min.js +1 -1
- package/dist/catalog/catalog-home/catalog-home.min.js +1 -1
- package/dist/catalog/catalog-home-header/catalog-home-header.min.js +1 -1
- package/dist/catalog/catalog-list/catalog-list.min.js +1 -1
- package/dist/catalog/catalog-tabs/catalog-tabs.min.js +1 -1
- package/dist/catalog/catalog-toolbar/catalog-toolbar.min.js +1 -1
- package/dist/catalog/my-meals-button/my-meals-button.min.js +1 -1
- package/dist/counter/counter.min.js +2 -2
- package/dist/drawer/drawer.min.js +5 -5
- package/dist/drawer-view-swapper/drawer-view-swapper.min.js +23 -23
- package/dist/history-drawer/history-drawer.min.js +1 -1
- package/dist/history-order/history-order.min.js +1 -1
- package/dist/history-order-expanded/history-order-expanded.min.js +1 -1
- package/dist/last-order-badge/last-order-badge.min.js +2 -2
- package/dist/last-order-modal/last-order-modal.min.js +4 -4
- package/dist/like-button/like-button.min.js +1 -1
- package/dist/modal/modal.min.js +4 -4
- package/dist/no-supplier-add-to-cart-cta/no-supplier-add-to-cart-cta.min.js +2 -2
- package/dist/onboarding/onboarding.min.js +2 -2
- package/dist/order-again/order-again.min.js +2 -2
- package/dist/planner/helpers/get-planner-onboarding-modal-config.min.js +1 -1
- package/dist/planner/helpers/init-planner-onboarding-modal.min.js +1 -1
- package/dist/planner/helpers/open-onboarding-modal.min.js +1 -1
- package/dist/planner/planner-abandon-modal/planner-abandon-modal.min.js +2 -2
- package/dist/planner/planner-budget-edit-modal/planner-budget-edit-modal.min.js +2 -2
- package/dist/planner/planner-budget-gauge/planner-budget-gauge.min.js +1 -1
- package/dist/planner/planner-catalog/planner-catalog.min.js +2 -2
- package/dist/planner/planner-current-menu/planner-current-menu.min.js +1 -1
- package/dist/planner/planner-current-menu-modal/planner-current-menu-modal.min.js +2 -2
- package/dist/planner/planner-dashboard/planner-dashboard.min.js +1 -1
- package/dist/planner/planner-form/planner-form.min.js +7 -7
- package/dist/planner/planner-menu-option/planner-menu-option.min.js +1 -1
- package/dist/planner/planner-onboarding/planner-onboarding.min.js +1 -1
- package/dist/planner/planner-onboarding-modal/planner-onboarding-modal.min.js +6 -6
- package/dist/planner/planner-open-catalog-modal/planner-open-catalog-modal.min.js +2 -2
- package/dist/planner/planner-quick-menu/planner-quick-menu.min.js +1 -1
- package/dist/planner/planner-recipe-card/planner-recipe-card.min.js +1 -1
- package/dist/planner/planner-recipe-list/planner-recipe-list.min.js +1 -1
- package/dist/planner/planner-recipe-suggestion/planner-recipe-suggestion.min.js +1 -1
- package/dist/planner/planner-welcome-modal/planner-welcome-modal.min.js +2 -2
- package/dist/planner/to-basket-loader/to-basket-loader.min.js +5 -5
- package/dist/planner-entry/planner-entry.min.js +1 -1
- package/dist/preferences/preferences.min.js +4 -4
- package/dist/price/price.min.js +3 -3
- package/dist/products-to-basket-cta/products-to-basket-cta.min.js +1 -1
- package/dist/recipe-card/recipe-card.min.js +1 -1
- package/dist/recipe-card-cta/recipe-card-cta.min.js +1 -1
- package/dist/recipe-details/recipe-details.min.js +93 -93
- package/dist/recipe-pricing/recipe-pricing.min.js +1 -1
- package/dist/recipe-to-basket/recipe-to-basket.min.js +1 -1
- package/dist/replace-item/replace-item-card/replace-item-card.min.js +11 -11
- package/dist/replace-item/replace-item.min.js +13 -13
- package/dist/replace-item-planner/replace-item-card-planner/replace-item-card-planner.min.js +4 -4
- package/dist/replace-item-planner/replace-item-planner.min.js +13 -13
- package/dist/select/select.min.js +6 -6
- package/dist/slider-tabs/slider-tabs.min.js +3 -3
- package/dist/store-indicator/store-indicator.min.js +2 -2
- package/dist/store-locator/store-locator.min.js +2 -2
- package/dist/store-locator-drawer/store-locator-drawer.min.js +2 -2
- package/dist/supplier-selector/supplier-selector.min.js +6 -6
- package/package.json +1 -1
- package/dist/assets/accordion-sjJSL32r.js +0 -19
- package/dist/assets/custom-element-BhZVzxrc.js +0 -5
- package/dist/assets/product-card-TLfT6URx.js +0 -189
- package/dist/assets/promotion-badge-B-er7bV2.js +0 -12
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import"../price/price.min.js";import"../counter/counter.min.js";import"./promotion-badge-B-er7bV2.js";import{N as v,k as r,D as f}from"./no-shadow-element-D62BBu0I.js";import{t as g}from"./custom-element-BhZVzxrc.js";import{n as o}from"./property-CoRN-Ln2.js";import{G as k}from"./guestObserver-C5qvv1Ll.js";import{c as P}from"./capitalize-DUAqYmp4.js";import{m as c}from"./mealz-sdk-E_fNZM-c.js";import{d as I}from"./delay-DHNms76g.js";import{P as O}from"./price-D6RVRYHJ.js";var C=Object.defineProperty,x=Object.getOwnPropertyDescriptor,y=(t,e,i,a)=>{for(var s=a>1?void 0:a?x(e,i):e,d=t.length-1,n;d>=0;d--)(n=t[d])&&(s=(a?n(e,i,s):n(s))||s);return a&&s&&C(e,i,s),s};let u=class extends v{constructor(){super(),this.isSponsored=!1,this.priceService=O.getInstance(),this.styleURL=new URL("./product-badges/product-badges.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.applyStartingDataFromAttribute()}formatNumber(t){const e=c.user.getLanguage()||"fr";return new Intl.NumberFormat(e,{minimumFractionDigits:1,maximumFractionDigits:2}).format(t)}render(){var t,e,i,a,s;return r`
|
|
2
|
-
<div class="mealz-product-badges">
|
|
3
|
-
<!-- SPONSORED BADGE -->
|
|
4
|
-
${this.isSponsored?r`
|
|
5
|
-
<div class="mealz-ds-badge mealz-ds-text size-xs weight-l">
|
|
6
|
-
<span>Sponsorisé</span>
|
|
7
|
-
</div>
|
|
8
|
-
`:r``}
|
|
9
|
-
<!-- PRODUCT CAPACITY -->
|
|
10
|
-
${(t=this.item)!=null&&t.capacityVolume||(i=(e=this.item)==null?void 0:e.attributes)!=null&&i["capacity-volume"]?r`
|
|
11
|
-
<div class="mealz-ds-badge mealz-ds-text size-xs weight-l outline">
|
|
12
|
-
${this.formatNumber(this.item.capacityVolume||this.item.attributes["capacity-volume"])}
|
|
13
|
-
${this.item.capacityUnit||this.item.attributes["capacity-unit"]}
|
|
14
|
-
</div>
|
|
15
|
-
`:r``}
|
|
16
|
-
<!-- PRODUCT PRICE PER UNIT -->
|
|
17
|
-
${(a=this.price)!=null&&a.pricePerUnit&&((s=this.price)!=null&&s.unitOfMeasurement)?r`
|
|
18
|
-
<span class="mealz-ds-text size-xs mealz-product-badges__details product-price-per-unit">
|
|
19
|
-
${this.priceService.priceTemplate(this.price.pricePerUnit)}
|
|
20
|
-
/${this.price.unitOfMeasurement}
|
|
21
|
-
</span>
|
|
22
|
-
`:r``}
|
|
23
|
-
</div>
|
|
24
|
-
`}applyStartingDataFromAttribute(){const t=this.getAttribute("starting-data");if(t){try{const e=JSON.parse(t);typeof e.isSponsored=="boolean"&&(this.isSponsored=e.isSponsored)}catch(e){console.warn("[product-badges] starting-data parse error",e)}this.removeAttribute("starting-data")}}};y([o({type:Boolean})],u.prototype,"isSponsored",2);y([o({type:Object})],u.prototype,"item",2);y([o({type:Object})],u.prototype,"price",2);u=y([g("mealz-product-badges")],u);customElements.get("mealz-product-badges")||customElements.define("mealz-product-badges",u);var R=Object.defineProperty,U=Object.getOwnPropertyDescriptor,$=(t,e,i,a)=>{for(var s=a>1?void 0:a?U(e,i):e,d=t.length-1,n;d>=0;d--)(n=t[d])&&(s=(a?n(e,i,s):n(s))||s);return a&&s&&R(e,i,s),s};let h=class extends v{constructor(){super(),this.styleURL=new URL("./unavailable-badge/unavailable-badge.css",this.getBaseURL())}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}clicked(){const t=new CustomEvent("clicked",{bubbles:!0,composed:!0});this.dispatchEvent(t)}render(){return r`
|
|
25
|
-
<button
|
|
26
|
-
class="mealz-ds-badge mealz-unavailable-badge ${this.numberUnavailable?"pointer":""}"
|
|
27
|
-
?disabled="${!this.numberUnavailable}"
|
|
28
|
-
@click="${()=>this.clicked()}">
|
|
29
|
-
<div class="mealz-unavailable-badge__icon">!</div>
|
|
30
|
-
${this.numberUnavailable?"":r`<span>Indisponible</span>`}
|
|
31
|
-
${this.numberUnavailable?r`<span>${this.numberUnavailable}</span>`:""}
|
|
32
|
-
${this.numberUnavailable&&this.numberUnavailable<=1?r`<span>produit indisponible</span>`:""}
|
|
33
|
-
${this.numberUnavailable&&this.numberUnavailable>1?r`<span>produits indisponible</span>`:""}
|
|
34
|
-
</button>
|
|
35
|
-
`}};$([o({type:Number})],h.prototype,"numberUnavailable",2);h=$([g("mealz-unavailable-badge")],h);customElements.get("mealz-unavailable-badge")||customElements.define("mealz-unavailable-badge",h);var A=Object.defineProperty,S=Object.getOwnPropertyDescriptor,E=(t,e,i,a)=>{for(var s=a>1?void 0:a?S(e,i):e,d=t.length-1,n;d>=0;d--)(n=t[d])&&(s=(a?n(e,i,s):n(s))||s);return a&&s&&A(e,i,s),s};let b=class extends v{constructor(){super(),this.styleURL=new URL("./out-of-stock-overlay/out-of-stock-overlay.css",this.getBaseURL())}replacedClicked(){const t=new CustomEvent("replacedClicked",{bubbles:!0,composed:!0});this.dispatchEvent(t)}render(){return r`
|
|
36
|
-
<div class="mealz-out-of-stock-overlay">
|
|
37
|
-
<div class="mealz-out-of-stock-overlay__container"></div>
|
|
38
|
-
<div class="mealz-out-of-stock-overlay__footer">
|
|
39
|
-
<mealz-unavailable-badge></mealz-unavailable-badge>
|
|
40
|
-
<button @click="${()=>this.replacedClicked()}"
|
|
41
|
-
class="mealz-ds-button mealz-ds-text weight-l small primary reverse">Remplacer</button>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
`}};E([o()],b.prototype,"priceData",2);b=E([g("mealz-out-of-stock-overlay")],b);customElements.get("mealz-out-of-stock-overlay")||customElements.define("mealz-out-of-stock-overlay",b);var B=Object.defineProperty,w=Object.getOwnPropertyDescriptor,m=(t,e,i,a)=>{for(var s=a>1?void 0:a?w(e,i):e,d=t.length-1,n;d>=0;d--)(n=t[d])&&(s=(a?n(e,i,s):n(s))||s);return a&&s&&B(e,i,s),s};const _=["ignored","deleted","often_deleted","unavailable"],z=["ignored","deleted","often_deleted"],D=["initial","active","out_of_stock"],T=["initial","out_of_stock"];let l=class extends v{constructor(){super(),this.recipeId="",this.initialGuests=0,this.currentGuests=0,this.inBasket=!1,this.isSponsored=!1,this.analyticsPath="",this.subscriptions=[],this.loadingAddToBasket=!1,this.ingredientIsRemoved=!1,this.guestObserverService=k.getInstance(),this.modifiedIngQty=0,this.styleURL=new URL("./product-card/product-card.css",this.getBaseURL())}get status(){var t,e;return(e=(t=this.product)==null?void 0:t.basketEntry)==null?void 0:e.status}set status(t){this.product.basketEntry.status=t}get productImage(){return this.product.basketEntry.selectedItem.attributes.image||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}get ingredientPicture(){return this.product.ingredient.picture||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}get props(){var s;const t=((s=this.product)==null?void 0:s.basketEntry)||{},e=t.attributes||{},i=t.selectedItem||t.relationships&&t.relationships["selected-item"]&&t.relationships["selected-item"].data||{},a=i&&i.attributes||{};return{entry_name:e.name??"",item_id:i.id??"",ext_item_id:a["ext-id"]??"",item_ean:a.ean??"",product_quantity:e.quantity!=null?String(e.quantity):""}}get selectors(){return{ignoreButton:".mealz-product-card__ignore-product",replaceButton:".mealz-product-card__replace-product",addProductButton:".mealz-product-card__add-product"}}updated(){var t,e;this.product&&(this.status==="deleted"&&(this.ingredientIsRemoved=!1),this.isSponsored=((e=(t=this.product.basketEntry.selectedItem)==null?void 0:t.attributes)==null?void 0:e.sponsored)===!0)}connectedCallback(){var t;super.connectedCallback(),this.listenGuestsChange(),this.productIsBeingAdded(),this.isRecipeInBasket(),(t=this.product)!=null&&t.ingredient&&this.calculateQty(),this.analyticsPath=`/recipes/${this.recipeId}/shopping`}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe())}listenGuestsChange(){this.subscriptions.push(this.guestObserverService.guests$.subscribe(t=>{this.currentGuests=t,this.calculateQty()}))}calculateQty(){var s,d,n,p;if(!this.isConnected||!((s=this.product)!=null&&s.ingredient))return;const t=((d=this.product.ingredient)==null?void 0:d.quantity)??((p=(n=this.product.ingredient)==null?void 0:n.attributes)==null?void 0:p.quantity),e=Number(t),i=this.initialGuests||1;if(!Number.isFinite(e))return;const a=e/i;this.modifiedIngQty=Number((a*(this.currentGuests||i)).toFixed(2)),this.requestUpdate()}replaceProduct(t){var i,a,s,d;if(this.sendEntryReplaceEvent(),!!this.closest("mealz-recipe-details"))c.recipes.replaceBasketEntry(this.product.basketEntry,t);else{const n=(i=this.product)==null?void 0:i.basketEntry;n.name||(n.name=((d=(s=(a=this.product)==null?void 0:a.basketEntry)==null?void 0:s.attributes)==null?void 0:d.name)||""),c.replaceItem.basketEntryToReplace$.next({basketEntry:n,ignoreSelected:t,ingredient:this.product.ingredient,addProductMode:!1,initialGuests:this.initialGuests||4,currentGuests:this.currentGuests||this.initialGuests||4}),this.requestUpdate()}this.scrollBackWhenReplaced()}scrollBackWhenReplaced(){this.subscriptions.push(c.productAddition.productAdded$.pipe(I(200)).subscribe(()=>{this.isConnected&&(this.scrollIntoView({behavior:"smooth",block:"center"}),this.requestUpdate())}))}isInXRecipes(){var e;const t=(e=this.product)==null?void 0:e.basketEntry;return!t||t.status!=="active"?1:Array.isArray(t.recipesIds)?t.recipesIds.length:1}isRecipeInBasket(){this.subscriptions.push(c.recipes.recipePrice$.subscribe(t=>{this.inBasket=t.inBasket>0}))}ignoreProduct(){this.sendEntryIgnoreEvent(),c.recipes.ignoreProduct(this.product),this.requestUpdate()}updateQuantity(t){this.product.basketEntry.quantity!==t.detail.value&&(t.detail.value<1?(this.ingredientIsRemoved=!0,c.recipes.ingredientRemoved(this.product.ingredient,{originPath:this.analyticsPath,props:{}}),this.sendEntryDeleteEvent()):c.recipes.updateProductQuantity(this.product.basketEntry,t.detail.value,{originPath:this.analyticsPath,props:{}}),c.recipes.updateIngredientFromBasketLoading$.next(!0),this.requestUpdate())}addToBasket(){this.sendEntryAddEvent(),c.recipes.addToBasket(this.product,{props:{},originPath:this.analyticsPath}),this.requestUpdate()}productIsBeingAdded(){this.subscriptions.push(c.recipes.productIsBeingAdded(this.product.basketEntry).subscribe(t=>{this.loadingAddToBasket=t,this.requestUpdate()}))}render(){var t;return r`
|
|
45
|
-
${(t=this.product)!=null&&t.basketEntry?this.renderProductCard():f}
|
|
46
|
-
`}renderProductCard(){return r`
|
|
47
|
-
<div
|
|
48
|
-
class="mealz-product-card
|
|
49
|
-
${this.status==="active"?"added":""}
|
|
50
|
-
${_.includes(this.status)?"disabled":""}
|
|
51
|
-
${this.status==="out_of_stock"?"out_of_stock":""} ${this.status==="unavailable"?"unavailable":""}"
|
|
52
|
-
>
|
|
53
|
-
${this.renderOutOfStockOverlay()}
|
|
54
|
-
${this.renderHeader()}
|
|
55
|
-
<div
|
|
56
|
-
class="
|
|
57
|
-
mealz-product-card__content
|
|
58
|
-
${z.includes(this.status)?"disabled":""}
|
|
59
|
-
${this.status==="unavailable"?"unavailable":""}">
|
|
60
|
-
${D.includes(this.status)?this.renderEnabledProductCard():this.renderDisabledOrUnavailableProduct()}
|
|
61
|
-
</div>
|
|
62
|
-
${this.renderCalculatedForXRecipes()}
|
|
63
|
-
</div>
|
|
64
|
-
`}renderEnabledProductCard(){var t,e,i,a,s,d,n,p;return r`
|
|
65
|
-
<mealz-promotion-badge .priceData="${this.product.price}"></mealz-promotion-badge>
|
|
66
|
-
<div class="mealz-product-card__selected-product">
|
|
67
|
-
<div class="mealz-product-card__picture-column">
|
|
68
|
-
<img class="mealz-product-card__picture" alt="${((a=(i=(e=(t=this.product)==null?void 0:t.basketEntry)==null?void 0:e.selectedItem)==null?void 0:i.attributes)==null?void 0:a.brand)||""} ${((p=(n=(d=(s=this.product)==null?void 0:s.basketEntry)==null?void 0:d.selectedItem)==null?void 0:n.attributes)==null?void 0:p.name)||"product"}" src="${this.productImage}">
|
|
69
|
-
</div>
|
|
70
|
-
<div class="mealz-product-card__info-column">
|
|
71
|
-
<span class="mealz-ds-text size-xs weight-xl mealz-product-card__details product-brand">
|
|
72
|
-
${this.product.basketEntry.selectedItem.attributes.brand}
|
|
73
|
-
</span>
|
|
74
|
-
<span class="mealz-ds-text size-xs mealz-product-card__details product-fullname">
|
|
75
|
-
${this.product.basketEntry.selectedItem.attributes.name}
|
|
76
|
-
</span>
|
|
77
|
-
<mealz-product-badges
|
|
78
|
-
.isSponsored="${this.isSponsored}"
|
|
79
|
-
.item="${this.product.basketEntry.selectedItem}"
|
|
80
|
-
.price="${this.product.price}"
|
|
81
|
-
></mealz-product-badges>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
<div class="mealz-product-card__lower-action">
|
|
85
|
-
<mealz-price
|
|
86
|
-
class="mealz-product-card__price mealz-ds-text size-l weight-xxl"
|
|
87
|
-
.price="${this.product.price.unit}">
|
|
88
|
-
</mealz-price>
|
|
89
|
-
<div class="mealz-product-card__cta">
|
|
90
|
-
${this.renderCTA()}
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
${this.renderFooterActions()}
|
|
94
|
-
`}renderOutOfStockOverlay(){return this.status==="out_of_stock"?r`
|
|
95
|
-
<mealz-out-of-stock-overlay
|
|
96
|
-
@replacedClicked="${()=>this.replaceProduct(!0)}"></mealz-out-of-stock-overlay>
|
|
97
|
-
`:f}renderHeader(){return r`
|
|
98
|
-
<div
|
|
99
|
-
class="mealz-product-card__header
|
|
100
|
-
${this.status==="active"?"added":""}
|
|
101
|
-
${z.includes(this.status)?"disabled":""}
|
|
102
|
-
${this.status==="unavailable"?"unavailable":""}">
|
|
103
|
-
<span
|
|
104
|
-
class="
|
|
105
|
-
mealz-product-card__header-name
|
|
106
|
-
mealz-ds-text weight-xl
|
|
107
|
-
${_.includes(this.status)?"mealz-product-card__disabled-text":""}"
|
|
108
|
-
>
|
|
109
|
-
${P(this.product.basketEntry.name)}
|
|
110
|
-
</span>
|
|
111
|
-
<span
|
|
112
|
-
class="
|
|
113
|
-
mealz-product-card__header-quantity
|
|
114
|
-
mealz-ds-text size-s weight-l
|
|
115
|
-
${_.includes(this.status)?"mealz-product-card__disabled-text":""}"
|
|
116
|
-
>
|
|
117
|
-
<span>${this.modifiedIngQty?this.modifiedIngQty:this.product.ingredient.quantity}</span>
|
|
118
|
-
<span>${this.product.ingredient.attributes.unit}</span>
|
|
119
|
-
</span>
|
|
120
|
-
</div>
|
|
121
|
-
`}renderCalculatedForXRecipes(){var t;return r`
|
|
122
|
-
${(t=this.product)!=null&&t.basketEntry&&this.isInXRecipes()>1&&this.status==="active"?r`
|
|
123
|
-
<div class="mealz-product-card__footer">
|
|
124
|
-
<div class="mealz-ds-text size-xs weight-xl light-text">
|
|
125
|
-
<span>Calculé pour </span>
|
|
126
|
-
<span>${this.isInXRecipes()}</span>
|
|
127
|
-
<span> repas</span>
|
|
128
|
-
</div>
|
|
129
|
-
</div>
|
|
130
|
-
`:""}
|
|
131
|
-
`}renderFooterActions(){return r`
|
|
132
|
-
<div class="mealz-product-card__footer__actions">
|
|
133
|
-
${this.status==="initial"?r`
|
|
134
|
-
<button
|
|
135
|
-
class="mealz-ds-button mealz-ds-text weight-l mealz-product-card__ignore-product ghost small"
|
|
136
|
-
@click="${()=>this.ignoreProduct()}">
|
|
137
|
-
<span class="mealz-product-card__disabled-text">Ignorer produit</span>
|
|
138
|
-
</button>
|
|
139
|
-
`:""}
|
|
140
|
-
<button
|
|
141
|
-
@click="${()=>this.replaceProduct(this.status==="initial")}"
|
|
142
|
-
class="mealz-product-card__replace-product mealz-ds-button ghost mealz-ds-text size-s weight-xl"
|
|
143
|
-
>
|
|
144
|
-
<span>Remplacer</span>
|
|
145
|
-
</button>
|
|
146
|
-
</div>
|
|
147
|
-
`}renderCTA(){return T.includes(this.status)?r`
|
|
148
|
-
${this.loadingAddToBasket?r`
|
|
149
|
-
<button class="mealz-ds-button mealz-product-card__loading-button square primary">
|
|
150
|
-
<div class="mealz-ds-loader"></div>
|
|
151
|
-
</button>
|
|
152
|
-
`:r`
|
|
153
|
-
<!-- TODO: add disabled state -->
|
|
154
|
-
<button class="mealz-ds-button mealz-product-card__add-product square primary"
|
|
155
|
-
@click="${()=>this.addToBasket()}">
|
|
156
|
-
<img alt="basket icon"
|
|
157
|
-
src="https://storage.googleapis.com/assets.miam.tech/generic/icons/Basket.svg"/>
|
|
158
|
-
</button>
|
|
159
|
-
`}
|
|
160
|
-
`:this.status==="active"?r`
|
|
161
|
-
<mealz-counter
|
|
162
|
-
.value="${this.product.basketEntry.quantity}"
|
|
163
|
-
.min="${0}"
|
|
164
|
-
.biColor="${!0}"
|
|
165
|
-
.debounce="${300}"
|
|
166
|
-
.minusLoading="${this.ingredientIsRemoved}"
|
|
167
|
-
@valueChange="${t=>this.updateQuantity(t)}"
|
|
168
|
-
></mealz-counter>
|
|
169
|
-
`:r``}renderDisabledOrUnavailableProduct(){return r`
|
|
170
|
-
${z.includes(this.status)?r`
|
|
171
|
-
<span class="mealz-ds-text mealz-product-card__disabled-text">
|
|
172
|
-
Cet ingrédient ne sera pas ajouté à votre panier
|
|
173
|
-
</span>
|
|
174
|
-
<button
|
|
175
|
-
class="mealz-product-card__replace-product-from-disabled mealz-ds-button mealz-ds-text size-s weight-xl primary reverse small"
|
|
176
|
-
@click="${()=>this.replaceProduct(!0)}">
|
|
177
|
-
<span>Ajouter un produit</span>
|
|
178
|
-
</button>
|
|
179
|
-
`:""}
|
|
180
|
-
${this.status==="unavailable"?r`
|
|
181
|
-
<img class="mealz-ds-avatar" src="${this.ingredientPicture}" alt="ingredient picture">
|
|
182
|
-
<mealz-unavailable-badge></mealz-unavailable-badge>
|
|
183
|
-
<button
|
|
184
|
-
class="mealz-product-card__replace-product-from-unavailable mealz-ds-button mealz-ds-text size-s weight-xl primary reverse small"
|
|
185
|
-
@click="${()=>this.replaceProduct(!0)}">
|
|
186
|
-
<span>Remplacer</span>
|
|
187
|
-
</button>
|
|
188
|
-
`:""}
|
|
189
|
-
`}sendEntryAddEvent(){c.analytics.sendEvent("entry.add",this.analyticsPath,this.props)}sendEntryReplaceEvent(){c.analytics.sendEvent("entry.replace",this.analyticsPath,this.props)}sendEntryIgnoreEvent(){c.analytics.sendEvent("entry.ignore",this.analyticsPath,this.props)}sendEntryDeleteEvent(){c.analytics.sendEvent("entry.delete",this.analyticsPath,this.props)}};m([o({type:Object})],l.prototype,"product",2);m([o({type:String})],l.prototype,"recipeId",2);m([o({type:Number})],l.prototype,"initialGuests",2);m([o({type:Number})],l.prototype,"currentGuests",2);l=m([g("mealz-product-card")],l);customElements.get("mealz-product-card")||customElements.define("mealz-product-card",l);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{N as c,k as n}from"./no-shadow-element-D62BBu0I.js";import{t as l}from"./custom-element-BhZVzxrc.js";import{n as d}from"./property-CoRN-Ln2.js";import{P as u}from"./price-D6RVRYHJ.js";var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=(e,o,s,r)=>{for(var t=r>1?void 0:r?f(o,s):o,a=e.length-1,m;a>=0;a--)(m=e[a])&&(t=(r?m(o,s,t):m(t))||t);return r&&t&&g(o,s,t),t};let i=class extends c{constructor(){super(),this.priceService=u.getInstance(),this.styleURL=new URL("./promotion-badge/promotion-badge.css",this.getBaseURL())}getPriceAmountSuffix(){var e;return(e=this.priceData.discountType)!=null&&e.endsWith("_perc")?"%":this.priceService.currencySymbol()}render(){var e;return n`
|
|
2
|
-
<div class="mealz-promotion-badge">
|
|
3
|
-
${((e=this.priceData)==null?void 0:e.discountAmount)>0?n`
|
|
4
|
-
<div class="mealz-ds-badge mealz-promotion-badge__promotion">
|
|
5
|
-
<span class="mealz-promotion-badge__promotion-value mealz-ds-text size-s weight-l">
|
|
6
|
-
${this.priceData.discountAmount}${this.getPriceAmountSuffix()}
|
|
7
|
-
</span>
|
|
8
|
-
<span class="mealz-promotion-badge__promotion-text mealz-ds-text size-s weight-l">de remise immédiate</span>
|
|
9
|
-
</div>
|
|
10
|
-
`:""}
|
|
11
|
-
</div>
|
|
12
|
-
`}};p([d()],i.prototype,"priceData",2);i=p([l("mealz-promotion-badge")],i);customElements.get("mealz-promotion-badge")||customElements.define("mealz-promotion-badge",i);
|