wickes-css2 2.103.0-RG-1576-error-handling-new-codes.8 → 2.103.0-RG-1587-replace-klarna-logo-with-svg-image.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.
Files changed (100) hide show
  1. package/Readme.md +2 -2
  2. package/build/css/components/card-product-banner.css +1 -1
  3. package/build/css/components/checkout-payment-details-v2.css +1 -1
  4. package/build/css/main.css +1 -1
  5. package/build/css/pages/page_checkout_delivery-new.css +1 -1
  6. package/build/css/pages/page_products-list-combined.css +1 -1
  7. package/build/css/pages/page_products-list.css +1 -1
  8. package/build/css/pdp-main-non-critical.css +1 -1
  9. package/build/css/plp-main.css +1 -1
  10. package/build/img/klarna.svg +10 -0
  11. package/build/img/payment/checkout/klarna.svg +10 -0
  12. package/build/img/payment/footer/klarna.svg +10 -0
  13. package/build/js/account-members.min.js +1 -1
  14. package/build/js/add-project-list-id.min.js +1 -1
  15. package/build/js/address-book.min.js +1 -1
  16. package/build/js/basket.min.js +2 -2
  17. package/build/js/bundle.min.js +1 -1
  18. package/build/js/change-password.min.js +1 -1
  19. package/build/js/checkout.min.js +2 -2
  20. package/build/js/emulation.min.js +70 -272
  21. package/build/js/general.bundle.min.js +1 -1
  22. package/build/js/merged-checkout.min.js +2 -2
  23. package/build/js/page/components/order-summary.js +25 -42
  24. package/build/js/page/plp-cards-v2.js +15 -6
  25. package/build/js/page/plp-load-more.js +1 -1
  26. package/build/js/page/utils/validation.js +1 -46
  27. package/build/js/pdp.bundle.min.js +1 -1
  28. package/build/js/personal-details.min.js +1 -1
  29. package/build/js/plp.bundle.min.js +1 -1
  30. package/build/js/project-list.min.js +1 -44
  31. package/build/js/quiz.min.js +1 -1
  32. package/build/js/track-my-order.min.js +1 -1
  33. package/package.json +2 -2
  34. package/src/components/card_product_v2.hbs +10 -5
  35. package/src/components/card_sponsor_banner.hbs +8 -0
  36. package/src/components/card_sponsor_product.hbs +6 -0
  37. package/src/components/checkout-payment-details-v2.hbs +9 -12
  38. package/src/components/checkout_payment-new.hbs +1 -4
  39. package/src/components/checkout_payment-other-methods.hbs +1 -4
  40. package/src/components/injected-content.hbs +1 -1
  41. package/src/components/payments-checkout-v2.hbs +2 -7
  42. package/src/components/payments-checkout.hbs +1 -6
  43. package/src/components/payments.hbs +1 -5
  44. package/src/components/table_order-details-klarna.hbs +1 -1
  45. package/src/components/table_payment.hbs +1 -4
  46. package/src/data/data_search-results_v2.json +56 -141
  47. package/src/data/data_wismo.json +1 -1
  48. package/src/elements/form-row.hbs +1 -1
  49. package/src/elements/input.hbs +2 -31
  50. package/src/img/klarna.svg +10 -0
  51. package/src/img/payment/checkout/klarna.svg +10 -0
  52. package/src/img/payment/footer/klarna.svg +10 -0
  53. package/src/js/components/banner-placement-manager.js +267 -0
  54. package/src/js/components/general/notification.js +1 -2
  55. package/src/js/components/toggle-password-visibility.js +58 -0
  56. package/src/js/emulation/banner-placement-manager.js +53 -0
  57. package/src/js/emulation/checkout-payment-details.js +14 -23
  58. package/src/js/emulation/forms.js +2 -7
  59. package/src/js/page/components/order-summary.js +25 -42
  60. package/src/js/page/plp-cards-v2.js +15 -6
  61. package/src/js/page/plp-load-more.js +1 -1
  62. package/src/js/page/utils/validation.js +1 -46
  63. package/src/layouts/checkout.hbs +5 -1
  64. package/src/page_checkout_payment-details_guest-with-checkout-journey.html +1 -1
  65. package/src/page_my-account_change-password.html +0 -1
  66. package/src/page_my-order.html +1 -1
  67. package/src/page_payment-details-with-clearpay.html +2 -2
  68. package/src/page_payment-details-with-gift-card.html +5 -8
  69. package/src/page_plp_v2.html +16 -6
  70. package/src/page_search-results.html +12 -2
  71. package/src/page_shopping-cart-v2.html +2 -2
  72. package/src/scss/components/card-product-banner.scss +91 -3
  73. package/src/scss/components/checkout-payment-details-v2.scss +0 -2
  74. package/src/scss/pages/page_checkout_delivery-new.scss +0 -26
  75. package/src/scss/pages/page_products-list-combined.scss +11 -0
  76. package/src/scss/pages/page_products-list.scss +8 -0
  77. package/src/sitemap.html +0 -6
  78. package/build/img/giftcard.svg +0 -28
  79. package/build/js/gift-cards.min.js +0 -1
  80. package/build/js/page/components/gift-cards.js +0 -892
  81. package/build/js/page/components/toggle-password-visibility.js +0 -22
  82. package/build/js/page/utils/gift-cards-utils.js +0 -170
  83. package/build/js/page/utils/input-handling.js +0 -92
  84. package/build/js/page/utils/show-hide-input.js +0 -28
  85. package/build/js/toggle-password-visibility.min.js +0 -1
  86. package/src/components/gift-cards-hint.hbs +0 -9
  87. package/src/components/gift-cards.hbs +0 -90
  88. package/src/components/giftcard-chip.hbs +0 -23
  89. package/src/components/giftcard-summary.hbs +0 -6
  90. package/src/img/giftcard.svg +0 -28
  91. package/src/js/components/product-banner.js +0 -148
  92. package/src/js/emulation/checkout-data.js +0 -35
  93. package/src/js/emulation/gift-cards.js +0 -205
  94. package/src/js/page/components/gift-cards.js +0 -892
  95. package/src/js/page/components/toggle-password-visibility.js +0 -22
  96. package/src/js/page/utils/gift-cards-utils.js +0 -170
  97. package/src/js/page/utils/input-handling.js +0 -92
  98. package/src/js/page/utils/show-hide-input.js +0 -28
  99. package/src/page_split-orders-klarna.html +0 -106
  100. package/src/scss/components/_gift-cards.scss +0 -360
@@ -1,22 +0,0 @@
1
- import { initializeInputToggle } from "../utils/show-hide-input";
2
-
3
- var Wick = window.Wick || {};
4
-
5
- Wick.TogglePasswordVisibility = {
6
- el: {
7
- $containers: $('.form-row[data-show-content] .input-wrap'),
8
- },
9
-
10
- init() {
11
- if (!this.el.$containers.length) {
12
- return;
13
- }
14
- this.el.$containers.each(function () {
15
- initializeInputToggle($(this));
16
- });
17
- },
18
- };
19
-
20
- $(document).ready(function () {
21
- Wick.TogglePasswordVisibility.init();
22
- });
@@ -1,170 +0,0 @@
1
- import { showLoader, hideLoader } from "./loader";
2
-
3
- const SUMMARY_SELECTORS = {
4
- subTotal: { item: '.checkout-widget__item-bold', value: '.checkout-widget__item-value', title: 'Items subtotal:' },
5
- vat: { item: '.checkout-widget__item-vat', value: '.checkout-widget__item-value', title: 'VAT:' },
6
- clickAndCollectCost: { item: '.checkout-widget__item-cc', value: '.checkout-widget__item-value', title: 'Click & Collect:' },
7
- deliveryCost: { item: '.checkout-widget__item-delivery', value: '.checkout-widget__item-value', title: 'Delivery:' },
8
- charityPrice: { item: '.checkout-widget__item-charity', value: '.checkout-widget__item-value', title: 'Charity donation:' },
9
- discountTotal: { item: '.checkout-widget__details-discount', value: '.checkout-widget__detail-value' },
10
- giftCardApplied: { item: '.checkout-widget__gift-card', value: '.checkout-widget__item-value', title: 'Gift Card:' },
11
- total: { item: '.checkout-widget__total', value: '.checkout-widget__total-value' },
12
- };
13
-
14
- const CURRENCY_KEYS = new Set([
15
- 'subTotal','vat','clickAndCollectCost','deliveryCost',
16
- 'charityPrice','discountTotal','total','giftCardApplied'
17
- ]);
18
-
19
- const GIFT_CARD_ALREADY_ADDED = 'GIFT_CARD_ALREADY_ADDED';
20
- const PIS_REQUEST_TIMEOUT = 'PIS-REQUEST-TIMEOUT';
21
- const PIS_INTEGRATION_ERROR = 'PIS-INTEGRATION-ERROR';
22
- const HYBRIS_REQUEST_TIMEOUT = 'HYBRIS-REQUEST-TIMEOUT';
23
- const HYBRIS_PIS_INTEGRATION_ERROR = 'HYBRIS-PIS-INTEGRATION-ERROR';
24
- const ZERO_BALANCE = 'ZERO_BALANCE'
25
-
26
- export const DEFAULT_ERROR_MESSAGE =
27
- 'Unable to use Gift Card at this time, please try later or click here for support.';
28
-
29
- export const OK_CODE = 0;
30
-
31
- export const MESSAGE_BY_CODE = {
32
- 10: 'Gift Card number and / or PIN not recognised. A Gift Card will be locked following three unsuccessful PIN attempts.',
33
- 16: 'Card locked due to three unsuccessful PIN entries. For support click here.',
34
- 20: 'Unable to use Gift Card at this time, please try later or click here for support.',
35
- 21: 'Unable to use Gift Card at this time, please try later or click here for support.',
36
- 40: 'Unable to use Gift Card at this time, please try later or click here for support.',
37
- 60: 'The entered Gift Card has expired. For support click here.',
38
- 75: 'The entered Gift Card is invalid. For support click here.',
39
- [GIFT_CARD_ALREADY_ADDED]: 'Gift Card already added, please use a different card.',
40
- [PIS_REQUEST_TIMEOUT]: 'Unable to use Gift Card at this time, please try later or click here for support.',
41
- [PIS_INTEGRATION_ERROR]: 'Unable to use Gift Card at this time, please try later or click here for support.',
42
- [HYBRIS_REQUEST_TIMEOUT]: 'Unable to use Gift Card at this time, please try later or click here for support.',
43
- [HYBRIS_PIS_INTEGRATION_ERROR]: 'Unable to use Gift Card at this time, please try later or click here for support.',
44
- [ZERO_BALANCE]: 'Insufficient funds available, please try another Gift Card or alternate payment method.',
45
- 99: 'The entered Gift Card is invalid. For support click here.',
46
- [-1]: 'Gift Card is unavailable at this time, please try later. For support click here.',
47
- };
48
-
49
- export const PAY_MESSAGE_BY_CODE = {
50
- 101: 'Unable to use Gift Cards at this time, please try later or click here for support.',
51
- 102: 'Unfortunately there was a problem with requesting your card details from the payment provider. Available funds on your Gift Card are unchanged.',
52
- 103: 'Unfortunately there was a problem placing your order with Gift Card(s). Please click here for support.',
53
- 104: 'Unfortunately there was a problem placing your order with Gift Card(s). Please click here for support.',
54
- };
55
-
56
- export const ADD_GIFT_CARD = 'addGiftCard';
57
- export const REMOVE_GIFT_CARD = 'removeGiftCard';
58
- export const PAY_WITH_GIFT_CARD = 'payWithGiftCard';
59
-
60
- export const FAQ_URL = 'https://www.wickes.co.uk/gifts';
61
-
62
- export const escapeHtml = (s) => $('<div>').text(String(s || '')).html();
63
-
64
- export const linkifyClickHere = (msg) =>
65
- escapeHtml(msg).replace(
66
- /\bclick here\b/gi,
67
- `<a href="${FAQ_URL}" target="_blank" rel="noopener" class="notification_link">click here</a>`
68
- );
69
-
70
- export function formatGc16(raw) {
71
- const digits = String(raw || '').replace(/\D/g, '').slice(0, 16);
72
- return digits.replace(/(\d{4})(?=\d)/g, '$1-');
73
- }
74
-
75
- function formatGBP(value) {
76
- if (value === null || typeof value === 'undefined' || String(value).trim() === '') {
77
- return value;
78
- }
79
-
80
- const cleanedValue = String(value).replace(/[^\d.-]/g, '');
81
- const numberValue = Number(cleanedValue);
82
-
83
- if (Number.isFinite(numberValue)) {
84
- return `£${numberValue.toFixed(2)}`;
85
- }
86
-
87
- return value;
88
- }
89
-
90
- export function buildHintContext(count, limit) {
91
- const max = count >= limit;
92
-
93
- return {
94
- canAdd: !max,
95
- max,
96
- hintClass: `giftcard-summary__hint${max ? ' giftcard-summary__hint--max' : ''}`,
97
- };
98
- }
99
-
100
- export function buildSummaryEqualMap(data) {
101
- return Object.entries(SUMMARY_SELECTORS).map(([key, d]) => {
102
- const raw = data[key];
103
- let dataValue = raw;
104
-
105
- if (key === 'giftCardApplied') {
106
- if (isZeroAmount(raw)) {
107
- dataValue = '';
108
- } else if (raw != null && raw !== '') {
109
- dataValue = formatGBP(raw);
110
- if (typeof dataValue === 'string' && dataValue.startsWith('£')) {
111
- dataValue = `-${dataValue}`;
112
- }
113
- }
114
- } else {
115
- if (CURRENCY_KEYS.has(key) && raw != null && raw !== '') {
116
- dataValue = formatGBP(raw);
117
- }
118
- }
119
-
120
- return {
121
- item: d.item,
122
- itemValue: d.value,
123
- dataValue,
124
- ...(d.title ? { title: d.title } : {}),
125
- };
126
- });
127
- }
128
-
129
- export function isZeroAmount(val) {
130
- const cleaned = String(val ?? '').replace(/[^\d.]/g, '');
131
- if (!cleaned) {
132
- return false;
133
- }
134
- const num = Number(cleaned);
135
- return Number.isFinite(num) && num === 0;
136
- }
137
-
138
- // --- API/Event-Dispatching Functions ---
139
-
140
- export function verifyGiftCard($loader, giftCardNumber, pin) {
141
- showLoader($loader);
142
- return new Promise((resolve, reject) => {
143
- const payload = { giftCardNumber, pin };
144
- const detail = { resolve, reject, payload };
145
- const evt = createEvent(ADD_GIFT_CARD, payload, detail);
146
- window.dispatchEvent(evt);
147
- }).finally(() => {
148
- hideLoader($loader);
149
- });
150
- }
151
-
152
- export function removeGiftCard($loader, index) {
153
- showLoader($loader);
154
- return new Promise((resolve, reject) => {
155
- const payload = { index };
156
- const detail = { resolve, reject, payload };
157
- const evt = createEvent(REMOVE_GIFT_CARD, payload, detail);
158
- window.dispatchEvent(evt);
159
- }).finally(() => {
160
- hideLoader($loader);
161
- });
162
- }
163
-
164
- export function payWithGiftCard() {
165
- return new Promise((resolve, reject) => {
166
- const detail = { resolve, reject };
167
- const evt = createEvent(PAY_WITH_GIFT_CARD, undefined, detail);
168
- window.dispatchEvent(evt);
169
- });
170
- }
@@ -1,92 +0,0 @@
1
- import {formatGc16} from './gift-cards-utils';
2
- import {clearErrorText, showErrorText} from './validation';
3
-
4
-
5
- export function createGcNumberInputHandler({
6
- fieldSelector,
7
- fieldErrorClass,
8
- errorTextSelector,
9
- ariaInvalidAttr
10
- }) {
11
- return function handleGcNumberInput(e) {
12
- const input = e.currentTarget;
13
- const $input = $(input);
14
-
15
- const canTrack = typeof input.selectionStart === 'number';
16
- const atEnd = canTrack && input.selectionStart === input.value.length;
17
-
18
- const hadErr = $input.closest(fieldSelector).hasClass(fieldErrorClass);
19
-
20
- input.value = formatGc16(input.value);
21
-
22
- if (hadErr) {
23
- clearErrorText($input, fieldSelector, errorTextSelector, fieldErrorClass, ariaInvalidAttr);
24
- }
25
-
26
- if (atEnd && typeof input.setSelectionRange === 'function') {
27
- input.setSelectionRange(input.value.length, input.value.length);
28
- }
29
- };
30
- }
31
-
32
- export function digitsOnlyKeypress(e) {
33
- if (!/\d/.test(String.fromCharCode(e.which || e.keyCode))) {
34
- e.preventDefault();
35
- }
36
- }
37
-
38
- export function handleGcNumberBlur(e, {
39
- fieldSelector,
40
- errorTextSelector,
41
- errorClass,
42
- ariaInvalidAttr,
43
- numberMessage,
44
- }) {
45
- const $input = $(e.currentTarget);
46
- const len = String($input.val() || '').replace(/\D/g, '').length;
47
-
48
- clearErrorText($input, fieldSelector, errorTextSelector, errorClass, ariaInvalidAttr);
49
-
50
- if (len < 16) {
51
- showErrorText($input, numberMessage, fieldSelector, errorTextSelector, errorClass, ariaInvalidAttr);
52
- }
53
- }
54
-
55
- export function handleGcPinInput(e, {
56
- fieldSelector,
57
- errorTextSelector,
58
- errorClass,
59
- ariaInvalidAttr,
60
- }) {
61
- const input = e.currentTarget;
62
- const $input = $(input);
63
-
64
- const hadErr = $input.closest(fieldSelector).hasClass(errorClass);
65
- input.value = String(input.value || '').replace(/\D/g, '').slice(0, 8);
66
-
67
- if (hadErr) {
68
- clearErrorText($input, fieldSelector, errorTextSelector, errorClass, ariaInvalidAttr);
69
- }
70
- }
71
-
72
-
73
- export function handleGcPinKeypress(e) {
74
- if (!/\d/.test(String.fromCharCode(e.which || e.keyCode))) e.preventDefault();
75
- }
76
-
77
- export function handleGcPinBlur(e, {
78
- fieldSelector,
79
- errorTextSelector,
80
- errorClass,
81
- ariaInvalidAttr,
82
- pinMessage,
83
- }) {
84
- const $input = $(e.currentTarget);
85
- const length = String($input.val() || '').replace(/\D/g, '').length;
86
-
87
- clearErrorText($input, fieldSelector, errorTextSelector, errorClass, ariaInvalidAttr);
88
-
89
- if (length < 8) {
90
- showErrorText($input, pinMessage, fieldSelector, errorTextSelector, errorClass, ariaInvalidAttr);
91
- }
92
- }
@@ -1,28 +0,0 @@
1
- export function initializeInputToggle($container) {
2
- const $input = $container.find('input');
3
- const $toggle = $container.find('.toggle-show');
4
-
5
- if (!$input.length || !$toggle.length) return;
6
-
7
- const handleToggleClick = (e) => {
8
- e.preventDefault();
9
-
10
- const isPassword = String($input.attr('type')) === 'password';
11
- $input.attr('type', isPassword ? 'text' : 'password');
12
- const $icon = $toggle.find('svg, i').first();
13
-
14
- if ($icon.length) {
15
- $icon.removeClass('fa-eye fa-eye-slash').addClass(isPassword ? 'fa-eye' : 'fa-eye-slash');
16
- }
17
- };
18
-
19
- const updateToggleVisibility = () => {
20
- $toggle.toggle(($input.val() || '').length > 0);
21
- };
22
-
23
- $toggle.off('click.passwordToggle mousedown.passwordToggle')
24
- .on('mousedown.passwordToggle', handleToggleClick);
25
-
26
- $input.off('input.passwordToggle').on('input.passwordToggle', updateToggleVisibility);
27
- updateToggleVisibility();
28
- }
@@ -1,106 +0,0 @@
1
- {{#extend "checkout" pageClass="page_checkout page_checkout-confirmation page_split-orders" title="Split Orders"
2
- logout=true}}
3
- {{#content "steps"}}
4
- <div class="page-header">
5
- <h1 class="page-header__title">Thank You, Your Order Has Been Placed</h1>
6
- <p class="page-header__order-number">Order number: <span class="page-header__order-number_strong">143402004</span>
7
- </p>
8
- <p class="page-header__intro">We have emailed your order confirmation to <a href="#">michael.michael@gmail.com</a>
9
- with details of when your order will be delivered.
10
- This email will also contain our contact details should you wish to get in touch with us.</p>
11
- </div>
12
- {{/content}}
13
- {{#content "main"}}
14
-
15
- <div>
16
- <h3>Products delivered by Wickes</h3>
17
- <p>The product listed below will be delivered to you by Wickes. This order
18
- may be split into several parts, if so you will be notified by email. The
19
- date, time slot and address for this delivery are listed below: </p>
20
- </div>
21
-
22
- <div class="product-delivery-table">
23
- <div class="product-delivery-table__delivery-info">
24
- <div class="row">
25
- <div class="product-delivery-table__date">
26
- <h4>Delivery date</h4>
27
- <div class="product-delivery-table__date-inner">
28
- <div class="checkout-address-time__time-regular">MAR</div>
29
- <div class="checkout-address-time__time-primary">15</div>
30
- <div class="checkout-address-time__time-additional">8:00am - 6:00pm</div>
31
- </div>
32
- </div>
33
- <div class="product-delivery-table__time">
34
- <h4>Delivery time</h4>
35
- <div class="product-delivery-table__content">
36
- Beetween<br />8:00AM - 6:00PM
37
- </div>
38
- </div>
39
- <div class="product-delivery-table__address">
40
- <h4>Delivery address</h4>
41
- <div class="product-delivery-table__content">
42
- 459 Acasia way<br/>
43
- Wimbledon<br/>
44
- London<br/>
45
- S7 7ET
46
- </div>
47
- </div>
48
- </div>
49
- </div>
50
-
51
- <div class="shopping-card-container">
52
- {{#each page_shopping-cart.linesCollection}}
53
- {{>order-line mod="order-line_shrink"}}
54
- {{/each}}
55
- </div>
56
- </div>
57
-
58
- {{>checkout-supply-info checkout-components.supply-info.[2]}}
59
- <div class="checkout-confirmation-shopping-cards">
60
- {{#each page_shopping-cart.linesCollection}}
61
- <div class="checkout-confirmation-shopping-card">
62
- <h4>Collection from Oldham store <span class="checkout__text-highlighted">1 Item</span></h4>
63
- <span class="checkout__text-highlighted">Your order will be ready for collection within 1 store hour.</span>
64
- <div class="shopping-card-container shopping-card-container_bordered">
65
- <div class="delivery-details-option__delivery-info">
66
- <div class="delivery-details-option__delivery-info-left">
67
- {{>checkout-address-time time=true within=true}}
68
- </div>
69
- <div class="delivery-details-option__delivery-info-right">
70
- {{>schedule}}
71
- </div>
72
- </div>
73
- {{>order-line mod="order-line_shrink"}}
74
- </div>
75
- </div>
76
- {{/each}}
77
- </div>
78
-
79
- <div>
80
- <h3>Products delivered by suppliers</h3>
81
- <p>The following products will be delivered by our suppliers. They will be contacting you to arrange a delivery
82
- date.</p>
83
- </div>
84
-
85
- <div class="product-supplier-delivery-wrap">
86
- <div class="product-delivery-table product-supplier-delivery">
87
- <h4 class="shopping-card-heading">Products delivered by our supplier expected within <span>14</span> days <span class="checkout__text-highlighted">2 Items</span></h4>
88
- <div class="shopping-card-container">
89
- {{#each page_shopping-cart.linesCollection}}
90
- {{>order-line mod="order-line_shrink"}}
91
- {{/each}}
92
- </div>
93
- </div>
94
- </div>
95
-
96
-
97
- <a href="./" class="btn btn-secondary checkout-continue-shopping">Return to shopping</a>
98
- {{/content}}
99
- {{#content "aside"}}
100
- {{> checkout_order-summary label="Total: "}}
101
- {{> checkout_payment-other-methods klarna="true"}}
102
- {{> checkout_information }}
103
-
104
- <a href="./" class="btn btn-secondary checkout-continue-shopping_mobile">Return to shopping</a>
105
- {{/content}}
106
- {{/extend}}