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.
Files changed (123) hide show
  1. package/Readme.md +2 -2
  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/global-search.css +1 -1
  5. package/build/css/homepage-main.css +1 -1
  6. package/build/css/kitchen-plp-main.css +1 -1
  7. package/build/css/main.css +1 -1
  8. package/build/css/my-account-main-v2.css +1 -1
  9. package/build/css/my-account-main.css +1 -1
  10. package/build/css/pages/page_checkout_delivery-new.css +1 -1
  11. package/build/css/pages/page_products-list-combined.css +1 -1
  12. package/build/css/pdp-main-before-combine.css +1 -1
  13. package/build/css/pdp-main-critical.css +1 -1
  14. package/build/css/pdp-main-non-critical.css +1 -1
  15. package/build/css/pdp-main.css +1 -1
  16. package/build/css/plp-main.css +1 -1
  17. package/build/css/store-locator-main.css +1 -1
  18. package/build/img/billie-pay-later.svg +13 -0
  19. package/build/img/giftcard.svg +28 -0
  20. package/build/js/account-members.min.js +1 -1
  21. package/build/js/add-project-list-id.min.js +1 -1
  22. package/build/js/address-book.min.js +1 -1
  23. package/build/js/basket.min.js +2 -2
  24. package/build/js/bundle.min.js +1 -1
  25. package/build/js/change-password.min.js +1 -1
  26. package/build/js/checkout.min.js +2 -2
  27. package/build/js/emulation.min.js +2126 -1898
  28. package/build/js/general.bundle.min.js +1 -1
  29. package/build/js/gift-cards.min.js +1 -0
  30. package/build/js/merged-checkout.min.js +2 -2
  31. package/build/js/mini-basket-slider.min.js +1 -1
  32. package/build/js/page/basket/basket-update-cart-action.js +4 -1
  33. package/build/js/page/basket/klarna.js +13 -3
  34. package/build/js/page/basket-v2.js +6 -2
  35. package/build/js/page/components/billie-modal.js +20 -20
  36. package/build/js/page/components/gift-cards.js +915 -0
  37. package/build/js/page/components/order-summary.js +42 -25
  38. package/build/js/page/components/toggle-password-visibility.js +22 -0
  39. package/build/js/page/components/voucher.js +52 -47
  40. package/build/js/page/filters/plp-filters.js +2 -2
  41. package/build/js/page/kitchen/colour-swatches.js +152 -152
  42. package/build/js/page/plp-img-v2.js +25 -0
  43. package/build/js/page/quick-filter.js +103 -106
  44. package/build/js/page/utils/gift-cards-utils.js +188 -0
  45. package/build/js/page/utils/input-handling.js +92 -0
  46. package/build/js/page/utils/show-hide-input.js +28 -0
  47. package/build/js/page/utils/validation.js +46 -1
  48. package/build/js/pdp.bundle.min.js +1 -1
  49. package/build/js/personal-details.min.js +1 -1
  50. package/build/js/plp-filters.min.js +1 -1
  51. package/build/js/plp.bundle.min.js +1 -1
  52. package/build/js/project-list.min.js +44 -1
  53. package/build/js/quiz.min.js +1 -1
  54. package/build/js/track-my-order.min.js +1 -1
  55. package/package.json +2 -2
  56. package/src/components/checkout-payment-details-v2.hbs +4 -3
  57. package/src/components/gift-cards-hint.hbs +9 -0
  58. package/src/components/gift-cards.hbs +90 -0
  59. package/src/components/giftcard-chip.hbs +23 -0
  60. package/src/components/giftcard-summary.hbs +6 -0
  61. package/src/components/home-movers/form.hbs +1 -1
  62. package/src/components/price-block-v2.hbs +1 -1
  63. package/src/elements/form-row.hbs +1 -1
  64. package/src/elements/input.hbs +31 -2
  65. package/src/img/billie-pay-later.svg +13 -0
  66. package/src/img/giftcard.svg +28 -0
  67. package/src/js/components/general/notification.js +2 -1
  68. package/src/js/components/pdp-billie-modal-scroll-reset.js +42 -46
  69. package/src/js/emulation/basket-data.js +2126 -2038
  70. package/src/js/emulation/billie-modal.js +6 -6
  71. package/src/js/emulation/checkLocalEnv.js +6 -5
  72. package/src/js/emulation/checkout-data.js +35 -0
  73. package/src/js/emulation/checkout-payment-details.js +28 -26
  74. package/src/js/emulation/forms.js +16 -10
  75. package/src/js/emulation/gift-cards.js +205 -0
  76. package/src/js/emulation/mock.js +21 -88
  77. package/src/js/page/basket/basket-update-cart-action.js +4 -1
  78. package/src/js/page/basket/klarna.js +13 -3
  79. package/src/js/page/basket-v2.js +6 -2
  80. package/src/js/page/components/billie-modal.js +20 -20
  81. package/src/js/page/components/gift-cards.js +915 -0
  82. package/src/js/page/components/order-summary.js +42 -25
  83. package/src/js/page/components/toggle-password-visibility.js +22 -0
  84. package/src/js/page/components/voucher.js +52 -47
  85. package/src/js/page/filters/plp-filters.js +2 -2
  86. package/src/js/page/kitchen/colour-swatches.js +152 -152
  87. package/src/js/page/plp-img-v2.js +25 -0
  88. package/src/js/page/quick-filter.js +103 -106
  89. package/src/js/page/utils/gift-cards-utils.js +188 -0
  90. package/src/js/page/utils/input-handling.js +92 -0
  91. package/src/js/page/utils/show-hide-input.js +28 -0
  92. package/src/js/page/utils/validation.js +46 -1
  93. package/src/layouts/checkout.hbs +1 -5
  94. package/src/page_my-account_change-password.html +1 -0
  95. package/src/page_payment-details-with-gift-card.html +8 -5
  96. package/src/page_plp-with-paint.html +1 -1
  97. package/src/page_plp_v2-energy-efficiency.html +1 -1
  98. package/src/page_plp_v2-favourite-products.html +1 -1
  99. package/src/page_plp_v2-vat.html +1 -1
  100. package/src/page_plp_v2.html +1 -1
  101. package/src/page_product_search-vat.html +1 -1
  102. package/src/page_product_search.html +1 -1
  103. package/src/page_search-results.html +1 -1
  104. package/src/partials/scripts.hbs +0 -1
  105. package/src/scss/components/_custom-slider.scss +6 -7
  106. package/src/scss/components/_gift-cards.scss +360 -0
  107. package/src/scss/components/_quick-filter.scss +10 -32
  108. package/src/scss/components/checkout-payment-details-v2.scss +6 -2
  109. package/src/scss/components/kitchen/_price-tooltip.scss +2 -3
  110. package/src/scss/components/kitchen/_price.scss +2 -2
  111. package/src/scss/helpers/_variables.scss +16 -7
  112. package/src/scss/pages/page_checkout_delivery-new.scss +26 -0
  113. package/src/scss/pages/page_products-list-combined.scss +2 -34
  114. package/src/scss/pdp-main.scss +0 -1
  115. package/build/js/page/count-stepper/pdp-count-stepper.js +0 -29
  116. package/build/js/page/utils/create-count-stepper.js +0 -141
  117. package/build/js/pdp-count-stepper.min.js +0 -1
  118. package/src/elements/count-button.hbs +0 -10
  119. package/src/js/components/toggle-password-visibility.js +0 -58
  120. package/src/js/emulation/validity-emulation.js +0 -33
  121. package/src/js/page/count-stepper/pdp-count-stepper.js +0 -29
  122. package/src/js/page/utils/create-count-stepper.js +0 -141
  123. 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
- }