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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
$blue-dark: #0a3055; // Base brand color for background
|
|
5
5
|
$blue: #0277bd; // CTAs
|
|
6
6
|
$green: #67a509; // Tick icons; Buttons in the checkout
|
|
7
|
-
$
|
|
7
|
+
$polishedPine: #67a589;
|
|
8
8
|
$green-dark: #487306; // Active state of button-action
|
|
9
9
|
|
|
10
10
|
// Additional colors
|
|
@@ -33,6 +33,7 @@ $error-bg: #fcf2f3; // Error notification background colour
|
|
|
33
33
|
$positive: #8dc63f; // Positive colour
|
|
34
34
|
$negative: #ed1c24; // Negative colour
|
|
35
35
|
$blue-badge: #019ee3;
|
|
36
|
+
$pacific-depths: #004587;
|
|
36
37
|
$usp-icon-color: #1a77bc; // Usp icon color
|
|
37
38
|
$pacific-depths: #004587;
|
|
38
39
|
$line-through: #242424;
|
|
@@ -46,6 +47,10 @@ $footer-gray: #f5f5f5;
|
|
|
46
47
|
$footer-bullet: #c8c8c8;
|
|
47
48
|
$footer-copyright: #626262;
|
|
48
49
|
|
|
50
|
+
$footer-gray: #f5f5f5;
|
|
51
|
+
$footer-bullet: #c8c8c8;
|
|
52
|
+
$footer-copyright: #626262;
|
|
53
|
+
|
|
49
54
|
$white: #fff;
|
|
50
55
|
$black: #000;
|
|
51
56
|
$black-lite: #111;
|
|
@@ -62,6 +67,7 @@ $blue-ocean: #003058;
|
|
|
62
67
|
$blue-ocean-dark: #0a3054;
|
|
63
68
|
$gray-middle: #aaa;
|
|
64
69
|
$light-blue: #e6f1f8;
|
|
70
|
+
|
|
65
71
|
// Colour block colours
|
|
66
72
|
$moon-shadow: #658089;
|
|
67
73
|
$fawn: #f0ddce;
|
|
@@ -105,7 +111,7 @@ $black-transparent75: rgba(0, 0, 0, 0.75);
|
|
|
105
111
|
$black-transparent80: rgba(0, 0, 0, 0.8);
|
|
106
112
|
$blue-transparent20: rgba(2, 119, 189, 0.2);
|
|
107
113
|
$blue-transparent10: rgba(2, 119, 189, 0.1);
|
|
108
|
-
$blue-transparent3:
|
|
114
|
+
$blue-transparent3: #0277bd52;
|
|
109
115
|
$blue-transparent5: rgba(2, 119, 189, 0.05);
|
|
110
116
|
$blue-transparent5-rgb: rgb(242, 248, 251);
|
|
111
117
|
$dark-blue-transparent10: rgba(10, 48, 85, 0.1);
|
|
@@ -299,7 +305,7 @@ $btn-line-height-sm: $input-btn-line-height-sm !default;
|
|
|
299
305
|
|
|
300
306
|
$btn-padding-y-lg: $input-btn-padding-y-lg !default;
|
|
301
307
|
$btn-padding-x-lg: $input-btn-padding-x-lg !default;
|
|
302
|
-
$btn-line-height-lg: $input-
|
|
308
|
+
$btn-line-height-lg: $input-btn_line-height-lg !default;
|
|
303
309
|
|
|
304
310
|
$btn-border-radius: $border-radius !default;
|
|
305
311
|
$btn-border-radius-lg: $border-radius-lg !default;
|
|
@@ -379,7 +385,8 @@ $zindex-share: 1 !default;
|
|
|
379
385
|
|
|
380
386
|
// This variable affects the `.h-*` and `.w-*` classes.
|
|
381
387
|
$sizes: () !default;
|
|
382
|
-
|
|
388
|
+
|
|
389
|
+
/* sass-lint:disable indentation */
|
|
383
390
|
$sizes: map-merge(
|
|
384
391
|
(
|
|
385
392
|
25: 25%,
|
|
@@ -389,7 +396,8 @@ $sizes: map-merge(
|
|
|
389
396
|
),
|
|
390
397
|
$sizes
|
|
391
398
|
);
|
|
392
|
-
|
|
399
|
+
/* sass-lint:enable indentation */
|
|
400
|
+
|
|
393
401
|
// Spacing
|
|
394
402
|
//
|
|
395
403
|
// Control the default styling of most Bootstrap elements by modifying these
|
|
@@ -399,7 +407,8 @@ $sizes: map-merge(
|
|
|
399
407
|
// stylelint-disable
|
|
400
408
|
$spacer: 1rem !default;
|
|
401
409
|
$spacers: () !default;
|
|
402
|
-
|
|
410
|
+
|
|
411
|
+
/* sass-lint:disable indentation */
|
|
403
412
|
$spacers: map-merge(
|
|
404
413
|
(
|
|
405
414
|
0: 0,
|
|
@@ -419,7 +428,7 @@ $spacers: map-merge(
|
|
|
419
428
|
),
|
|
420
429
|
$spacers
|
|
421
430
|
);
|
|
422
|
-
|
|
431
|
+
/* sass-lint:enable indentation */
|
|
423
432
|
|
|
424
433
|
// Bootstrap Printing checked
|
|
425
434
|
$print-page-size: a3 !default;
|
|
@@ -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
|
|
|
@@ -399,6 +418,13 @@
|
|
|
399
418
|
margin-bottom: 13px;
|
|
400
419
|
}
|
|
401
420
|
}
|
|
421
|
+
|
|
422
|
+
.notification {
|
|
423
|
+
&:only-child,
|
|
424
|
+
&:last-child {
|
|
425
|
+
margin-bottom: 30px;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
402
428
|
}
|
|
403
429
|
|
|
404
430
|
#modalDeliveryEdit,
|
|
@@ -303,7 +303,6 @@ $color-bar-radius: 3px;
|
|
|
303
303
|
margin-right: -4px;
|
|
304
304
|
padding-left: 5px;
|
|
305
305
|
padding-right: 5px;
|
|
306
|
-
width: 50%;
|
|
307
306
|
}
|
|
308
307
|
|
|
309
308
|
&:nth-of-type(1)::before,
|
|
@@ -339,27 +338,6 @@ $color-bar-radius: 3px;
|
|
|
339
338
|
align-items: center;
|
|
340
339
|
justify-content: center;
|
|
341
340
|
border-bottom: 1px solid $gray;
|
|
342
|
-
width: 100%;
|
|
343
|
-
|
|
344
|
-
@supports (aspect-ratio: 1 / 1) {
|
|
345
|
-
aspect-ratio: 1 / 1;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
@supports not (aspect-ratio: 1 / 1) {
|
|
349
|
-
&:before {
|
|
350
|
-
content: '';
|
|
351
|
-
display: block;
|
|
352
|
-
padding-top: 100%;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
.card__img-v2 {
|
|
357
|
-
position: absolute;
|
|
358
|
-
inset: 0;
|
|
359
|
-
width: 100%;
|
|
360
|
-
height: 100%;
|
|
361
|
-
object-fit: contain;
|
|
362
|
-
}
|
|
363
341
|
|
|
364
342
|
@include media-breakpoint-down(sm) {
|
|
365
343
|
border: 1px solid $gray;
|
|
@@ -389,16 +367,6 @@ $color-bar-radius: 3px;
|
|
|
389
367
|
}
|
|
390
368
|
}
|
|
391
369
|
|
|
392
|
-
.card-sponsor-product {
|
|
393
|
-
@include media-breakpoint-down(sm) {
|
|
394
|
-
width: 50%;
|
|
395
|
-
|
|
396
|
-
.card {
|
|
397
|
-
width: 100%;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
370
|
.product-card {
|
|
403
371
|
& .card__inner-v2:hover {
|
|
404
372
|
border: 1px solid $gray-dark;
|
|
@@ -618,8 +586,8 @@ $color-bar-radius: 3px;
|
|
|
618
586
|
.sort-products-list {
|
|
619
587
|
&__section {
|
|
620
588
|
@include make-col(6);
|
|
621
|
-
color:
|
|
622
|
-
border:
|
|
589
|
+
color: black;
|
|
590
|
+
border: none;
|
|
623
591
|
|
|
624
592
|
> .form-row {
|
|
625
593
|
margin-bottom: 0;
|
package/src/scss/pdp-main.scss
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { createCountStepper } from '../utils/create-count-stepper';
|
|
2
|
-
|
|
3
|
-
var Wick = window.Wick || {};
|
|
4
|
-
|
|
5
|
-
Wick.PDPCountStepper = {
|
|
6
|
-
el: {
|
|
7
|
-
input: '#quantity-field',
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
stepper: null,
|
|
11
|
-
|
|
12
|
-
init() {
|
|
13
|
-
Wick.PDPCountStepper.stepper = createCountStepper({
|
|
14
|
-
inputSel: Wick.PDPCountStepper.el.input,
|
|
15
|
-
min: 1,
|
|
16
|
-
max: 99,
|
|
17
|
-
onChange(qty, inputEl) {
|
|
18
|
-
$(inputEl).trigger('change');
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
Wick.PDPCountStepper.stepper.init($(document));
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
$(document).ready(function () {
|
|
27
|
-
if (!$(Wick.PDPCountStepper.el.input).length) return;
|
|
28
|
-
Wick.PDPCountStepper.init();
|
|
29
|
-
});
|
|
@@ -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 +0,0 @@
|
|
|
1
|
-
!function r(o,a,i){function l(t,e){if(!a[t]){if(!o[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(s)return s(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}n=a[t]={exports:{}},o[t][0].call(n.exports,function(e){return l(o[t][1][e]||e)},n,n.exports,r,o,a,i)}return a[t].exports}for(var s="function"==typeof require&&require,e=0;e<i.length;e++)l(i[e]);return l}({1:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}n.__esModule=!0;var a=o(e("./handlebars/base")),i=r(e("./handlebars/safe-string")),l=r(e("./handlebars/exception")),s=o(e("./handlebars/utils")),u=o(e("./handlebars/runtime")),e=r(e("./handlebars/no-conflict"));function c(){var t=new a.HandlebarsEnvironment;return s.extend(t,a),t.SafeString=i.default,t.Exception=l.default,t.Utils=s,t.escapeExpression=s.escapeExpression,t.VM=u,t.template=function(e){return u.template(e,t)},t}var p=c();p.create=c,e.default(p),p.default=p,n.default=p,t.exports=n.default},{"./handlebars/base":2,"./handlebars/exception":5,"./handlebars/no-conflict":18,"./handlebars/runtime":19,"./handlebars/safe-string":20,"./handlebars/utils":21}],2:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0,n.HandlebarsEnvironment=p;var o=e("./utils"),a=r(e("./exception")),i=e("./helpers"),l=e("./decorators"),s=r(e("./logger")),u=e("./internal/proto-access"),c=(n.VERSION="4.7.8",n.COMPILER_REVISION=8,n.LAST_COMPATIBLE_COMPILER_REVISION=7,n.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"},"[object Object]");function p(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},i.registerDefaultHelpers(this),l.registerDefaultDecorators(this)}p.prototype={constructor:p,logger:s.default,log:s.default.log,registerHelper:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(o.toString.call(e)===c)o.extend(this.partials,e);else{if(void 0===t)throw new a.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(o.toString.call(e)===c){if(t)throw new a.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){u.resetLoggedProperties()}};e=s.default.log;n.log=e,n.createFrame=o.createFrame,n.logger=s.default},{"./decorators":3,"./exception":5,"./helpers":6,"./internal/proto-access":15,"./logger":17,"./utils":21}],3:[function(e,t,n){"use strict";n.__esModule=!0,n.registerDefaultDecorators=function(e){r.default(e)};var n=e("./decorators/inline"),r=(e=n)&&e.__esModule?e:{default:e}},{"./decorators/inline":4}],4:[function(e,t,n){"use strict";n.__esModule=!0;var i=e("../utils");n.default=function(e){e.registerDecorator("inline",function(r,o,a,e){var t=r;return o.partials||(o.partials={},t=function(e,t){var n=a.partials,e=(a.partials=i.extend({},n,o.partials),r(e,t));return a.partials=n,e}),o.partials[e.args[0]]=e.fn,t})},t.exports=n.default},{"../utils":21}],5:[function(e,t,n){"use strict";n.__esModule=!0;var s=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function u(e,t){for(var t=t&&t.loc,n=void 0,r=void 0,o=void 0,a=void 0,i=(t&&(n=t.start.line,r=t.end.line,o=t.start.column,a=t.end.column,e+=" - "+n+":"+o),Error.prototype.constructor.call(this,e)),l=0;l<s.length;l++)this[s[l]]=i[s[l]];Error.captureStackTrace&&Error.captureStackTrace(this,u);try{t&&(this.lineNumber=n,this.endLineNumber=r,Object.defineProperty?(Object.defineProperty(this,"column",{value:o,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:a,enumerable:!0})):(this.column=o,this.endColumn=a))}catch(e){}}u.prototype=new Error,n.default=u,t.exports=n.default},{}],6:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0,n.registerDefaultHelpers=function(e){o.default(e),a.default(e),i.default(e),l.default(e),s.default(e),u.default(e),c.default(e)},n.moveHelperToHooks=function(e,t,n){e.helpers[t]&&(e.hooks[t]=e.helpers[t],n||delete e.helpers[t])};var o=r(e("./helpers/block-helper-missing")),a=r(e("./helpers/each")),i=r(e("./helpers/helper-missing")),l=r(e("./helpers/if")),s=r(e("./helpers/log")),u=r(e("./helpers/lookup")),c=r(e("./helpers/with"))},{"./helpers/block-helper-missing":7,"./helpers/each":8,"./helpers/helper-missing":9,"./helpers/if":10,"./helpers/log":11,"./helpers/lookup":12,"./helpers/with":13}],7:[function(e,t,n){"use strict";n.__esModule=!0;var a=e("../utils");n.default=function(o){o.registerHelper("blockHelperMissing",function(e,t){var n=t.inverse,r=t.fn;return!0===e?r(this):!1===e||null==e?n(this):a.isArray(e)?0<e.length?(t.ids&&(t.ids=[t.name]),o.helpers.each(e,t)):n(this):(t.data&&t.ids&&((n=a.createFrame(t.data)).contextPath=a.appendContextPath(t.data.contextPath,t.name),t={data:n}),r(e,t))})},t.exports=n.default},{"../utils":21}],8:[function(e,t,n){"use strict";n.__esModule=!0;var h=e("../utils"),e=e("../exception"),m=(e=e)&&e.__esModule?e:{default:e};n.default=function(e){e.registerHelper("each",function(r,e){if(!e)throw new m.default("Must pass iterator to #each");var t,o=e.fn,n=e.inverse,a=0,i="",l=void 0,s=void 0;function u(e,t,n){l&&(l.key=e,l.index=t,l.first=0===t,l.last=!!n,s)&&(l.contextPath=s+e),i+=o(r[e],{data:l,blockParams:h.blockParams([r[e],e],[s+e,null])})}if(e.data&&e.ids&&(s=h.appendContextPath(e.data.contextPath,e.ids[0])+"."),h.isFunction(r)&&(r=r.call(this)),e.data&&(l=h.createFrame(e.data)),r&&"object"==typeof r)if(h.isArray(r))for(var c=r.length;a<c;a++)a in r&&u(a,a,a===r.length-1);else if("function"==typeof Symbol&&r[Symbol.iterator]){for(var p=[],f=r[Symbol.iterator](),d=f.next();!d.done;d=f.next())p.push(d.value);for(c=(r=p).length;a<c;a++)u(a,a,a===r.length-1)}else t=void 0,Object.keys(r).forEach(function(e){void 0!==t&&u(t,a-1),t=e,a++}),void 0!==t&&u(t,a-1,!0);return i=0===a?n(this):i})},t.exports=n.default},{"../exception":5,"../utils":21}],9:[function(e,t,n){"use strict";n.__esModule=!0;var e=e("../exception"),r=(e=e)&&e.__esModule?e:{default:e};n.default=function(e){e.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new r.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},t.exports=n.default},{"../exception":5}],10:[function(e,t,n){"use strict";n.__esModule=!0;var r=e("../utils"),e=e("../exception"),o=(e=e)&&e.__esModule?e:{default:e};n.default=function(n){n.registerHelper("if",function(e,t){if(2!=arguments.length)throw new o.default("#if requires exactly one argument");return r.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||r.isEmpty(e)?t.inverse(this):t.fn(this)}),n.registerHelper("unless",function(e,t){if(2!=arguments.length)throw new o.default("#unless requires exactly one argument");return n.helpers.if.call(this,e,{fn:t.inverse,inverse:t.fn,hash:t.hash})})},t.exports=n.default},{"../exception":5,"../utils":21}],11:[function(e,t,n){"use strict";n.__esModule=!0,n.default=function(o){o.registerHelper("log",function(){for(var e=[void 0],t=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)e.push(arguments[n]);var r=1;null!=t.hash.level?r=t.hash.level:t.data&&null!=t.data.level&&(r=t.data.level),e[0]=r,o.log.apply(o,e)})},t.exports=n.default},{}],12:[function(e,t,n){"use strict";n.__esModule=!0,n.default=function(e){e.registerHelper("lookup",function(e,t,n){return e&&n.lookupProperty(e,t)})},t.exports=n.default},{}],13:[function(e,t,n){"use strict";n.__esModule=!0;var o=e("../utils"),e=e("../exception"),a=(e=e)&&e.__esModule?e:{default:e};n.default=function(e){e.registerHelper("with",function(e,t){if(2!=arguments.length)throw new a.default("#with requires exactly one argument");o.isFunction(e)&&(e=e.call(this));var n,r=t.fn;return o.isEmpty(e)?t.inverse(this):(n=t.data,t.data&&t.ids&&((n=o.createFrame(t.data)).contextPath=o.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:n,blockParams:o.blockParams([e],[n&&n.contextPath])}))})},t.exports=n.default},{"../exception":5,"../utils":21}],14:[function(e,t,n){"use strict";n.__esModule=!0,n.createNewLookupObject=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.extend.apply(void 0,[Object.create(null)].concat(t))};var r=e("../utils")},{"../utils":21}],15:[function(e,t,n){"use strict";n.__esModule=!0,n.createProtoAccessControl=function(e){var t=Object.create(null),n=(t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1,Object.create(null));return n.__proto__=!1,{properties:{whitelist:r.createNewLookupObject(n,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:r.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}},n.resultIsAllowed=function(e,t,n){return i("function"==typeof e?t.methods:t.properties,n)},n.resetLoggedProperties=function(){Object.keys(a).forEach(function(e){delete a[e]})};var r=e("./create-new-lookup-object"),n=e("../logger"),o=(e=n)&&e.__esModule?e:{default:e},a=Object.create(null);function i(e,t){return void 0!==e.whitelist[t]?!0===e.whitelist[t]:void 0!==e.defaultValue?e.defaultValue:(!0!==a[e=t]&&(a[e]=!0,o.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details')),!1)}},{"../logger":17,"./create-new-lookup-object":14}],16:[function(e,t,n){"use strict";n.__esModule=!0,n.wrapHelper=function(t,n){if("function"!=typeof t)return t;return function(){var e=arguments[arguments.length-1];return arguments[arguments.length-1]=n(e),t.apply(this,arguments)}}},{}],17:[function(e,t,n){"use strict";n.__esModule=!0;var r=e("./utils"),o={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){var t;return e="string"==typeof e?0<=(t=r.indexOf(o.methodMap,e.toLowerCase()))?t:parseInt(e,10):e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){e=o.methodMap[e];console[e]||(e="log");for(var t=arguments.length,n=Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console[e].apply(console,n)}}};n.default=o,t.exports=n.default},{"./utils":21}],18:[function(e,t,n){"use strict";n.__esModule=!0,n.default=function(e){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}},t.exports=n.default},{}],19:[function(e,t,n){"use strict";n.__esModule=!0,n.checkRevision=function(e){var t=e&&e[0]||1,n=f.COMPILER_REVISION;if(!(t>=f.LAST_COMPATIBLE_COMPILER_REVISION&&t<=f.COMPILER_REVISION))throw t<f.LAST_COMPATIBLE_COMPILER_REVISION?(n=f.REVISION_CHANGES[n],t=f.REVISION_CHANGES[t],new p.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+t+").")):new p.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")},n.template=function(s,u){if(!u)throw new p.default("No environment passed to template");if(!s||!s.main)throw new p.default("Unknown template object: "+typeof s);s.main.decorator=s.main_d,u.VM.checkRevision(s.compiler);var n=s.compiler&&7===s.compiler[0];var i={strict:function(e,t,n){if(e&&t in e)return i.lookupProperty(e,t);throw new p.default('"'+t+'" not defined in '+e,{loc:n})},lookupProperty:function(e,t){var n=e[t];return null==n||Object.prototype.hasOwnProperty.call(e,t)||h.resultIsAllowed(n,i.protoAccessControl,t)?n:void 0},lookup:function(e,t){for(var n=e.length,r=0;r<n;r++)if(null!=(e[r]&&i.lookupProperty(e[r],t)))return e[r][t]},lambda:function(e,t){return"function"==typeof e?e.call(t):e},escapeExpression:c.escapeExpression,invokePartial:function(e,t,n){n.hash&&(t=c.extend({},t,n.hash),n.ids)&&(n.ids[0]=!0),e=u.VM.resolvePartial.call(this,e,t,n);var r=c.extend({},n,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),o=u.VM.invokePartial.call(this,e,t,r);if(null==o&&u.compile&&(n.partials[n.name]=u.compile(e,s.compilerOptions,u),o=n.partials[n.name](t,r)),null==o)throw new p.default("The partial "+n.name+" could not be compiled when running in runtime-only mode");if(n.indent){for(var a=o.split("\n"),i=0,l=a.length;i<l&&(a[i]||i+1!==l);i++)a[i]=n.indent+a[i];o=a.join("\n")}return o},fn:function(e){var t=s[e];return t.decorator=s[e+"_d"],t},programs:[],program:function(e,t,n,r,o){var a=this.programs[e],i=this.fn(e);return a=t||o||r||n?m(this,e,i,t,n,r,o):a||(this.programs[e]=m(this,e,i))},data:function(e,t){for(;e&&t--;)e=e._parent;return e},mergeIfNeeded:function(e,t){var n=e||t;return n=e&&t&&e!==t?c.extend({},t,e):n},nullContext:Object.seal({}),noop:u.VM.noop,compilerInfo:s.compiler};function l(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.data,r=(l._setup(t),!t.partial&&s.useData&&(n=function(e,t){t&&"root"in t||((t=t?f.createFrame(t):{}).root=e);return t}(e,n)),void 0),o=s.useBlockParams?[]:void 0;function a(e){return""+s.main(i,e,i.helpers,i.partials,n,o,r)}return s.useDepths&&(r=t.depths?e!=t.depths[0]?[e].concat(t.depths):t.depths:[e]),(a=g(s.main,a,i,t.depths||[],n,o))(e,t)}return l.isTop=!0,l._setup=function(e){var t,r,o;e.partial?(i.protoAccessControl=e.protoAccessControl,i.helpers=e.helpers,i.partials=e.partials,i.decorators=e.decorators,i.hooks=e.hooks):(t=c.extend({},u.helpers,e.helpers),r=t,o=i,Object.keys(r).forEach(function(e){var t,n=r[e];r[e]=(t=o.lookupProperty,d.wrapHelper(n,function(e){return c.extend({lookupProperty:t},e)}))}),i.helpers=t,s.usePartial&&(i.partials=i.mergeIfNeeded(e.partials,u.partials)),(s.usePartial||s.useDecorators)&&(i.decorators=c.extend({},u.decorators,e.decorators)),i.hooks={},i.protoAccessControl=h.createProtoAccessControl(e),t=e.allowCallsToHelperMissing||n,a.moveHelperToHooks(i,"helperMissing",t),a.moveHelperToHooks(i,"blockHelperMissing",t))},l._child=function(e,t,n,r){if(s.useBlockParams&&!n)throw new p.default("must pass block params");if(s.useDepths&&!r)throw new p.default("must pass parent depths");return m(i,e,s[e],t,0,n,r)},l},n.wrapProgram=m,n.resolvePartial=function(e,t,n){e?e.call||n.name||(n.name=e,e=n.partials[e]):e="@partial-block"===n.name?n.data["partial-block"]:n.partials[n.name];return e},n.invokePartial=function(e,t,r){var o=r.data&&r.data["partial-block"];r.partial=!0,r.ids&&(r.data.contextPath=r.ids[0]||r.data.contextPath);var a=void 0;r.fn&&r.fn!==i&&!function(){r.data=f.createFrame(r.data);var n=r.fn;a=r.data["partial-block"]=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return t.data=f.createFrame(t.data),t.data["partial-block"]=o,n(e,t)},n.partials&&(r.partials=c.extend({},r.partials,n.partials))}();void 0===e&&a&&(e=a);{if(void 0===e)throw new p.default("The partial "+r.name+" could not be found");if(e instanceof Function)return e(t,r)}},n.noop=i;var c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("./utils")),n=e("./exception"),p=(n=n)&&n.__esModule?n:{default:n},f=e("./base"),a=e("./helpers"),d=e("./internal/wrapHelper"),h=e("./internal/proto-access");function m(r,e,o,a,t,i,l){function n(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=l;return!l||e==l[0]||e===r.nullContext&&null===l[0]||(n=[e].concat(l)),o(r,e,r.helpers,r.partials,t.data||a,i&&[t.blockParams].concat(i),n)}return(n=g(o,n,r,l,a,i)).program=e,n.depth=l?l.length:0,n.blockParams=t||0,n}function i(){return""}function g(e,t,n,r,o,a){return e.decorator&&(t=e.decorator(t,e={},n,r&&r[0],o,a,r),c.extend(t,e)),t}},{"./base":2,"./exception":5,"./helpers":6,"./internal/proto-access":15,"./internal/wrapHelper":16,"./utils":21}],20:[function(e,t,n){"use strict";function r(e){this.string=e}n.__esModule=!0,r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},n.default=r,t.exports=n.default},{}],21:[function(e,t,n){"use strict";n.__esModule=!0,n.extend=l,n.indexOf=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},n.escapeExpression=function(e){if("string"!=typeof e){if(e&&e.toHTML)return e.toHTML();if(null==e)return"";if(!e)return e+"";e=""+e}return a.test(e)?e.replace(o,i):e},n.isEmpty=function(e){return!e&&0!==e||!(!c(e)||0!==e.length)},n.createFrame=function(e){var t=l({},e);return t._parent=e,t},n.blockParams=function(e,t){return e.path=t,e},n.appendContextPath=function(e,t){return(e?e+".":"")+t};var r={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},o=/[&<>"'`=]/g,a=/[&<>"'`=]/;function i(e){return r[e]}function l(e){for(var t=1;t<arguments.length;t++)for(var n in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],n)&&(e[n]=arguments[t][n]);return e}var s=Object.prototype.toString,u=(n.toString=s,function(e){return"function"==typeof e}),c=(u(/x/)&&(n.isFunction=u=function(e){return"function"==typeof e&&"[object Function]"===s.call(e)}),n.isFunction=u,Array.isArray||function(e){return!(!e||"object"!=typeof e)&&"[object Array]"===s.call(e)});n.isArray=c},{}],22:[function(e,t,n){t.exports=e("./dist/cjs/handlebars.runtime").default},{"./dist/cjs/handlebars.runtime":1}],23:[function(e,t,n){t.exports=e("handlebars/runtime").default},{"handlebars/runtime":22}],24:[function(e,t,n){e=e("hbsfy/runtime");t.exports=e.template({1:function(e,t,n,r,o){return"disabled"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var a,i=null!=t?t:e.nullContext||{},l=e.hooks.helperMissing,s="function",u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<button\n type="button"\n class="count-btn count-btn--'+u(typeof(a=null!=(a=c(n,"type")||(null!=t?c(t,"type"):t))?a:l)==s?a.call(i,{name:"type",hash:{},data:o,loc:{start:{line:3,column:32},end:{line:3,column:40}}}):a)+" "+u(typeof(a=null!=(a=c(n,"class")||(null!=t?c(t,"class"):t))?a:l)==s?a.call(i,{name:"class",hash:{},data:o,loc:{start:{line:3,column:41},end:{line:3,column:50}}}):a)+'"\n aria-label="'+u(typeof(a=null!=(a=c(n,"ariaLabel")||(null!=t?c(t,"ariaLabel"):t))?a:l)==s?a.call(i,{name:"ariaLabel",hash:{},data:o,loc:{start:{line:4,column:16},end:{line:4,column:29}}}):a)+'"\n data-count-btn\n data-count-type="'+u(typeof(a=null!=(a=c(n,"type")||(null!=t?c(t,"type"):t))?a:l)==s?a.call(i,{name:"type",hash:{},data:o,loc:{start:{line:6,column:21},end:{line:6,column:29}}}):a)+'"\n '+(null!=(e=c(n,"if").call(i,null!=t?c(t,"disabled"):t,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:7,column:4},end:{line:7,column:35}}}))?e:"")+'\n>\n <i class="far '+u(typeof(a=null!=(a=c(n,"icon")||(null!=t?c(t,"icon"):t))?a:l)==s?a.call(i,{name:"icon",hash:{},data:o,loc:{start:{line:9,column:16},end:{line:9,column:24}}}):a)+'" aria-hidden="true"></i>\n</button>\n'},useData:!0})},{"hbsfy/runtime":23}],25:[function(e,t,n){"use strict";var r=e("../utils/create-count-stepper"),o=window.Wick||{};o.PDPCountStepper={el:{input:"#quantity-field"},stepper:null,init:function(){o.PDPCountStepper.stepper=(0,r.createCountStepper)({inputSel:o.PDPCountStepper.el.input,min:1,max:99,onChange:function(e,t){$(t).trigger("change")}}),o.PDPCountStepper.stepper.init($(document))}},$(document).ready(function(){$(o.PDPCountStepper.el.input).length&&o.PDPCountStepper.init()})},{"../utils/create-count-stepper":26}],26:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createCountStepper=function(){var e,o=function(e){return function(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?i(Object(o),!0).forEach(function(e){var t,n;t=r,n=o[e=e],(e=function(e){e=function(e,t){if("object"!==a(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"===a(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}({inputSel:"#quantity-field",min:1,enhancedInputClass:"count-stepper__input",enhancedParentClass:"count-stepper",onChange:null},e)}(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});if(o.inputSel)return e=".cnt_".concat(Math.random().toString(16).slice(2)),$(document).off("click".concat(e),"[data-count-btn]").on("click".concat(e),"[data-count-btn]",function(e){var t=$(this),n=t.parent().find(o.inputSel).first();n.length&&(e.preventDefault(),e=(t.attr("data-count-type")||"").toLowerCase(),t=l(n.val(),o.min),"plus"===e&&f(n,o,t+1),"minus"===e)&&f(n,o,t-1)}),$(document).off("input".concat(e," change").concat(e),o.inputSel).on("input".concat(e," change").concat(e),o.inputSel,function(){p($(this),o)}),{init:function(e){!function(e,t){var e=e&&e.length?e:$(document),n=e.is(t)?e:$(),e=e.find(t);return n.add(e)}(e,o.inputSel).each(function(){var e=$(this),t=o,n=u(e),r=(e.addClass(t.enhancedInputClass),n.addClass(t.enhancedParentClass),c(n).length),n=n.find('[data-count-btn][data-count-type="plus"]').first().length;r||e.before(s("minus",!0)),n||e.after(s("plus",!1)),r=l(e.val(),t.min),f(e,t,r)})}};throw new Error("[createCountStepper] Missing inputSel")};var r=(n=e("../../../elements/count-button.hbs"))&&n.__esModule?n:{default:n};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function l(e,t){e=e,e=parseInt(String(e||"").trim(),10);e=Number.isFinite(e)?e:NaN;return Number.isFinite(e)?e:t}function s(e,t){return(0,r.default)({type:e,icon:"plus"===e?"fa-plus":"fa-minus",ariaLabel:"plus"===e?"Increase quantity":"Decrease quantity",disabled:!!t})}function u(e){return e.parent()}function c(e){return e.find('[data-count-btn][data-count-type="minus"]').first()}function p(e,t){var n=u(e),e=l(e.val(),t.min),n=c(n);n.length&&n.prop("disabled",e<=t.min)}function f(e,t,n){r=t.min;var r=Math.max(r,n);e.val(String(r)),p(e,t),"function"==typeof t.onChange&&t.onChange(r,e.get(0))}},{"../../../elements/count-button.hbs":24}]},{},[25]);
|
|
@@ -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
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
let suppressQuantityReportValidityOnBlur = false;
|
|
2
|
-
|
|
3
|
-
$(document)
|
|
4
|
-
.off('blur.quantityValidation', '#quantity-field')
|
|
5
|
-
.on('blur.quantityValidation', '#quantity-field', function () {
|
|
6
|
-
if (suppressQuantityReportValidityOnBlur) {
|
|
7
|
-
suppressQuantityReportValidityOnBlur = false;
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
this.reportValidity();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
$(document)
|
|
15
|
-
.off('keydown.quantityValidation', '#quantity-field')
|
|
16
|
-
.on('keydown.quantityValidation', '#quantity-field', function (e) {
|
|
17
|
-
if (e.key !== 'Enter') return;
|
|
18
|
-
|
|
19
|
-
e.preventDefault();
|
|
20
|
-
e.stopPropagation();
|
|
21
|
-
|
|
22
|
-
const isValid = this.checkValidity();
|
|
23
|
-
|
|
24
|
-
Wick.FEMock.dispatchProductAddedToCart(Wick.FEMock.getCartPdpHtml({ hasError: !isValid }));
|
|
25
|
-
|
|
26
|
-
suppressQuantityReportValidityOnBlur = true;
|
|
27
|
-
this.blur();
|
|
28
|
-
|
|
29
|
-
setTimeout(() => {
|
|
30
|
-
const $focusTarget = $('.custom-slider.just-added .close-popup').first();
|
|
31
|
-
if ($focusTarget.length) $focusTarget.trigger('focus');
|
|
32
|
-
}, 150);
|
|
33
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { createCountStepper } from '../utils/create-count-stepper';
|
|
2
|
-
|
|
3
|
-
var Wick = window.Wick || {};
|
|
4
|
-
|
|
5
|
-
Wick.PDPCountStepper = {
|
|
6
|
-
el: {
|
|
7
|
-
input: '#quantity-field',
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
stepper: null,
|
|
11
|
-
|
|
12
|
-
init() {
|
|
13
|
-
Wick.PDPCountStepper.stepper = createCountStepper({
|
|
14
|
-
inputSel: Wick.PDPCountStepper.el.input,
|
|
15
|
-
min: 1,
|
|
16
|
-
max: 99,
|
|
17
|
-
onChange(qty, inputEl) {
|
|
18
|
-
$(inputEl).trigger('change');
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
Wick.PDPCountStepper.stepper.init($(document));
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
$(document).ready(function () {
|
|
27
|
-
if (!$(Wick.PDPCountStepper.el.input).length) return;
|
|
28
|
-
Wick.PDPCountStepper.init();
|
|
29
|
-
});
|