wickes-css2 2.102.0 → 2.103.0-gift-cards.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/Readme.md +1 -3
- package/build/css/components/checkout-payment-details-v2.css +1 -1
- package/build/css/pages/page_checkout_delivery-new.css +1 -1
- package/build/img/giftcard.svg +28 -0
- package/build/js/account-members.min.js +1 -1
- package/build/js/basket.min.js +1 -1
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +1 -1
- package/build/js/emulation.min.js +66 -16
- package/build/js/gift-cards.min.js +1 -0
- package/build/js/merged-checkout.min.js +1 -1
- package/build/js/page/components/gift-cards.js +610 -0
- package/build/js/page/components/toggle-password-visibility.js +22 -0
- package/build/js/page/utils/gift-cards-utils.js +43 -0
- package/build/js/page/utils/show-hide-input.js +28 -0
- package/build/js/project-list.min.js +1 -1
- package/build/js/toggle-password-visibility.min.js +1 -0
- package/package.json +2 -2
- package/src/components/checkout-payment-details-v2.hbs +2 -1
- package/src/components/gift-cards-hint.hbs +9 -0
- package/src/components/gift-cards.hbs +89 -0
- package/src/components/giftcard-chip.hbs +23 -0
- package/src/elements/form-row.hbs +1 -1
- package/src/elements/input.hbs +31 -2
- package/src/img/giftcard.svg +28 -0
- package/src/js/emulation/checkout-data.js +35 -0
- package/src/js/emulation/checkout-payment-details.js +23 -14
- package/src/js/emulation/forms.js +7 -2
- package/src/js/page/components/gift-cards.js +610 -0
- package/src/js/page/components/toggle-password-visibility.js +22 -0
- package/src/js/page/utils/gift-cards-utils.js +43 -0
- package/src/js/page/utils/show-hide-input.js +28 -0
- package/src/page_my-account_change-password.html +1 -0
- package/src/page_payment-details-with-gift-card.html +2 -1
- package/src/scss/components/_gift-cards.scss +357 -0
- package/src/scss/components/checkout-payment-details-v2.scss +2 -0
- package/src/scss/pages/page_checkout_delivery-new.scss +19 -0
- package/src/js/components/toggle-password-visibility.js +0 -58
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
<script defer src="./js/page/checkout-payment-details.js"></script>
|
|
62
62
|
<script defer src="./js/page/klarna-modal-scroll-disable.js"></script>
|
|
63
63
|
<script defer src="./js/page/billie-business-type.js"></script>
|
|
64
|
+
<script defer src="./js/gift-cards.min.js"></script>
|
|
64
65
|
{{> checkout-terms-and-conditions-modal }}
|
|
65
|
-
{{>
|
|
66
|
+
{{> loader hidden=true modifier="page-loader"}}
|
|
66
67
|
{{/content}}
|
|
67
68
|
{{/extend}}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
.giftcard-row {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
gap: 16px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.giftcard {
|
|
8
|
+
border: 1px solid $gray;
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
background: $white;
|
|
11
|
+
padding: 12px 16px;
|
|
12
|
+
width: 100%;
|
|
13
|
+
order: 3;
|
|
14
|
+
position: relative;
|
|
15
|
+
|
|
16
|
+
.giftcard__field {
|
|
17
|
+
.form-row {
|
|
18
|
+
margin-bottom: 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.giftcard-add {
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 8px;
|
|
27
|
+
color: $blue;
|
|
28
|
+
text-decoration: none;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
|
|
31
|
+
&__icon {
|
|
32
|
+
width: 16px;
|
|
33
|
+
height: 16px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&__text {
|
|
37
|
+
font-size: .875rem;
|
|
38
|
+
line-height: 1.375rem;
|
|
39
|
+
font-weight: 500;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.giftcard-hint {
|
|
44
|
+
display: block;
|
|
45
|
+
color: $squant;
|
|
46
|
+
font-size: .875rem;
|
|
47
|
+
line-height: 1.375rem;
|
|
48
|
+
font-weight: 400;
|
|
49
|
+
margin-left: 32px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.giftcard-inline {
|
|
53
|
+
padding: 12px 8px;
|
|
54
|
+
|
|
55
|
+
&__header {
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
margin-bottom: 24px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&__title {
|
|
62
|
+
font-weight: 500;
|
|
63
|
+
font-size: 1.125rem;
|
|
64
|
+
line-height: 1.5rem;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&__balance {
|
|
69
|
+
color: $blue;
|
|
70
|
+
font-weight: 400;
|
|
71
|
+
font-size: .875rem;
|
|
72
|
+
line-height: 1.375rem;
|
|
73
|
+
text-decoration: underline;
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&__close {
|
|
78
|
+
position: absolute;
|
|
79
|
+
width: 24px;
|
|
80
|
+
height: 24px;
|
|
81
|
+
top: 8px;
|
|
82
|
+
right: 8px;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
display: flex;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
align-items: center;
|
|
87
|
+
color: $warm-grey;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&__fields {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
gap: 24px;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.form-row__label {
|
|
98
|
+
margin-bottom: 8px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.giftcard__btn {
|
|
102
|
+
width: 100%;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.giftcard__field {
|
|
106
|
+
position: relative;
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
padding-bottom: 18px;
|
|
110
|
+
min-width: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.giftcard-inline .giftcard-inline__fields > .form-row.giftcard__field {
|
|
114
|
+
margin-bottom: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.giftcard-field--error .giftcard__input {
|
|
118
|
+
border-color: $red;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.giftcard__error-text {
|
|
122
|
+
font-weight: 400;
|
|
123
|
+
font-size: .75rem;
|
|
124
|
+
line-height: 1rem;
|
|
125
|
+
color: $red;
|
|
126
|
+
margin-top: 8px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.giftcard .toggle-show svg {
|
|
130
|
+
pointer-events: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.form-row .toggle-show {
|
|
134
|
+
font-size: 1rem;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
position: absolute;
|
|
137
|
+
right: 8px;
|
|
138
|
+
top: 0;
|
|
139
|
+
height: 100%;
|
|
140
|
+
display: inline-flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
justify-content: center;
|
|
143
|
+
width: 24px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.giftcard-applied {
|
|
147
|
+
width: 100%;
|
|
148
|
+
border: 1px solid $gray-light;
|
|
149
|
+
border-radius: 4px;
|
|
150
|
+
background: $white;
|
|
151
|
+
padding: 15px 16px;
|
|
152
|
+
order: 2;
|
|
153
|
+
|
|
154
|
+
&__inner {
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
justify-content: center;
|
|
158
|
+
gap: 12px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&__icon {
|
|
162
|
+
display: inline-flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.fa-check-circle {
|
|
168
|
+
text-align: center;
|
|
169
|
+
width: 100%;
|
|
170
|
+
color: $green;
|
|
171
|
+
font-size: 1rem;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&__text {
|
|
175
|
+
margin: 0;
|
|
176
|
+
font-size: .875rem;
|
|
177
|
+
line-height: 1.5rem;
|
|
178
|
+
font-weight: 500;
|
|
179
|
+
word-break: break-word;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.giftcard-summary {
|
|
184
|
+
position: relative;
|
|
185
|
+
width: 100%;
|
|
186
|
+
|
|
187
|
+
&__hint {
|
|
188
|
+
margin-top: 16px;
|
|
189
|
+
margin-bottom: 0;
|
|
190
|
+
font-size: .875rem;
|
|
191
|
+
font-weight: 400;
|
|
192
|
+
line-height: 1.375rem;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&__add {
|
|
196
|
+
text-decoration: underline;
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
color: $blue;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.giftcard-chip-list {
|
|
203
|
+
display: flex;
|
|
204
|
+
flex-direction: column;
|
|
205
|
+
gap: 16px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.giftcard-chip {
|
|
209
|
+
display: flex;
|
|
210
|
+
align-items: center;
|
|
211
|
+
width: 100%;
|
|
212
|
+
gap: 12px;
|
|
213
|
+
padding: 12px 16px;
|
|
214
|
+
border: 1px solid $gray;
|
|
215
|
+
border-radius: 4px;
|
|
216
|
+
background: $white;
|
|
217
|
+
min-height: 44px;
|
|
218
|
+
position: relative;
|
|
219
|
+
|
|
220
|
+
&__close {
|
|
221
|
+
position: absolute;
|
|
222
|
+
width: 24px;
|
|
223
|
+
height: 24px;
|
|
224
|
+
top: 8px;
|
|
225
|
+
right: 8px;
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
display: flex;
|
|
228
|
+
justify-content: center;
|
|
229
|
+
align-items: center;
|
|
230
|
+
color: $warm-grey;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.giftcard-chip__icon {
|
|
235
|
+
width: 48px;
|
|
236
|
+
height: 30px;
|
|
237
|
+
display: inline-flex;
|
|
238
|
+
align-items: center;
|
|
239
|
+
justify-content: center;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.giftcard-chip__content {
|
|
243
|
+
flex: 1 1 auto;
|
|
244
|
+
min-width: 0;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.giftcard-chip__line {
|
|
248
|
+
display: block;
|
|
249
|
+
line-height: 1.25rem;
|
|
250
|
+
|
|
251
|
+
.giftcard-chip__applied {
|
|
252
|
+
font-size: .875rem;
|
|
253
|
+
font-weight: 400;
|
|
254
|
+
line-height: 1.5rem;
|
|
255
|
+
color: $gray-dark;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.giftcard-chip__number {
|
|
260
|
+
font-weight: 500;
|
|
261
|
+
line-height: 1.5rem;
|
|
262
|
+
font-size: 1rem;
|
|
263
|
+
color: $gray-dark;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.giftcard-chip__applied {
|
|
267
|
+
white-space: nowrap;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
@include media-breakpoint-up(sm) {
|
|
271
|
+
.giftcard-inline__fields {
|
|
272
|
+
display: flex;
|
|
273
|
+
flex-direction: row;
|
|
274
|
+
justify-content: space-between;
|
|
275
|
+
gap: 16px;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.giftcard-inline__fields > .form-row.giftcard__field--pin.giftcard__field--pin {
|
|
279
|
+
width: 116px;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.giftcard-inline__fields > .form-row.giftcard__field--number.giftcard__field--number {
|
|
283
|
+
width: 224px;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.giftcard__actions {
|
|
287
|
+
display: flex;
|
|
288
|
+
align-items: flex-end;
|
|
289
|
+
height: 72px;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.giftcard-summary {
|
|
293
|
+
&__hint {
|
|
294
|
+
width: 354px;
|
|
295
|
+
|
|
296
|
+
&--max {
|
|
297
|
+
width: 100%;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@include media-breakpoint-up(md) {
|
|
304
|
+
.giftcard-inline__fields > .form-row.giftcard__field--pin.giftcard__field--pin {
|
|
305
|
+
width: 214px;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.giftcard-inline__fields > .form-row.giftcard__field--number.giftcard__field--number {
|
|
309
|
+
width: 240px;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
.giftcard-inline__title {
|
|
314
|
+
font-weight: 700;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.giftcard-summary {
|
|
318
|
+
&__hint {
|
|
319
|
+
width: 100%;
|
|
320
|
+
|
|
321
|
+
&--max {
|
|
322
|
+
width: 460px;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
@include media-breakpoint-up(lg) {
|
|
329
|
+
.giftcard-inline__fields {
|
|
330
|
+
max-width: 470px;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.giftcard-summary {
|
|
334
|
+
&__hint {
|
|
335
|
+
width: 100%;
|
|
336
|
+
|
|
337
|
+
&--max {
|
|
338
|
+
width: 100%;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
@include media-breakpoint-up(xl) {
|
|
345
|
+
.giftcard-inline__fields {
|
|
346
|
+
max-width: 100%;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.giftcard__btn {
|
|
350
|
+
width: 140px;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.giftcard__field--number,
|
|
354
|
+
.giftcard__field--pin {
|
|
355
|
+
width: 100%;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@import '../helpers/helpers';
|
|
2
2
|
@import '../components/tooltip';
|
|
3
|
+
@import '../components/gift-cards';
|
|
3
4
|
|
|
4
5
|
.checkout-payment-details-v2 {
|
|
5
6
|
.checkout-payment-details {
|
|
@@ -73,6 +74,7 @@
|
|
|
73
74
|
font-size: 14px;
|
|
74
75
|
font-weight: 400;
|
|
75
76
|
line-height: 24px;
|
|
77
|
+
vertical-align: top;
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
.form-row {
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
.checkout-widget {
|
|
28
28
|
&__details {
|
|
29
29
|
font-size: 1rem;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
30
32
|
|
|
31
33
|
.checkout-widget {
|
|
32
34
|
&__item {
|
|
@@ -53,6 +55,19 @@
|
|
|
53
55
|
&__details-discount {
|
|
54
56
|
order: 1;
|
|
55
57
|
}
|
|
58
|
+
|
|
59
|
+
&__gift-card {
|
|
60
|
+
order: 2;
|
|
61
|
+
margin-bottom: 0;
|
|
62
|
+
margin-top: 20px;
|
|
63
|
+
font-weight: 700;
|
|
64
|
+
|
|
65
|
+
.checkout-widget__item-value {
|
|
66
|
+
::first-letter {
|
|
67
|
+
font-size: 1rem;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
56
71
|
}
|
|
57
72
|
}
|
|
58
73
|
|
|
@@ -194,6 +209,10 @@
|
|
|
194
209
|
margin: 40px 0;
|
|
195
210
|
}
|
|
196
211
|
|
|
212
|
+
.loader-wrapper.page-loader {
|
|
213
|
+
position: fixed;
|
|
214
|
+
}
|
|
215
|
+
|
|
197
216
|
.oos-block {
|
|
198
217
|
@include make-col(12);
|
|
199
218
|
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
var Wick = window.Wick || {};
|
|
2
|
-
|
|
3
|
-
Wick.TogglePasswordVisibility = {
|
|
4
|
-
el: {
|
|
5
|
-
$toggleShow: $('[data-show-content] .toggle-show'),
|
|
6
|
-
inputWrap: $('.form-row[data-show-content] .input-wrap'),
|
|
7
|
-
toggleIcon: '.toggle-show',
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
updateIconVisibility(inputField, toggleIcon) {
|
|
11
|
-
const valueLength = inputField.val().length;
|
|
12
|
-
if (valueLength > 0) {
|
|
13
|
-
toggleIcon.show();
|
|
14
|
-
} else {
|
|
15
|
-
toggleIcon.hide();
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
attachInputListener(inputField, toggleIcon) {
|
|
20
|
-
inputField.on('input', function () {
|
|
21
|
-
Wick.TogglePasswordVisibility.updateIconVisibility($(this), toggleIcon);
|
|
22
|
-
});
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
attachToggleClickListener(inputField, toggleIcon) {
|
|
26
|
-
toggleIcon.on('click', function () {
|
|
27
|
-
const isPasswordType = inputField.attr('type') === 'password';
|
|
28
|
-
const iconSvg = $(this).find('svg');
|
|
29
|
-
|
|
30
|
-
if (isPasswordType) {
|
|
31
|
-
inputField.attr('type', 'text');
|
|
32
|
-
iconSvg.removeClass('fa-eye-slash').addClass('fa-eye');
|
|
33
|
-
} else {
|
|
34
|
-
inputField.attr('type', 'password');
|
|
35
|
-
iconSvg.removeClass('fa-eye').addClass('fa-eye-slash');
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
init() {
|
|
41
|
-
Wick.TogglePasswordVisibility.el.inputWrap.each(function () {
|
|
42
|
-
const inputField = $(this).find('input');
|
|
43
|
-
const toggleIcon = $(this).find(Wick.TogglePasswordVisibility.el.toggleIcon);
|
|
44
|
-
|
|
45
|
-
Wick.TogglePasswordVisibility.attachInputListener(inputField, toggleIcon);
|
|
46
|
-
Wick.TogglePasswordVisibility.updateIconVisibility(inputField, toggleIcon);
|
|
47
|
-
Wick.TogglePasswordVisibility.attachToggleClickListener(inputField, toggleIcon);
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
$(document).ready(function () {
|
|
53
|
-
if (!Wick.TogglePasswordVisibility.el.$toggleShow.length) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
Wick.TogglePasswordVisibility.init();
|
|
58
|
-
});
|