wickes-css2 2.106.0-develop.4 → 2.106.0-gift-cards.2
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/Readme.md +2 -2
- package/build/css/category-main.css +1 -1
- package/build/css/components/checkout-payment-details-v2.css +1 -1
- package/build/css/components/global-search.css +1 -1
- package/build/css/homepage-main.css +1 -1
- package/build/css/kitchen-plp-main.css +1 -1
- package/build/css/main.css +1 -1
- package/build/css/my-account-main-v2.css +1 -1
- package/build/css/my-account-main.css +1 -1
- package/build/css/pages/page_checkout_delivery-new.css +1 -1
- package/build/css/pages/page_products-list-combined.css +1 -1
- package/build/css/pdp-main-before-combine.css +1 -1
- package/build/css/pdp-main-critical.css +1 -1
- package/build/css/pdp-main-non-critical.css +1 -1
- package/build/css/pdp-main.css +1 -1
- package/build/css/plp-main.css +1 -1
- package/build/css/store-locator-main.css +1 -1
- package/build/img/billie-pay-later.svg +13 -0
- package/build/img/giftcard.svg +28 -0
- package/build/js/account-members.min.js +1 -1
- package/build/js/add-project-list-id.min.js +1 -1
- package/build/js/address-book.min.js +1 -1
- package/build/js/basket.min.js +2 -2
- package/build/js/bundle.min.js +1 -1
- package/build/js/change-password.min.js +1 -1
- package/build/js/checkout.min.js +2 -2
- package/build/js/emulation.min.js +2126 -1898
- package/build/js/general.bundle.min.js +1 -1
- package/build/js/gift-cards.min.js +1 -0
- package/build/js/merged-checkout.min.js +2 -2
- package/build/js/mini-basket-slider.min.js +1 -1
- package/build/js/page/basket/basket-update-cart-action.js +4 -1
- package/build/js/page/basket/klarna.js +13 -3
- package/build/js/page/basket-v2.js +6 -2
- package/build/js/page/components/billie-modal.js +20 -20
- package/build/js/page/components/gift-cards.js +915 -0
- package/build/js/page/components/order-summary.js +42 -25
- package/build/js/page/components/toggle-password-visibility.js +22 -0
- package/build/js/page/components/voucher.js +52 -47
- package/build/js/page/filters/plp-filters.js +2 -2
- package/build/js/page/kitchen/colour-swatches.js +152 -152
- package/build/js/page/plp-img-v2.js +25 -0
- package/build/js/page/quick-filter.js +103 -106
- package/build/js/page/utils/gift-cards-utils.js +188 -0
- package/build/js/page/utils/input-handling.js +92 -0
- package/build/js/page/utils/show-hide-input.js +28 -0
- package/build/js/page/utils/validation.js +46 -1
- package/build/js/pdp.bundle.min.js +1 -1
- package/build/js/personal-details.min.js +1 -1
- package/build/js/plp-filters.min.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +44 -1
- package/build/js/quiz.min.js +1 -1
- package/build/js/track-my-order.min.js +1 -1
- package/package.json +2 -2
- package/src/components/checkout-payment-details-v2.hbs +4 -3
- package/src/components/gift-cards-hint.hbs +9 -0
- package/src/components/gift-cards.hbs +90 -0
- package/src/components/giftcard-chip.hbs +23 -0
- package/src/components/giftcard-summary.hbs +6 -0
- package/src/components/home-movers/form.hbs +1 -1
- package/src/components/price-block-v2.hbs +1 -1
- package/src/elements/form-row.hbs +1 -1
- package/src/elements/input.hbs +31 -2
- package/src/img/billie-pay-later.svg +13 -0
- package/src/img/giftcard.svg +28 -0
- package/src/js/components/general/notification.js +2 -1
- package/src/js/components/pdp-billie-modal-scroll-reset.js +42 -46
- package/src/js/emulation/basket-data.js +2126 -2038
- package/src/js/emulation/billie-modal.js +6 -6
- package/src/js/emulation/checkLocalEnv.js +6 -5
- package/src/js/emulation/checkout-data.js +35 -0
- package/src/js/emulation/checkout-payment-details.js +28 -26
- package/src/js/emulation/forms.js +16 -10
- package/src/js/emulation/gift-cards.js +205 -0
- package/src/js/emulation/mock.js +21 -88
- package/src/js/page/basket/basket-update-cart-action.js +4 -1
- package/src/js/page/basket/klarna.js +13 -3
- package/src/js/page/basket-v2.js +6 -2
- package/src/js/page/components/billie-modal.js +20 -20
- package/src/js/page/components/gift-cards.js +915 -0
- package/src/js/page/components/order-summary.js +42 -25
- package/src/js/page/components/toggle-password-visibility.js +22 -0
- package/src/js/page/components/voucher.js +52 -47
- package/src/js/page/filters/plp-filters.js +2 -2
- package/src/js/page/kitchen/colour-swatches.js +152 -152
- package/src/js/page/plp-img-v2.js +25 -0
- package/src/js/page/quick-filter.js +103 -106
- package/src/js/page/utils/gift-cards-utils.js +188 -0
- package/src/js/page/utils/input-handling.js +92 -0
- package/src/js/page/utils/show-hide-input.js +28 -0
- package/src/js/page/utils/validation.js +46 -1
- package/src/layouts/checkout.hbs +1 -5
- package/src/page_my-account_change-password.html +1 -0
- package/src/page_payment-details-with-gift-card.html +8 -5
- package/src/page_plp-with-paint.html +1 -1
- package/src/page_plp_v2-energy-efficiency.html +1 -1
- package/src/page_plp_v2-favourite-products.html +1 -1
- package/src/page_plp_v2-vat.html +1 -1
- package/src/page_plp_v2.html +1 -1
- package/src/page_product_search-vat.html +1 -1
- package/src/page_product_search.html +1 -1
- package/src/page_search-results.html +1 -1
- package/src/partials/scripts.hbs +0 -1
- package/src/scss/components/_custom-slider.scss +6 -7
- package/src/scss/components/_gift-cards.scss +360 -0
- package/src/scss/components/_quick-filter.scss +10 -32
- package/src/scss/components/checkout-payment-details-v2.scss +6 -2
- package/src/scss/components/kitchen/_price-tooltip.scss +2 -3
- package/src/scss/components/kitchen/_price.scss +2 -2
- package/src/scss/helpers/_variables.scss +16 -7
- package/src/scss/pages/page_checkout_delivery-new.scss +26 -0
- package/src/scss/pages/page_products-list-combined.scss +2 -34
- package/src/scss/pdp-main.scss +0 -1
- package/build/js/page/count-stepper/pdp-count-stepper.js +0 -29
- package/build/js/page/utils/create-count-stepper.js +0 -141
- package/build/js/pdp-count-stepper.min.js +0 -1
- package/src/elements/count-button.hbs +0 -10
- package/src/js/components/toggle-password-visibility.js +0 -58
- package/src/js/emulation/validity-emulation.js +0 -33
- package/src/js/page/count-stepper/pdp-count-stepper.js +0 -29
- package/src/js/page/utils/create-count-stepper.js +0 -141
- package/src/scss/components/_input-counter.scss +0 -65
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import countButton from '../../../elements/count-button.hbs';
|
|
2
|
-
|
|
3
|
-
// ===== HELPERS =====
|
|
4
|
-
|
|
5
|
-
function normalizeOptions(options) {
|
|
6
|
-
return {
|
|
7
|
-
inputSel: '#quantity-field',
|
|
8
|
-
|
|
9
|
-
min: 1,
|
|
10
|
-
|
|
11
|
-
enhancedInputClass: 'count-stepper__input',
|
|
12
|
-
enhancedParentClass: 'count-stepper',
|
|
13
|
-
|
|
14
|
-
onChange: null,
|
|
15
|
-
|
|
16
|
-
...options,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function toInt(value) {
|
|
21
|
-
const n = parseInt(String(value || '').trim(), 10);
|
|
22
|
-
return Number.isFinite(n) ? n : NaN;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function clampMin(n, min) {
|
|
26
|
-
return Math.max(min, n);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function ensureQty(value, fallback) {
|
|
30
|
-
const n = toInt(value);
|
|
31
|
-
return Number.isFinite(n) ? n : fallback;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function buildBtn(type, disabled) {
|
|
35
|
-
return countButton({
|
|
36
|
-
type,
|
|
37
|
-
icon: type === 'plus' ? 'fa-plus' : 'fa-minus',
|
|
38
|
-
ariaLabel: type === 'plus' ? 'Increase quantity' : 'Decrease quantity',
|
|
39
|
-
disabled: !!disabled,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function getButtonsWrap($input) {
|
|
44
|
-
return $input.parent();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function getMinusBtn($wrap) {
|
|
48
|
-
return $wrap.find('[data-count-btn][data-count-type="minus"]').first();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function getPlusBtn($wrap) {
|
|
52
|
-
return $wrap.find('[data-count-btn][data-count-type="plus"]').first();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function updateButtons($input, opt) {
|
|
56
|
-
const $wrap = getButtonsWrap($input);
|
|
57
|
-
const qty = ensureQty($input.val(), opt.min);
|
|
58
|
-
|
|
59
|
-
const $minus = getMinusBtn($wrap);
|
|
60
|
-
|
|
61
|
-
if ($minus.length) $minus.prop('disabled', qty <= opt.min);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function setQty($input, opt, qty) {
|
|
65
|
-
const next = clampMin(qty, opt.min);
|
|
66
|
-
$input.val(String(next));
|
|
67
|
-
updateButtons($input, opt);
|
|
68
|
-
|
|
69
|
-
if (typeof opt.onChange === 'function') {
|
|
70
|
-
opt.onChange(next, $input.get(0));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function ensureButtons($input, opt) {
|
|
75
|
-
const $parent = getButtonsWrap($input);
|
|
76
|
-
|
|
77
|
-
$input.addClass(opt.enhancedInputClass);
|
|
78
|
-
$parent.addClass(opt.enhancedParentClass);
|
|
79
|
-
|
|
80
|
-
const hasMinus = getMinusBtn($parent).length;
|
|
81
|
-
const hasPlus = getPlusBtn($parent).length;
|
|
82
|
-
|
|
83
|
-
if (!hasMinus) {
|
|
84
|
-
$input.before(buildBtn('minus', true));
|
|
85
|
-
}
|
|
86
|
-
if (!hasPlus) {
|
|
87
|
-
$input.after(buildBtn('plus', false));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const initial = ensureQty($input.val(), opt.min);
|
|
91
|
-
setQty($input, opt, initial);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function getInputs($root, inputSel) {
|
|
95
|
-
const $scope = $root && $root.length ? $root : $(document);
|
|
96
|
-
const $self = $scope.is(inputSel) ? $scope : $();
|
|
97
|
-
const $found = $scope.find(inputSel);
|
|
98
|
-
return $self.add($found);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// ===== FACTORY =====
|
|
102
|
-
|
|
103
|
-
export function createCountStepper(options = {}) {
|
|
104
|
-
const OPT = normalizeOptions(options);
|
|
105
|
-
if (!OPT.inputSel) throw new Error('[createCountStepper] Missing inputSel');
|
|
106
|
-
|
|
107
|
-
const NS = `.cnt_${Math.random().toString(16).slice(2)}`;
|
|
108
|
-
|
|
109
|
-
function init($root) {
|
|
110
|
-
getInputs($root, OPT.inputSel).each(function () {
|
|
111
|
-
ensureButtons($(this), OPT);
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// +/- click
|
|
116
|
-
$(document)
|
|
117
|
-
.off(`click${NS}`, '[data-count-btn]')
|
|
118
|
-
.on(`click${NS}`, '[data-count-btn]', function (e) {
|
|
119
|
-
const $btn = $(this);
|
|
120
|
-
const $parent = $btn.parent();
|
|
121
|
-
const $input = $parent.find(OPT.inputSel).first();
|
|
122
|
-
|
|
123
|
-
if (!$input.length) return;
|
|
124
|
-
|
|
125
|
-
e.preventDefault();
|
|
126
|
-
|
|
127
|
-
const type = ($btn.attr('data-count-type') || '').toLowerCase();
|
|
128
|
-
const current = ensureQty($input.val(), OPT.min);
|
|
129
|
-
|
|
130
|
-
if (type === 'plus') setQty($input, OPT, current + 1);
|
|
131
|
-
if (type === 'minus') setQty($input, OPT, current - 1);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
$(document)
|
|
135
|
-
.off(`input${NS} change${NS}`, OPT.inputSel)
|
|
136
|
-
.on(`input${NS} change${NS}`, OPT.inputSel, function () {
|
|
137
|
-
updateButtons($(this), OPT);
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
return { init };
|
|
141
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
.count-stepper {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
gap: 8px;
|
|
5
|
-
margin-top: 6px;
|
|
6
|
-
|
|
7
|
-
.quantity-label {
|
|
8
|
-
padding-right: 9px;
|
|
9
|
-
margin: 0 !important;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
&__input {
|
|
13
|
-
height: 40px;
|
|
14
|
-
width: 46px;
|
|
15
|
-
border: 1px solid $gray;
|
|
16
|
-
border-radius: 3px;
|
|
17
|
-
margin-right: 0 !important;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.count-btn {
|
|
22
|
-
font-size: 1.3rem;
|
|
23
|
-
width: 24px;
|
|
24
|
-
height: 24px;
|
|
25
|
-
padding: 0;
|
|
26
|
-
border: 0;
|
|
27
|
-
background: transparent;
|
|
28
|
-
display: inline-flex;
|
|
29
|
-
align-items: center;
|
|
30
|
-
justify-content: center;
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
color: $blue;
|
|
33
|
-
outline: none;
|
|
34
|
-
box-shadow: none;
|
|
35
|
-
-webkit-tap-highlight-color: transparent;
|
|
36
|
-
|
|
37
|
-
i {
|
|
38
|
-
font-size: 16px;
|
|
39
|
-
line-height: 1;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&[disabled] {
|
|
43
|
-
cursor: not-allowed;
|
|
44
|
-
opacity: 0.6;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&:focus {
|
|
48
|
-
outline: none;
|
|
49
|
-
box-shadow: none;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&:focus-visible {
|
|
53
|
-
border-radius: 4px;
|
|
54
|
-
box-shadow: 0 0 0 3px rgba($blue, 0.35);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&:focus:not(:focus-visible) {
|
|
58
|
-
box-shadow: none;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&::-moz-focus-inner {
|
|
62
|
-
border: 0;
|
|
63
|
-
padding: 0;
|
|
64
|
-
}
|
|
65
|
-
}
|