wickes-css2 2.98.0-develop.7 → 2.98.0-develop.9

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 (169) hide show
  1. package/Readme.md +3 -3
  2. package/build/css/category-main.css +1 -1
  3. package/build/css/components/checkout-payment-details-v2.css +1 -1
  4. package/build/css/components/energy-efficiency.css +1 -1
  5. package/build/css/components/global-search.css +1 -1
  6. package/build/css/components/legal-info.css +1 -1
  7. package/build/css/components/loader.css +1 -1
  8. package/build/css/components/price-block-v2-critical.css +1 -1
  9. package/build/css/components/price-block-v2.css +1 -1
  10. package/build/css/homepage-main.css +1 -1
  11. package/build/css/main.css +1 -1
  12. package/build/css/my-account-main-v2.css +1 -1
  13. package/build/css/my-account-main.css +1 -1
  14. package/build/css/pages/checkout-new.css +1 -1
  15. package/build/css/pages/checkout.css +1 -1
  16. package/build/css/pages/my-account-v2.css +1 -1
  17. package/build/css/pages/page_home.css +1 -1
  18. package/build/css/pages/page_my-order.css +1 -1
  19. package/build/css/pages/page_my-orders.css +1 -1
  20. package/build/css/pages/page_quiz.css +1 -1
  21. package/build/css/pages/page_track-my-order.css +1 -1
  22. package/build/css/pages/page_wismo-details.css +1 -1
  23. package/build/css/pdp-main-before-combine.css +1 -1
  24. package/build/css/pdp-main-critical.css +1 -1
  25. package/build/css/pdp-main-non-critical.css +1 -1
  26. package/build/css/pdp-main.css +1 -1
  27. package/build/css/plp-main.css +1 -1
  28. package/build/css/store-locator-main.css +1 -1
  29. package/build/img/billie-logo.svg +4 -0
  30. package/build/img/billie-modal.svg +4 -0
  31. package/build/img/billie-pdp.svg +11 -0
  32. package/build/img/billie-spinner.svg +5 -0
  33. package/build/img/billie.svg +4 -0
  34. package/build/img/calm-primary-logo.png +0 -0
  35. package/build/img/payment/checkout/billie.svg +4 -0
  36. package/build/img/payment/footer/billie.svg +4 -0
  37. package/build/js/basket.min.js +2 -2
  38. package/build/js/bundle.min.js +1 -1
  39. package/build/js/checkout.min.js +1 -1
  40. package/build/js/emulation.min.js +55 -131
  41. package/build/js/general.bundle.min.js +1 -1
  42. package/build/js/merged-checkout.min.js +1 -1
  43. package/build/js/page/basket-v2.js +16 -7
  44. package/build/js/page/billie-business-type.js +34 -0
  45. package/build/js/page/checkout-payment-details.js +8 -0
  46. package/build/js/page/components/charity.js +58 -43
  47. package/build/js/page/components/modal-observer.js +51 -0
  48. package/build/js/page/pdp.js +1 -4
  49. package/build/js/pdp.bundle.min.js +1 -1
  50. package/build/js/plp.bundle.min.js +1 -1
  51. package/build/js/project-list.min.js +1 -1
  52. package/package.json +2 -2
  53. package/src/components/address-billie.hbs +42 -0
  54. package/src/components/address-postcode-look-up.hbs +2 -2
  55. package/src/components/basket-charity-donations-new.hbs +40 -0
  56. package/src/components/billie-modal.hbs +41 -0
  57. package/src/components/billie-online-messaging.hbs +14 -0
  58. package/src/components/checkout-edit-billing-address.hbs +20 -6
  59. package/src/components/checkout-payment-details-v2.hbs +94 -55
  60. package/src/components/checkout-payment-info-block.hbs +49 -0
  61. package/src/components/checkout-payment-option.hbs +40 -0
  62. package/src/components/checkout_order-summary-new.hbs +13 -18
  63. package/src/components/checkout_payment-new.hbs +10 -1
  64. package/src/components/donation-cart-new.hbs +38 -0
  65. package/src/components/header-minicart.hbs +3 -3
  66. package/src/components/legal-info.hbs +25 -22
  67. package/src/components/modal.hbs +4 -1
  68. package/src/components/my-account/active-orders/list-orders.hbs +1 -1
  69. package/src/components/my-account/active-orders/order.hbs +2 -0
  70. package/src/components/my-account/active-orders/payment-status.hbs +17 -0
  71. package/src/components/my-account/payment-status.hbs +19 -0
  72. package/src/components/my-account/saving-totaliser.hbs +52 -0
  73. package/src/components/order-summary.hbs +3 -0
  74. package/src/components/payment-loader.hbs +59 -21
  75. package/src/components/payments-checkout-v2.hbs +12 -6
  76. package/src/components/payments-checkout.hbs +6 -0
  77. package/src/components/payments.hbs +10 -4
  78. package/src/components/pdp-price-actions.hbs +1 -1
  79. package/src/components/price-block-v2.hbs +14 -8
  80. package/src/components/track-my-order-info.hbs +3 -1
  81. package/src/components/wismo-payment.hbs +16 -0
  82. package/src/data/data_confirmation-summary.json +3 -3
  83. package/src/data/data_latest-offers.json +1 -1
  84. package/src/data/data_mini-basket.json +6 -80
  85. package/src/data/data_page-category.json +1 -2
  86. package/src/data/data_page-merge-basket.json +1 -1
  87. package/src/data/data_shopping-cart-v2.json +51 -0
  88. package/src/data/data_store-locator-v2.json +1 -1
  89. package/src/data/data_wismo.json +53 -0
  90. package/src/data/my-account/data_my-account.json +57 -0
  91. package/src/elements/radiobutton.hbs +7 -0
  92. package/src/img/billie-logo.svg +4 -0
  93. package/src/img/billie-modal.svg +4 -0
  94. package/src/img/billie-pdp.svg +11 -0
  95. package/src/img/billie-spinner.svg +5 -0
  96. package/src/img/billie.svg +4 -0
  97. package/src/img/calm-primary-logo.png +0 -0
  98. package/src/img/payment/checkout/billie.svg +4 -0
  99. package/src/img/payment/footer/billie.svg +4 -0
  100. package/src/js/components/general/text-clamp.js +1 -2
  101. package/src/js/emulation/big-wins.js +29 -29
  102. package/src/js/emulation/mock.js +1 -60
  103. package/src/js/emulation/paymentLoader.js +22 -11
  104. package/src/js/emulation/popover-mini-basket.js +2 -2
  105. package/src/js/page/basket-v2.js +16 -7
  106. package/src/js/page/billie-business-type.js +34 -0
  107. package/src/js/page/checkout-payment-details.js +8 -0
  108. package/src/js/page/components/charity.js +58 -43
  109. package/src/js/page/components/modal-observer.js +51 -0
  110. package/src/js/page/pdp.js +1 -4
  111. package/src/layouts/base.hbs +0 -6
  112. package/src/layouts/my-account-v2.hbs +0 -7
  113. package/src/page_basket-billie.html +54 -0
  114. package/src/page_checkout_confirmation-billie.html +339 -0
  115. package/src/page_checkout_delivery-address-customer-journey.html +2 -2
  116. package/src/page_my-account-trade-pro-components.html +27 -0
  117. package/src/page_my-account-trade-pro.html +7 -0
  118. package/src/page_my-account.html +1 -0
  119. package/src/page_my-order.html +1 -1
  120. package/src/page_payment-details-with-billie.html +67 -0
  121. package/src/page_product-details-billie.html +87 -0
  122. package/src/page_product-details-saved-pl.html +13 -16
  123. package/src/page_product-details-with-global-search-v2.html +0 -1
  124. package/src/page_shopping-cart-v2.html +4 -3
  125. package/src/page_wismo-details.html +2 -2
  126. package/src/partials/head.hbs +1 -5
  127. package/src/scss/common/_app.scss +0 -1
  128. package/src/scss/common/_elements.scss +4 -0
  129. package/src/scss/common/_scroll-disable.scss +2 -4
  130. package/src/scss/components/_billie-modal.scss +181 -0
  131. package/src/scss/components/_billie-online-messaging.scss +46 -0
  132. package/src/scss/components/_charity-donations.scss +114 -186
  133. package/src/scss/components/_donation-cart-new.scss +192 -0
  134. package/src/scss/components/_payments-checkout.scss +2 -1
  135. package/src/scss/components/_payments-v2.scss +8 -0
  136. package/src/scss/components/_tooltip.scss +19 -0
  137. package/src/scss/components/checkout-payment-details-v2.scss +237 -0
  138. package/src/scss/components/legal-info.scss +0 -61
  139. package/src/scss/components/loader.scss +8 -0
  140. package/src/scss/components/my-account/_active-orders.scss +2 -0
  141. package/src/scss/components/my-account/_payment-status.scss +84 -0
  142. package/src/scss/components/my-account/_saving-totaliser.scss +175 -0
  143. package/src/scss/components/price-block-v2-critical.scss +4 -0
  144. package/src/scss/components/price-block-v2.scss +4 -0
  145. package/src/scss/globals/_global-components.scss +0 -1
  146. package/src/scss/helpers/_mixins.scss +0 -8
  147. package/src/scss/helpers/_variables.scss +0 -1
  148. package/src/scss/homepage-main.scss +0 -1
  149. package/src/scss/main.scss +0 -1
  150. package/src/scss/pages/_checkout-confirmation-new.scss +10 -3
  151. package/src/scss/pages/checkout-new.scss +3 -0
  152. package/src/scss/pages/my-account-v2.scss +3 -0
  153. package/src/scss/pages/page_track-my-order.scss +0 -21
  154. package/src/scss/pages/page_wismo-details.scss +1 -0
  155. package/src/scss/partials/_header-critical.scss +0 -14
  156. package/src/scss/partials/_header.scss +0 -14
  157. package/src/scss/pdp-main-critical.scss +1 -0
  158. package/src/scss/pdp-main.scss +2 -0
  159. package/src/sitemap.html +32 -2
  160. package/src/components/mini-basket/mini-basket-empty.hbs +0 -17
  161. package/src/components/mini-basket/mini-basket.hbs +0 -39
  162. package/src/components/mini-basket/product-item.hbs +0 -24
  163. package/src/js/components/general/backdrop.js +0 -23
  164. package/src/js/components/general/cart-slider.js +0 -16
  165. package/src/js/components/general/create-popup-slider.js +0 -196
  166. package/src/js/components/general/mini-basket-slider.js +0 -8
  167. package/src/js/emulation/custom-slider-emulation.js +0 -28
  168. package/src/page_shopping-cart-charity.html +0 -56
  169. package/src/scss/components/_custom-slider.scss +0 -541
@@ -253,7 +253,8 @@
253
253
  &__klarna,
254
254
  &__apple,
255
255
  &__google,
256
- &__clearpay {
256
+ &__clearpay,
257
+ &__billie {
257
258
  display: flex;
258
259
  flex-direction: column;
259
260
  }
@@ -273,7 +274,8 @@
273
274
  }
274
275
 
275
276
  &__klarna,
276
- &__clearpay {
277
+ &__clearpay,
278
+ &__billie {
277
279
  margin-bottom: 0;
278
280
  }
279
281
  }
@@ -325,11 +327,16 @@
325
327
  &__klarna,
326
328
  &__apple,
327
329
  &__google,
328
- &__clearpay {
330
+ &__clearpay,
331
+ &__billie {
329
332
  flex-direction: row;
330
333
  justify-content: space-between;
331
334
  }
332
335
 
336
+ &__billie {
337
+ align-items: center;
338
+ }
339
+
333
340
  &__paypal,
334
341
  &__apple,
335
342
  &__google {
@@ -6,7 +6,10 @@
6
6
  @import 'checkout-confirmation-new';
7
7
  @import '../components/checkout_order';
8
8
  @import '../components/payments-checkout';
9
+ @import "../components/donation-cart-new";
9
10
  @import 'checkout-tradepro';
11
+ @import '../components/billie-online-messaging';
12
+ @import '../components/billie-modal';
10
13
 
11
14
  @import 'checkout-sign-in';
12
15
  @import 'checkout_delivery-details';
@@ -5,10 +5,13 @@
5
5
  @import '../components/my-account/contacts';
6
6
  @import '../components/my-account/mobile-nav';
7
7
  @import '../components/my-account/active-orders';
8
+ @import '../components/my-account/saving-totaliser';
8
9
  @import '../components/my-account/barcode';
9
10
  @import '../components/my-account/discount';
10
11
  @import '../components/my-account/clipboard-code';
12
+ @import '../components/my-account/payment-status';
11
13
  @import '../libs/font-awesome-icons';
14
+ @import '../components/my-account/payment-status';
12
15
 
13
16
  .my-account {
14
17
  margin: 0;
@@ -103,27 +103,6 @@
103
103
  display: flex;
104
104
  align-items: flex-start;
105
105
  justify-content: space-between;
106
-
107
- .icon-wrap {
108
- display: flex;
109
- align-items: center;
110
- justify-content: center;
111
-
112
- &:after {
113
- content: '+';
114
- color: $blue;
115
- font-size: 1.575rem;
116
- }
117
- }
118
-
119
- &[aria-expanded='true'] {
120
- .icon-wrap {
121
- &:after {
122
- content: '-';
123
- font-size: 2.95rem;
124
- }
125
- }
126
- }
127
106
  }
128
107
 
129
108
  &__list {
@@ -1,4 +1,5 @@
1
1
  @import '../helpers/helpers';
2
+ @import '../components/my-account/payment-status';
2
3
 
3
4
  .page_wismo-details {
4
5
  .layout_right-aside .page-header::before {
@@ -266,20 +266,6 @@
266
266
  padding-right: 0;
267
267
  }
268
268
 
269
- button.header-minicart__btn {
270
- background: none;
271
- border: 0;
272
- box-shadow: none;
273
- outline: none;
274
- cursor: pointer;
275
-
276
- &:hover {
277
- .header-right__link-title {
278
- text-decoration: underline;
279
- }
280
- }
281
- }
282
-
283
269
  .header-minicart__btn-icon {
284
270
  vertical-align: top;
285
271
  }
@@ -288,20 +288,6 @@
288
288
  padding-right: 0;
289
289
  }
290
290
 
291
- button.header-minicart__btn {
292
- background: none;
293
- border: 0;
294
- box-shadow: none;
295
- outline: none;
296
- cursor: pointer;
297
-
298
- &:hover {
299
- .header-right__link-title {
300
- text-decoration: underline;
301
- }
302
- }
303
- }
304
-
305
291
  .header-shop-list {
306
292
  .icon {
307
293
  color: $white;
@@ -43,6 +43,7 @@
43
43
  @import 'components/wisdom-critical';
44
44
  @import 'components/pdp-action-v2';
45
45
  @import 'components/clearpay';
46
+ @import 'components/billie-online-messaging';
46
47
 
47
48
  // Pages
48
49
  @import 'pages/page_product-details-critical';
@@ -78,6 +78,8 @@
78
78
  @import 'components/wisdom';
79
79
  @import 'components/long-banner';
80
80
  @import 'components/clearpay';
81
+ @import 'components/billie-online-messaging';
82
+ @import 'components/billie-modal';
81
83
 
82
84
  // Pages
83
85
  @import 'pages/page_ti';
package/src/sitemap.html CHANGED
@@ -534,6 +534,7 @@
534
534
  <li><span class="page-id">5.15</span><a href="page_my-account.html" target="_blank">My Account DIY</a></li>
535
535
  <li><a href="page_my-account-installer.html" target="_blank">My Account Installer</a></li>
536
536
  <li><a href="page_my-account-trade-pro.html" target="_blank">My Account TradePro</a></li>
537
+ <li><a href="page_my-account-trade-pro-components.html" target="_blank">My Account TradePro Components</a></li>
537
538
  <li><a href="page_personal-details.html" target="_blank">My Account Personal Details</a></li>
538
539
  <li><a href="page_personal-details-installer.html" target="_blank">My Account Personal Details Installer</a></li>
539
540
  <li><a href="page_default-store-page-empty.html" target="_blank">Default Store Page Empty</a></li>
@@ -926,6 +927,35 @@
926
927
  </a>
927
928
  </li>
928
929
  </ul>
930
+ <h3>
931
+ Pages with Billie payment
932
+ </h3>
933
+ <ul>
934
+ <li>
935
+ <span class="page-id">1</span>
936
+ <a href="page_payment-details-with-billie.html" target="_blank">
937
+ Billie - Payment details
938
+ </a>
939
+ </li>
940
+ <li>
941
+ <span class="page-id">2</span>
942
+ <a href="page_product-details-billie.html" target="_blank">
943
+ Billie PDP
944
+ </a>
945
+ </li>
946
+ <li>
947
+ <span class="page-id">3</span>
948
+ <a href="page_checkout_confirmation-billie.html" target="_blank">
949
+ Billie Checkout - Confirmation new
950
+ </a>
951
+ </li>
952
+ <li>
953
+ <span class="page-id">4</span>
954
+ <a href="page_basket-billie.html" target="_blank">
955
+ Billie Basket
956
+ </a>
957
+ </li>
958
+ </ul>
929
959
  <h3>
930
960
  Old Navigation
931
961
  </h3>
@@ -937,6 +967,8 @@
937
967
  </a>
938
968
  </li>
939
969
  </ul>
970
+
971
+
940
972
  </div>
941
973
  <div class="col">
942
974
  <h3>Basket</h3>
@@ -949,8 +981,6 @@
949
981
  Basket</a></li>
950
982
  <li><span class="page-id">8.6</span><a href="page_checkout_merge-basket.html" target="_blank">Merged
951
983
  basket</a></li>
952
- <li><span class="page-id">8.7</span><a href="page_shopping-cart-charity.html" target="_blank">Basket Charity Donation</a>
953
- </li>
954
984
  <li><span class="page-id">8.8</span><a href="page_shopping-cart-v2.html" target="_blank">Basket NEW</a>
955
985
  </li>
956
986
  <li><span class="page-id">8.9</span><a href="page_shopping-cart-registered-v2.html" target="_blank">Basket Registered NEW</a>
@@ -1,17 +0,0 @@
1
- <div class="custom-slider mini-basket d-none">
2
- <div class="custom-slider__wrap">
3
- <div class="custom-slider__header">
4
- <span class="custom-slider__count">Your basket (0)</span>
5
- <a href="#" type="button" class="icon-wrap close-popup">
6
- <i class="far fa-times icon"></i>
7
- </a>
8
- </div>
9
- <div class="custom-slider__empty">
10
- <span class="icon-wrap icon-wrap--xl">
11
- <i class="fas fa-shopping-basket"></i>
12
- </span>
13
- <p class="text">Your basket is currently empty.</p>
14
- <button class="btn btn-primary close-popup">Continue Shopping</button>
15
- </div>
16
- </div>
17
- </div>
@@ -1,39 +0,0 @@
1
- <div class="custom-slider mini-basket d-none">
2
- <div class="custom-slider__wrap">
3
- <div class="custom-slider__header">
4
- <span class="custom-slider__count">Your basket (1)</span>
5
- <button type="button" class="icon-wrap close-popup">
6
- <i class="far fa-times icon"></i>
7
- </button>
8
- </div>
9
- <div class="products popover-mini-basket__cards-holder">
10
- {{#each mini-basket.products}}
11
- {{> mini-basket/product-item this switch-vat=true}}
12
- {{/each}}
13
- </div>
14
- </div>
15
- <div class="custom-slider__footer footer-fixed">
16
- <div class="mini-basket__total">
17
- <button class="btn mini-basket__total-toggle" type="button" data-toggle="collapse" data-target="#checkout-details-accordion-3" aria-expanded="false" aria-controls="checkout-details-accordion-3">
18
- <span class="mini-basket__wrap-total">
19
- <span class="icon-wrap">
20
- <i class="fas fa-chevron-down arrow-icon"></i>
21
- </span>
22
- <span class="text">Total:</span>
23
- </span>
24
- <span class="value">{{mini-basket.total.totalPrice.formattedValue}}</span>
25
- </button>
26
-
27
- {{> checkout_order-summary-new confirmationSummary=true head=true mod=true id=3 mobile=true hideApplyVoucher=true}}
28
- </div>
29
- <div class="custom-slider__ctas">
30
- <a href="page_shopping-cart.html" class="btn btn_full btn-secondary">View Basket</a>
31
- <button class="btn btn-action btn_full btn-checkout">
32
- Checkout
33
- <span class="icon-wrap ml-2">
34
- <i class="fas fa-arrow-right"></i>
35
- </span>
36
- </button>
37
- </div>
38
- </div>
39
- </div>
@@ -1,24 +0,0 @@
1
- <div class="card product-card-preview">
2
- <div class="products__item card__inner">
3
- <a class="card__img-wrap card__img-wrap_link products__image" href="page_product-details-with-global-search-v2.html">
4
- <img class="product-img" src="{{src}}" alt="">
5
- </a>
6
- <div class="products__details product-card__content">
7
- <a href="#" class="title product-card__title product-card__title_link">{{title}}</a>
8
- <p class="item">Click &amp; Collect: <span class="value">{{CC}}</span></p>
9
- <p class="item">Qty: <span class="value">{{quantity.value}}</span></p>
10
- {{#if switch-vat}}
11
- <p class="price including-vat-inherit">
12
- {{incVatPrice}}
13
- <span class="inc">Inc.VAT</span>
14
- </p>
15
- <p class="price excluding-vat-inherit">
16
- {{excVatPrice}}
17
- <span class="inc">Exc.VAT</span>
18
- </p>
19
- {{else}}
20
- <p class="price">{{price}}</p>
21
- {{/if}}
22
- </div>
23
- </div>
24
- </div>
@@ -1,23 +0,0 @@
1
- var Wick = Wick || {};
2
-
3
- Wick.Backdrop = (function () {
4
- const el = {
5
- modalBackdrop: 'modal-backdrop',
6
- modalBackdropShow: 'show'
7
- }
8
-
9
- function show() {
10
- if (!$(`.${el.modalBackdrop}`).length) {
11
- $('body').append(`<div class="${el.modalBackdrop} ${el.modalBackdropShow}"></div>`);
12
- }
13
- }
14
-
15
- function hide() {
16
- $('body').find(`.${el.modalBackdrop}.${el.modalBackdropShow}`).remove();
17
- }
18
-
19
- return {
20
- show,
21
- hide,
22
- };
23
- })();
@@ -1,16 +0,0 @@
1
- const cartSliderHTML = '<div class="custom-slider just-added d-none"></div>';
2
-
3
- createPopupSlider({
4
- type: 'cart',
5
- sliderSelector: '.custom-slider.just-added',
6
- onAppendEvent: 'productAddedToCart',
7
- onAppend: function (event, { showSlider, handleScroll, el }) {
8
- if (!$('.custom-slider.just-added').length) {
9
- $('body').append(cartSliderHTML);
10
- }
11
- const htmlContent = event.detail.html;
12
- $(el.slider).append(htmlContent);
13
- showSlider();
14
- $(el.sliderWrap).on('scroll', _.debounce(() => handleScroll(el.sliderWrap), 100));
15
- },
16
- });
@@ -1,196 +0,0 @@
1
- function createEvent(eventName, payload, eventDetail) {
2
- return new CustomEvent(eventName, {
3
- detail: {
4
- payload,
5
- resolve: eventDetail.resolve,
6
- reject: eventDetail.reject,
7
- },
8
- });
9
- }
10
-
11
- function createPopupSlider({ type, sliderSelector, onAppendEvent, onAppend }) {
12
- const events = {
13
- CLOSE_JUST_ADDED: 'CLOSE_JUST_ADDED',
14
- CLOSE_MINI_BASKET: 'CLOSE_MINI_BASKET'
15
- }
16
-
17
- const el = {
18
- $body: $('body'),
19
- slider: sliderSelector,
20
- sliderWrap: `${sliderSelector} .custom-slider__wrap`,
21
- sliderWrapScroll: 'custom-slider__wrap--scroll',
22
- footer: '.custom-slider__footer',
23
- closePopup: `${sliderSelector} .close-popup`,
24
- $stickyWrapper: $('.sticky-wrapper'),
25
- $headerWrapper: $('.header-wrapper'),
26
- scrollDisable: 'slider-scroll-disable',
27
- footerFixed: 'footer-fixed',
28
- btnMiniBasket: '.header-minicart__btn',
29
- };
30
-
31
- function isSmallBreakpoint() {
32
- return Wick.Responsive.getCurrentBreakpoint() === 'down-sm';
33
- }
34
-
35
- function getAnimationClass() {
36
- return isSmallBreakpoint() ? 'bottom-to-top' : 'right-to-left';
37
- }
38
-
39
- function adjustHeight() {
40
- const stickyWrapperHeight = el.$stickyWrapper.outerHeight() || 0;
41
- const headerWrapperHeight = el.$headerWrapper.outerHeight() || 0;
42
-
43
- const totalHeight = stickyWrapperHeight + headerWrapperHeight;
44
- $(el.slider).css('height', `calc(100% - ${totalHeight}px)`);
45
- }
46
-
47
- function hideSlider() {
48
- $(el.slider).removeClass('show');
49
-
50
- setTimeout(() => {
51
- el.$body.removeClass(el.scrollDisable);
52
-
53
- if (!isSmallBreakpoint()) {
54
- el.$body.css('padding-right', '');
55
- }
56
-
57
- if (type === 'cart') {
58
- $(el.slider)
59
- .removeAttr('style')
60
- .empty();
61
- }
62
-
63
- $(el.slider).addClass('d-none');
64
- }, 400);
65
- }
66
-
67
- function handleScroll(sliderWrap) {
68
- const scrollHeight = $(sliderWrap)[0].scrollHeight;
69
- const scrollTop = $(sliderWrap).scrollTop();
70
- const clientHeight = $(sliderWrap)[0].clientHeight;
71
- const scrollBottom = scrollHeight - scrollTop - clientHeight;
72
-
73
- if (scrollBottom > 75) {
74
- $(el.footer).addClass(el.footerFixed);
75
- $(sliderWrap).addClass(el.sliderWrapScroll);
76
- } else {
77
- $(el.footer).removeClass(el.footerFixed);
78
- $(sliderWrap).removeClass(el.sliderWrapScroll);
79
- }
80
- }
81
-
82
- function showSlider() {
83
- if (isSmallBreakpoint()) {
84
- adjustHeight();
85
- }
86
-
87
- const animationClass = getAnimationClass();
88
- const scrollBarWidth = window.innerWidth - document.documentElement.clientWidth;
89
- $(el.slider)
90
- .removeClass('bottom-to-top right-to-left')
91
- .addClass(animationClass);
92
-
93
- $('html, body').animate({ scrollTop: 0 }, 300, () => {
94
- Wick.Backdrop.show();
95
- $(el.slider).removeClass('d-none');
96
-
97
- setTimeout(() => {
98
- $(el.slider).addClass('show');
99
- handleScroll(el.sliderWrap);
100
- el.$body.addClass(el.scrollDisable);
101
-
102
- if (!isSmallBreakpoint()) {
103
- el.$body.css('padding-right', `${scrollBarWidth}px`);
104
- }
105
- }, 100);
106
- });
107
- }
108
-
109
- function handleSliderClose(eventName) {
110
- return new Promise((resolve, reject) => {
111
- const eventDetail = {resolve, reject};
112
- const event = createEvent(eventName, {}, eventDetail);
113
- window.dispatchEvent(event);
114
- })
115
- .then(() => {})
116
- .catch((error) => {
117
- console.error(error);
118
- })
119
- .finally(() => {
120
- hideSlider();
121
- Wick.Backdrop.hide();
122
- })
123
- }
124
-
125
- function bindClosePopup() {
126
- $(document).on('click', el.closePopup, async () => {
127
- if (type === 'cart') {
128
- await handleSliderClose(events.CLOSE_JUST_ADDED);
129
- }
130
-
131
- if (type === 'miniBasket') {
132
- await handleSliderClose(events.CLOSE_MINI_BASKET)
133
- }
134
-
135
- hideSlider();
136
- Wick.Backdrop.hide();
137
- });
138
- }
139
-
140
- function handleResize() {
141
- const animationClass = getAnimationClass();
142
-
143
- if ($(el.slider).hasClass('show')) {
144
- $(el.slider)
145
- .removeClass('bottom-to-top right-to-left')
146
- .addClass(animationClass);
147
-
148
- if (isSmallBreakpoint()) {
149
- adjustHeight();
150
- } else {
151
- $(el.slider).css('height', '');
152
- Wick.Backdrop.show();
153
- }
154
- }
155
- }
156
-
157
- function shouldClosePopup(event) {
158
- const $target = $(event.target);
159
- return (
160
- !$target.closest(el.slider).length &&
161
- !$target.closest(el.closePopup).length &&
162
- $(el.slider).hasClass('show')
163
- );
164
- }
165
-
166
- function init() {
167
- bindClosePopup();
168
-
169
- if (onAppendEvent && onAppend) {
170
- document.addEventListener(onAppendEvent, (event) => {
171
- onAppend(event, { showSlider, handleScroll, el });
172
- });
173
- }
174
-
175
- $(window).on('resize', _.debounce(handleResize, 100));
176
-
177
- $('body').on('click', async (event) => {
178
- if (shouldClosePopup(event)) {
179
- if (type === 'cart') {
180
- await handleSliderClose(events.CLOSE_JUST_ADDED);
181
- }
182
-
183
- if (type === 'miniBasket') {
184
- await handleSliderClose(events.CLOSE_MINI_BASKET)
185
- }
186
- }
187
- });
188
- }
189
-
190
- init();
191
-
192
- return {
193
- showSlider,
194
- handleScroll,
195
- };
196
- }
@@ -1,8 +0,0 @@
1
- createPopupSlider({
2
- type: 'miniBasket',
3
- sliderSelector: '.custom-slider.mini-basket',
4
- onAppendEvent: 'showMiniBasket',
5
- onAppend: function (event, { showSlider }) {
6
- showSlider();
7
- },
8
- });
@@ -1,28 +0,0 @@
1
-
2
- function simulateHybrisSendingHtml() {
3
- const htmlFromHybris = Wick.FEMock.cartPDP;
4
- const event = new CustomEvent('productAddedToCart', {
5
- detail: { html: htmlFromHybris }
6
- });
7
- document.dispatchEvent(event);
8
- }
9
-
10
- function initCloseJustAddedDiff() {
11
- $(window).on('CLOSE_JUST_ADDED CLOSE_MINI_BASKET', function ({ detail: { resolve }}) {
12
- setTimeout(() => {
13
- return resolve();
14
- }, 200);
15
- });
16
- };
17
-
18
- function simulateShowMiniBasket() {
19
- const event = new CustomEvent('showMiniBasket', {});
20
- document.dispatchEvent(event);
21
- }
22
-
23
- $(document).ready(function () {
24
- $('.btn-add-to-basket').on('click', simulateHybrisSendingHtml);
25
- $('.header-minicart__btn').on('click', simulateShowMiniBasket);
26
-
27
- initCloseJustAddedDiff();
28
- });
@@ -1,56 +0,0 @@
1
- {{#extend "right-aside" page_shopping-cart pageClass="page_basket" title="Basket" pageBasket=true}}
2
- {{#content "head" mode="append"}}
3
- <link type="text/css" rel="stylesheet" href="./css/pages/page_shopping-cart.css">
4
- <link type="text/css" rel="stylesheet" href="./css/pages/checkout.css">
5
- {{/content}}
6
- {{#content "heading"}}
7
- <div class="notification-area desktop">
8
- {{> notifications notification-page.warning-tiles-changed withCloseBtn="true"}}
9
- </div>
10
-
11
- <div class="page-header">
12
- <a href="./" class="page-header__back-link">Continue shopping</a>
13
-
14
- <div class="notification-area mobile">
15
- {{> notifications notification-page.warning-tiles-changed withCloseBtn="true"}}
16
- </div>
17
-
18
- <h1 class="page-header__title">Your Basket</h1>
19
- </div>
20
- {{/content}}
21
- {{#content "main"}}
22
- {{> checkout_actions
23
- top-actions=true
24
- modifier="checkout-widget__basket-block_small"}}
25
- {{> checkout_order-summary_basket label="Total: " id=1 }}
26
- {{#extend "lines-group" name="For delivery" count=4 id=136589003}}
27
- {{#content "content"}}
28
- {{#each linesDelivery}}
29
- {{>order-line mod="order-line_shrink" dynamic=true deliveryChecked=true pageShopCart=true}}
30
- {{/each}}
31
- {{/content}}
32
- {{/extend}}
33
- {{#if charityDonations}}
34
- {{> charity-donations charityDonations}}
35
- {{#each linesCharity}}
36
- {{>order-line mod="order-line_shrink" dynamic=true}}
37
- {{/each}}
38
- {{/if}}
39
- {{/content}}
40
- {{#content "aside"}}
41
- {{> checkout_order-summary_basket label="Total: " id=2}}
42
- {{/content}}
43
- {{#content "prefooter"}}
44
- <div class="container component pb-0">
45
- <hr>
46
- </div>
47
-
48
- {{/content}}
49
- {{#content "footer"}}
50
- {{> footer_basket }}
51
- {{/content}}
52
- {{#content "foot" mode="append"}}
53
- <script defer src="./js/page/basket.js"></script>
54
- {{> click-and-collect-modal }}
55
- {{/content}}
56
- {{/extend}}