wickes-css2 2.94.0-develop.2 → 2.94.0-develop.20
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 +4 -5
- package/build/css/category-main.css +1 -1
- package/build/css/components/checkout-payment-details-v2.css +1 -1
- package/build/css/homepage-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/checkout-new.css +1 -1
- package/build/css/pages/checkout.css +1 -1
- package/build/css/pages/my-account-v2.css +1 -1
- package/build/css/pages/my-account.css +1 -1
- package/build/css/pages/page_checkout_delivery-new.css +1 -1
- package/build/css/pages/page_default-store.css +1 -0
- package/build/css/pages/page_my-orders.css +1 -0
- package/build/css/pages/page_personal-details.css +1 -1
- package/build/css/pages/page_product-details-v2-critical.css +1 -1
- package/build/css/pages/page_product-details-v2.css +1 -1
- package/build/css/pages/page_products-list-combined.css +1 -1
- package/build/css/pages/page_products-list.css +1 -1
- package/build/css/pages/page_shopping-cart-v2.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/js/account-members.min.js +1 -1
- package/build/js/basket.min.js +2 -2
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +2 -2
- package/build/js/default-store.min.js +1 -0
- package/build/js/emulation.min.js +153 -5
- package/build/js/general.bundle.min.js +1 -1
- package/build/js/merged-checkout.min.js +2 -2
- package/build/js/my-orders.min.js +1 -0
- package/build/js/page/basket/summary-mobile.js +22 -0
- package/build/js/page/basket-v2.js +20 -6
- package/build/js/page/components/order-summary.js +8 -1
- package/build/js/page/components/sticky-order-observer.js +49 -0
- package/build/js/page/components/voucher.js +1 -1
- package/build/js/page/default-store.js +44 -0
- package/build/js/page/my-orders.js +165 -0
- package/build/js/page/personal-details.js +105 -36
- package/build/js/pdp.bundle.min.js +1 -1
- package/build/js/personal-details.min.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +1 -1
- package/package.json +2 -10
- package/src/components/account-families/actions-bar.hbs +3 -3
- package/src/components/checkout-action.hbs +14 -11
- package/src/components/checkout-voucher-accordion.hbs +15 -0
- package/src/components/checkout_order-summary-new.hbs +5 -3
- package/src/components/checkout_voucher_large.hbs +20 -16
- package/src/components/default-store/current-store.hbs +60 -0
- package/src/components/default-store/list-of-store.hbs +39 -0
- package/src/components/default-store/store-form.hbs +29 -0
- package/src/components/default-store/store-unavailable.hbs +4 -0
- package/src/components/flatpickr-calendar.hbs +26 -0
- package/src/components/my-account/active-orders/header.hbs +6 -2
- package/src/components/my-account/active-orders/list-orders.hbs +14 -2
- package/src/components/my-account/active-orders/order-header.hbs +1 -1
- package/src/components/my-account/active-orders/order.hbs +10 -6
- package/src/components/my-account/clipboard-code-card.hbs +1 -1
- package/src/components/my-account/empty-orders.hbs +9 -0
- package/src/components/my-account/mobile-nav.hbs +23 -19
- package/src/components/my-account/orders-nav.hbs +15 -0
- package/src/components/my-account/personal-details-form.hbs +5 -0
- package/src/components/my-account/sort-by.hbs +3 -0
- package/src/components/my-account/user-account-actions.hbs +1 -1
- package/src/components/order-summary.hbs +91 -56
- package/src/components/signup-form.hbs +1 -2
- package/src/components/store-details.hbs +22 -20
- package/src/components/store-preview.hbs +0 -11
- package/src/components/summary-mobile-bar.hbs +17 -0
- package/src/components/user-information-field.hbs +1 -1
- package/src/data/data_big-wins-stores.json +0 -22
- package/src/data/data_delivery-address-v2.json +1 -1
- package/src/data/my-account/data_my-orders.json +246 -0
- package/src/data/my-account/data_personal-details.json +36 -11
- package/src/data/my-account/page_default-store.json +158 -0
- package/src/elements/dropdown.hbs +1 -1
- package/src/elements/input.hbs +2 -2
- package/src/js/components/flatpickr.js +167 -0
- package/src/js/components/general/handleAccordion.js +35 -0
- package/src/js/components/general/is-trade-pro.js +15 -1
- package/src/js/components/general/switchVat.js +1 -1
- package/src/js/components/leave-event.js +41 -2
- package/src/js/emulation/basket-data.js +2 -2
- package/src/js/emulation/big-wins.js +0 -2
- package/src/js/emulation/default-store.js +97 -0
- package/src/js/emulation/forms.js +1 -1
- package/src/js/emulation/mock.js +10 -0
- package/src/js/emulation/my-orders-local.js +41 -0
- package/src/js/page/basket/summary-mobile.js +22 -0
- package/src/js/page/basket-v2.js +20 -6
- package/src/js/page/components/order-summary.js +8 -1
- package/src/js/page/components/sticky-order-observer.js +49 -0
- package/src/js/page/components/voucher.js +1 -1
- package/src/js/page/default-store.js +44 -0
- package/src/js/page/my-orders.js +165 -0
- package/src/js/page/personal-details.js +105 -36
- package/src/layouts/basket-new.hbs +1 -1
- package/src/layouts/checkout-new.hbs +1 -0
- package/src/page_checkout_confirmation-new-marketing-consent-error.html +0 -2
- package/src/page_checkout_delivery-address-customer-journey.html +0 -5
- package/src/page_checkout_delivery-address-v2.html +0 -4
- package/src/page_checkout_delivery-details-v2-asm.html +1 -5
- package/src/page_checkout_delivery-details-v2-calendar-message.html +0 -3
- package/src/page_checkout_delivery-details-v2-oos.html +0 -3
- package/src/page_checkout_delivery-details-v2-wisdom-not-available.html +0 -5
- package/src/page_checkout_delivery-details-v2-wisdom.html +0 -5
- package/src/page_checkout_delivery-details-with-loader-v2.html +0 -3
- package/src/page_checkout_delivery-details_guest-new.html +0 -5
- package/src/page_checkout_delivery_address-asm-new.html +0 -4
- package/src/page_checkout_next-day-delivery-details.html +0 -6
- package/src/page_checkout_payment-details-v2.html +1 -1
- package/src/page_checkout_payment-details_guest-with-checkout-journey.html +0 -2
- package/src/page_checkout_payment-details_login-with-checkout-journey.html +0 -2
- package/src/page_checkout_payment-details_with-card-loader.html +56 -0
- package/src/page_checkout_rapid-delivery-details.html +0 -6
- package/src/page_default-store-page-empty.html +48 -0
- package/src/page_default-store-page.html +55 -0
- package/src/page_klarna_payment-details_with-klarna.html +3 -6
- package/src/page_my-orders-empty.html +49 -0
- package/src/page_my-orders.html +64 -0
- package/src/page_payment-details-with-clearpay.html +1 -1
- package/src/page_payment-details_with_apple-pay.html +1 -1
- package/src/page_payment-details_with_google-pay.html +1 -1
- package/src/page_personal-details-installer.html +17 -7
- package/src/page_personal-details.html +15 -7
- package/src/page_shopping-cart-v2.html +6 -16
- package/src/scss/barclays-paypage-combined-minified.css +1 -1
- package/src/scss/barclays-paypage-combined.css +9 -15
- package/src/scss/components/_big-wins-critical.scss +0 -1
- package/src/scss/components/_big-wins.scss +1 -8
- package/src/scss/components/_checkout-action.scss +132 -6
- package/src/scss/components/_order-item-cc.scss +0 -6
- package/src/scss/components/_order-summary.scss +329 -178
- package/src/scss/components/_sticky-element-appearance.scss +25 -0
- package/src/scss/components/checkout-payment-details-v2.scss +2 -2
- package/src/scss/components/my-account/_active-orders.scss +263 -0
- package/src/scss/components/my-account/_orders-nav.scss +61 -0
- package/src/scss/components/my-account/_shipment.scss +1 -0
- package/src/scss/helpers/_variables.scss +3 -0
- package/src/scss/libs/flatpickr.scss +235 -0
- package/src/scss/main.scss +1 -0
- package/src/scss/pages/_checkout-widget.scss +137 -28
- package/src/scss/pages/_my-account_new.scss +1 -12
- package/src/scss/pages/my-account-v2.scss +1 -136
- package/src/scss/pages/page_checkout_delivery-new.scss +119 -10
- package/src/scss/pages/page_default-store.scss +634 -0
- package/src/scss/pages/page_my-orders.scss +232 -0
- package/src/scss/pages/page_personal-details.scss +37 -5
- package/src/scss/pages/page_products-list-combined.scss +0 -1
- package/src/scss/pages/page_products-list.scss +0 -1
- package/src/scss/pages/page_shopping-cart-v2.scss +137 -36
- package/src/scss/partials/_header.scss +5 -0
- package/src/sitemap.html +6 -0
- package/src/scss/components/my-account/_order.scss +0 -112
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
{
|
|
2
|
+
"default-store": {
|
|
3
|
+
"title": "Default Store",
|
|
4
|
+
"subtitle": "Add default store",
|
|
5
|
+
"subtitleChange": "Change default store",
|
|
6
|
+
"searchField": {
|
|
7
|
+
"id": "postcode",
|
|
8
|
+
"label": "Search by postcode/town name",
|
|
9
|
+
"placeholder": "Postcode / city",
|
|
10
|
+
"iconSearch": "fas fa-search",
|
|
11
|
+
"iconLocation": "fas fa-crosshairs",
|
|
12
|
+
"iconError": "fas fa-exclamation-triangle",
|
|
13
|
+
"iconCross": "far fa-times fa-lg",
|
|
14
|
+
"error": "Check that you’ve entered a valid postcode or place name"
|
|
15
|
+
},
|
|
16
|
+
"unavailable": {
|
|
17
|
+
"title": "You have no default store",
|
|
18
|
+
"icon": "fas fa-warehouse"
|
|
19
|
+
},
|
|
20
|
+
"breadcrumbs": [
|
|
21
|
+
{
|
|
22
|
+
"url": "/",
|
|
23
|
+
"text": "Home"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"url": "/page_my-account.html",
|
|
27
|
+
"text": "My Account"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"url": "/page_default-store-page.html",
|
|
31
|
+
"text": "Default Store"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"menu": [
|
|
35
|
+
{
|
|
36
|
+
"icon": "fas fa-user",
|
|
37
|
+
"title": "My Account",
|
|
38
|
+
"link": "./page_my-account.html"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"icon": "fas fa-box-open",
|
|
42
|
+
"link": "./page_my-account_order-history.html",
|
|
43
|
+
"title": "My Orders",
|
|
44
|
+
"description": "View and manage your orders."
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"icon": "fas fa-address-card",
|
|
48
|
+
"link": "./page_my-account_personal-details.html",
|
|
49
|
+
"title": "Personal Details",
|
|
50
|
+
"description": "View and update your Personal Details."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"icon": "fas fa-book",
|
|
54
|
+
"link": "./page_my-account_address-book.html",
|
|
55
|
+
"title": "Address Book",
|
|
56
|
+
"description": "Manage your delivery addresses."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"icon": "fas fa-sliders-h",
|
|
60
|
+
"link": "./page_marketing-preferences.html",
|
|
61
|
+
"title": "Marketing Preferences",
|
|
62
|
+
"description": "Manage how you would like to receive the latest offers and deals."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"icon": "fas fa-list",
|
|
66
|
+
"link": "./page_my-shopping-list.html",
|
|
67
|
+
"title": "Project Lists",
|
|
68
|
+
"description": "Save products to your project lists."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"icon": "fas fa-warehouse",
|
|
72
|
+
"link": "./page_default-store-page.html",
|
|
73
|
+
"title": "Default Store",
|
|
74
|
+
"description": "Set your default store."
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"currentStore": {
|
|
78
|
+
"id": 1,
|
|
79
|
+
"name": "Blackheath",
|
|
80
|
+
"phone": "01869 356200",
|
|
81
|
+
"address": "271 Winchester Road, Southampton, Hampshire, SO16 6TP",
|
|
82
|
+
"facilities": [
|
|
83
|
+
{
|
|
84
|
+
"title": "Burger van",
|
|
85
|
+
"icon": "fas fa-burger-soda"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"title": "Kitchen & bathroom displays",
|
|
89
|
+
"icon": "fas fa-drafting-compass"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"title": "Installation service",
|
|
93
|
+
"icon": "fas fa-user-hard-hat"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"title": "Design appointments",
|
|
97
|
+
"icon": "fas fa-user-friends"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"title": "Paint mixing",
|
|
101
|
+
"icon": "fas fa-paint-roller"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"openingTimes": [
|
|
105
|
+
{
|
|
106
|
+
"day": "Monday",
|
|
107
|
+
"time": "07:00 AM - 08:00 PM"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"day": "Tuesday",
|
|
111
|
+
"time": "07:00 AM - 08:00 PM"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"day": "Wednesday",
|
|
115
|
+
"time": "07:00 AM - 08:00 PM"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"day": "Thursday",
|
|
119
|
+
"time": "07:00 AM - 08:00 PM"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"day": "Friday",
|
|
123
|
+
"time": "07:00 AM - 08:00 PM"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"day": "Saturday",
|
|
127
|
+
"time": "07:00 AM - 08:00 PM"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"day": "Sunday",
|
|
131
|
+
"time": "10:00 AM - 04:00 PM"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"specialOpeningTimes": [
|
|
135
|
+
{
|
|
136
|
+
"name": "Good Friday",
|
|
137
|
+
"day": "Fri 10 Apr",
|
|
138
|
+
"time": "10:00 AM - 4:00 PM"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "Saturday",
|
|
142
|
+
"day": "Sat 11 Apr",
|
|
143
|
+
"time": "Closed"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "Easter Sunday",
|
|
147
|
+
"day": "Sun 12 Apr",
|
|
148
|
+
"time": "Closed"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "Easter Monday",
|
|
152
|
+
"day": "Mon 13 Apr",
|
|
153
|
+
"time": "10:00 AM - 4:00 PM"
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</option>
|
|
11
11
|
{{/each}}
|
|
12
12
|
{{else}}
|
|
13
|
-
<option value="" disabled selected hidden>{{placeholder}}</option>
|
|
13
|
+
<option value="item0" disabled selected hidden>{{placeholder}}</option>
|
|
14
14
|
<option value="item1">Item value</option>
|
|
15
15
|
<option value="item2">Item value 2</option>
|
|
16
16
|
<option value="item3">Item value 3</option>
|
package/src/elements/input.hbs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{{#if textarea}}
|
|
2
2
|
<textarea class="tbx {{#if textarea}}tbx_textarea{{/if}} {{#if error}}tbx_error{{/if}}" rows="{{textareaRows}}" cols="{{textareaCols}}" value="{{value}}" maxlength="{{maxlength}}" id="{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" {{#if disabled}}disabled{{/if}}></textarea>
|
|
3
3
|
{{else if type}}
|
|
4
|
-
<input type="{{type}}" class="tbx {{#if error}}tbx_error{{/if}}" value="{{value}}" id="{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" {{#if (or locked disabled)}}disabled{{/if}} {{#if need-pattern}}pattern=""{{/if}} {{#if readonly}}readonly{{/if}}>
|
|
4
|
+
<input type="{{type}}" class="tbx {{#if error}}tbx_error{{/if}} {{input-mod}}" value="{{value}}" id="{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" {{#if (or locked disabled)}}disabled{{/if}} {{#if need-pattern}}pattern=""{{/if}} {{#if readonly}}readonly{{/if}} {{#if data-tag}}data-tag="{{data-tag}}"{{/if}}>
|
|
5
5
|
{{else}}
|
|
6
|
-
<input type="text" class="tbx {{#if error}}tbx_error{{/if}}" value="{{value}}" id="{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" placeholder="{{placeholder}}" {{#if (or locked disabled)}}disabled{{/if}} {{#if need-pattern}}pattern=""{{/if}} {{#if readonly}}readonly{{/if}}>
|
|
6
|
+
<input type="text" class="tbx {{#if error}}tbx_error{{/if}} {{input-mod}}" value="{{value}}" id="{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" placeholder="{{placeholder}}" {{#if (or locked disabled)}}disabled{{/if}} {{#if need-pattern}}pattern=""{{/if}} {{#if readonly}}readonly{{/if}} {{#if data-tag}}data-tag="{{data-tag}}"{{/if}}>
|
|
7
7
|
{{/if}}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
var Wick = window.Wick || {};
|
|
2
|
+
|
|
3
|
+
Wick.Flatpickr = {
|
|
4
|
+
el: {
|
|
5
|
+
$crossIcon: $("#crossIcon"),
|
|
6
|
+
$calendarIcon: $("#calendarIcon"),
|
|
7
|
+
flatpickrDisabled: '.flatpickr-disabled',
|
|
8
|
+
datePickerField: '.flatpickr-datepicker__field',
|
|
9
|
+
},
|
|
10
|
+
generateInitialDisabledMonths(year, startMonth) {
|
|
11
|
+
const today = new Date();
|
|
12
|
+
const currentYear = today.getFullYear();
|
|
13
|
+
const currentMonth = today.getMonth();
|
|
14
|
+
|
|
15
|
+
if (year === currentYear) {
|
|
16
|
+
return Array.from({ length: 12 - currentMonth - 1 }, (_, i) =>
|
|
17
|
+
new Date(year, currentMonth + 1 + i, 1)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return [];
|
|
22
|
+
},
|
|
23
|
+
handleYearChange(instance, minYear, currentYear, currentMonth) {
|
|
24
|
+
const selectedYear = instance.currentYear;
|
|
25
|
+
|
|
26
|
+
if (selectedYear > currentYear) {
|
|
27
|
+
instance.changeYear(currentYear);
|
|
28
|
+
} else if (selectedYear < minYear) {
|
|
29
|
+
instance.changeYear(minYear);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
Wick.Flatpickr.updateDisabledMonths(instance, selectedYear, currentMonth, currentYear);
|
|
33
|
+
},
|
|
34
|
+
updateDisabledMonths(instance, year, month) {
|
|
35
|
+
const disabledMonths = Wick.Flatpickr.generateInitialDisabledMonths(year, month);
|
|
36
|
+
instance.set("disable", disabledMonths);
|
|
37
|
+
},
|
|
38
|
+
bindClearIcon(instance, $field) {
|
|
39
|
+
if ($field.val().trim() !== "") {
|
|
40
|
+
Wick.Flatpickr.el.$crossIcon.removeClass("d-none").addClass("d-flex");
|
|
41
|
+
} else {
|
|
42
|
+
Wick.Flatpickr.el.$crossIcon.removeClass("d-flex").addClass("d-none");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Wick.Flatpickr.el.$crossIcon.on("click", function () {
|
|
46
|
+
instance.clear();
|
|
47
|
+
instance.setDate(null);
|
|
48
|
+
$field.val("");
|
|
49
|
+
Wick.Flatpickr.el.$crossIcon.hide();
|
|
50
|
+
instance.open();
|
|
51
|
+
instance.close();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
$field.on("input", function () {
|
|
55
|
+
if ($field.val().trim() === "") {
|
|
56
|
+
Wick.Flatpickr.el.$crossIcon.removeClass("d-flex").addClass("d-none");
|
|
57
|
+
} else {
|
|
58
|
+
Wick.Flatpickr.el.$crossIcon.removeClass("d-none").addClass("d-flex");
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
bindCalendarIcon(instance) {
|
|
63
|
+
Wick.Flatpickr.el.$calendarIcon.on("click", function () {
|
|
64
|
+
instance.open();
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
formatDateToYYYYMM(date) {
|
|
68
|
+
const newDate = new Date(date);
|
|
69
|
+
const year = newDate.getFullYear();
|
|
70
|
+
const month = String(newDate.getMonth() + 1).padStart(2, "0");
|
|
71
|
+
return `${year}-${month}`;
|
|
72
|
+
},
|
|
73
|
+
getFlatpickrConfig(config) {
|
|
74
|
+
const today = new Date();
|
|
75
|
+
const chooseDate = config.chooseDate
|
|
76
|
+
? new Date(config.chooseDate)
|
|
77
|
+
: null;
|
|
78
|
+
const currentYear = config.currentYear || today.getFullYear();
|
|
79
|
+
const currentMonth = chooseDate ? chooseDate.getMonth() : today.getMonth();
|
|
80
|
+
const minYear = config.minYear || currentYear - 15;
|
|
81
|
+
|
|
82
|
+
const minDate = new Date(minYear, 0, 1);
|
|
83
|
+
const maxDate = new Date(`${currentYear}-12-31`);
|
|
84
|
+
|
|
85
|
+
const initialDisabledMonths = Wick.Flatpickr.generateInitialDisabledMonths(
|
|
86
|
+
today.getFullYear(),
|
|
87
|
+
currentMonth
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
dateFormat: config.dateFormat || "F Y",
|
|
92
|
+
enableTime: false,
|
|
93
|
+
static: config.static || true,
|
|
94
|
+
defaultDate: chooseDate || null,
|
|
95
|
+
placeholder: "Select year and month",
|
|
96
|
+
minDate,
|
|
97
|
+
maxDate,
|
|
98
|
+
disable: initialDisabledMonths,
|
|
99
|
+
plugins: [
|
|
100
|
+
new monthSelectPlugin({
|
|
101
|
+
shorthand: false,
|
|
102
|
+
dateFormat: config.dateFormat || "F Y",
|
|
103
|
+
theme: "light",
|
|
104
|
+
}),
|
|
105
|
+
],
|
|
106
|
+
onYearChange: (selectedDates, dateStr, instance) => {
|
|
107
|
+
Wick.Flatpickr.handleYearChange(
|
|
108
|
+
instance,
|
|
109
|
+
minYear,
|
|
110
|
+
currentYear,
|
|
111
|
+
currentMonth
|
|
112
|
+
);
|
|
113
|
+
},
|
|
114
|
+
onMonthChange: (selectedDates, dateStr, instance) => {
|
|
115
|
+
Wick.Flatpickr.updateDisabledMonths(
|
|
116
|
+
instance,
|
|
117
|
+
currentYear,
|
|
118
|
+
currentMonth
|
|
119
|
+
);
|
|
120
|
+
},
|
|
121
|
+
onReady: (selectedDates, dateStr, instance) => {
|
|
122
|
+
Wick.Flatpickr.updateDisabledMonths(
|
|
123
|
+
instance,
|
|
124
|
+
currentYear,
|
|
125
|
+
currentMonth
|
|
126
|
+
);
|
|
127
|
+
},
|
|
128
|
+
onOpen: (selectedDates, dateStr, instance) => {
|
|
129
|
+
$(Wick.Flatpickr.el.datePickerField).addClass('active');
|
|
130
|
+
},
|
|
131
|
+
onClose: (selectedDates, dateStr, instance) => {
|
|
132
|
+
$(Wick.Flatpickr.el.datePickerField).removeClass("active");
|
|
133
|
+
$(Wick.Flatpickr.el.flatpickrDisabled).removeClass("flatpickr-disabled");
|
|
134
|
+
|
|
135
|
+
if (selectedDates.length > 0) {
|
|
136
|
+
const selectedDate = selectedDates[0];
|
|
137
|
+
const selectedYear = selectedDate.getFullYear();
|
|
138
|
+
const selectedMonth = selectedDate.getMonth();
|
|
139
|
+
instance.currentYear = selectedYear;
|
|
140
|
+
instance.currentMonth = selectedMonth;
|
|
141
|
+
|
|
142
|
+
Wick.Flatpickr.updateDisabledMonths(instance, selectedYear, selectedMonth);
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
onChange: (selectedDates, dateStr) => {
|
|
146
|
+
const { onChangeCallback } = config;
|
|
147
|
+
if (typeof onChangeCallback === "function") {
|
|
148
|
+
const formattedDate = Wick.Flatpickr.formatDateToYYYYMM(selectedDates[0]);
|
|
149
|
+
onChangeCallback(formattedDate);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
init(config) {
|
|
155
|
+
const $field = $(config.id);
|
|
156
|
+
|
|
157
|
+
if (!$field.length) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const flatpickrConfig = Wick.Flatpickr.getFlatpickrConfig(config);
|
|
162
|
+
const flatpickrInstance = flatpickr(config.id, flatpickrConfig);
|
|
163
|
+
|
|
164
|
+
Wick.Flatpickr.bindClearIcon(flatpickrInstance, $field);
|
|
165
|
+
Wick.Flatpickr.bindCalendarIcon(flatpickrInstance);
|
|
166
|
+
},
|
|
167
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var Wick = Wick || {};
|
|
2
|
+
|
|
3
|
+
Wick.HandleAccordions = {
|
|
4
|
+
el: {
|
|
5
|
+
$body: $('body'),
|
|
6
|
+
$accordions: $(".account-nav .accordion"),
|
|
7
|
+
accordionContent: '.accordion__content',
|
|
8
|
+
accordionHeader: '.accordion__header',
|
|
9
|
+
accordionCollapsed: 'accordion_collapsed',
|
|
10
|
+
},
|
|
11
|
+
handleOutsideClick() {
|
|
12
|
+
document.addEventListener("click", function (event) {
|
|
13
|
+
Wick.HandleAccordions.el.$accordions.each(function () {
|
|
14
|
+
const $accordion = $(this);
|
|
15
|
+
const $content = $accordion.find(Wick.HandleAccordions.el.accordionContent);
|
|
16
|
+
const $toggle = $accordion.find(Wick.HandleAccordions.el.accordionHeader);
|
|
17
|
+
|
|
18
|
+
const toggleButton = $toggle[0];
|
|
19
|
+
const content = $content[0];
|
|
20
|
+
|
|
21
|
+
if (!toggleButton || !content) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (!toggleButton.contains(event.target) && !content.contains(event.target)) {
|
|
26
|
+
if ($content.is(":visible")) {
|
|
27
|
+
$content.hide();
|
|
28
|
+
$accordion.addClass(Wick.HandleAccordions.el.accordionCollapsed);
|
|
29
|
+
$accordion.attr("aria-expanded", "false");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -21,4 +21,18 @@ $(document).ready(function () {
|
|
|
21
21
|
if (navigator.userAgent.match(/TradeProMobile_iOS|TradeProMobile_Android|DIYMobile_iOS|DIYMobile_Android/i)) {
|
|
22
22
|
$('body').addClass('tp-app');
|
|
23
23
|
}
|
|
24
|
-
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
$(function() {
|
|
27
|
+
if (Wick.isTradeProAndroid) {
|
|
28
|
+
$('body').addClass('tp-android');
|
|
29
|
+
}
|
|
30
|
+
if (Wick.isTradeProiOS) {
|
|
31
|
+
$('body').addClass('tp-ios');
|
|
32
|
+
if (
|
|
33
|
+
window.matchMedia('(min-width: 768px)').matches
|
|
34
|
+
) {
|
|
35
|
+
$('body').addClass('tp-ios-notch');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
@@ -124,7 +124,7 @@ Wick.VatToggle = {
|
|
|
124
124
|
|
|
125
125
|
init: function() {
|
|
126
126
|
const isVatShouldBeToggled = Wick.VatToggle.isOn();
|
|
127
|
-
const isVatToggled = Wick.VatToggle.getSwitcherState();
|
|
127
|
+
const isVatToggled = !!Wick.VatToggle.getSwitcherState();
|
|
128
128
|
|
|
129
129
|
if(isVatShouldBeToggled) {
|
|
130
130
|
Wick.VatToggle.setLabelState();
|
|
@@ -26,15 +26,54 @@ Wick.LeaveEvent = {
|
|
|
26
26
|
const currentState = Wick.LeaveEvent.getState(form);
|
|
27
27
|
const isDifferent = !_.isEqual(currentState, Wick.LeaveEvent.initialFormState);
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
const csrfTokenCheck = Wick.LeaveEvent.isCsrfTokenEqual(currentState, Wick.LeaveEvent.initialFormState);
|
|
30
|
+
|
|
31
|
+
if (isDifferent && (csrfTokenCheck || csrfTokenCheck === undefined)) {
|
|
30
32
|
return Wick.LeaveEvent.LEAVE_MESSAGE;
|
|
31
33
|
}
|
|
32
34
|
},
|
|
35
|
+
isCsrfTokenEqual(currentState, initialFormState) {
|
|
36
|
+
const csrfTokenCurrentState = currentState.find(item => item.name === 'CSRFToken')?.value;
|
|
37
|
+
const csrfTokenNewState = initialFormState.find(item => item.name === 'CSRFToken')?.value;
|
|
38
|
+
|
|
39
|
+
return csrfTokenCurrentState === csrfTokenNewState;
|
|
40
|
+
},
|
|
33
41
|
showCustomModal() {
|
|
34
42
|
$(Wick.LeaveEvent.el.leavePopup).modal('show')
|
|
35
43
|
},
|
|
36
44
|
getState(form) {
|
|
37
|
-
|
|
45
|
+
let arrForm = $(form).serializeArray();
|
|
46
|
+
arrForm = Wick.LeaveEvent.processSerializedArr(arrForm, form);
|
|
47
|
+
return arrForm;
|
|
48
|
+
},
|
|
49
|
+
processSerializedArr(arrForm, form) {
|
|
50
|
+
arrForm = arrForm.map((item) => {
|
|
51
|
+
let element = $(form).find(`[name="${item.name}"]`);
|
|
52
|
+
|
|
53
|
+
if (element.attr("data-tag")) {
|
|
54
|
+
let dataTagValue = element.attr("data-tag");
|
|
55
|
+
let similarElements = $(form).find(`[data-tag="${dataTagValue}"]`);
|
|
56
|
+
let hiddenElement = similarElements.filter(`[type="hidden"]`);
|
|
57
|
+
|
|
58
|
+
if (hiddenElement.length) {
|
|
59
|
+
let previousElement = similarElements.not(`[type="hidden"]`);
|
|
60
|
+
let previousValue = previousElement.val();
|
|
61
|
+
item.value = hiddenElement.val();
|
|
62
|
+
item.text = previousValue;
|
|
63
|
+
}
|
|
64
|
+
} else if (element.prop("tagName").toLowerCase() === "select") {
|
|
65
|
+
item.value = element.find("option:selected").val();
|
|
66
|
+
item.text = element.find("option:selected").text();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (item.name === "email" && item.value) {
|
|
70
|
+
item.value = item.value.toLowerCase();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return item;
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return arrForm;
|
|
38
77
|
},
|
|
39
78
|
checkLeavePopup() {
|
|
40
79
|
if (Wick.LeaveEvent.proceedBrowserLeave) {
|
|
@@ -43,7 +43,7 @@ Wick.BasketData = (function () {
|
|
|
43
43
|
"status": 400,
|
|
44
44
|
"responseJSON": {
|
|
45
45
|
"globalMessage": {
|
|
46
|
-
"message": "Delivery is already free
|
|
46
|
+
"message": "Delivery is already free.\nCoupon can’t be applied."
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
},
|
|
@@ -444,7 +444,7 @@ Wick.BasketData = (function () {
|
|
|
444
444
|
"appliedOrderPromotions": [],
|
|
445
445
|
"promotionsInfo": null,
|
|
446
446
|
"clickAndCollectOnly": true,
|
|
447
|
-
"deliveryItemsQuantity":
|
|
447
|
+
"deliveryItemsQuantity": 1,
|
|
448
448
|
"pickupItemsQuantity": 2,
|
|
449
449
|
"freeDelivery": false,
|
|
450
450
|
"subtotalWithoutCharity": {"value": 19.0, "formattedValue": "£19.00", "currencyIso": "GBP", "formattedPriceWithoutCurrencySymbol": "19.00"},
|
|
@@ -48,7 +48,6 @@ Wick.BigWinsProto = function () {
|
|
|
48
48
|
$defaultInfo: $('.default-store__det'),
|
|
49
49
|
$store: $('.store'),
|
|
50
50
|
$chosenItem: $('.chosen__item'),
|
|
51
|
-
$storeAct: $('.store__act'),
|
|
52
51
|
$storeCount: $('.store__count'),
|
|
53
52
|
$stockList: $('.stock__list'),
|
|
54
53
|
$stockTarget: $('.stock__target'),
|
|
@@ -64,7 +63,6 @@ Wick.BigWinsProto = function () {
|
|
|
64
63
|
$findStore: $('.my-account_find-store'),
|
|
65
64
|
$postCodeErrorMsg: $('.stock__postcode_invalid-msg'),
|
|
66
65
|
$ccOrder: $('.cc-order'),
|
|
67
|
-
storeAct: 'store__act',
|
|
68
66
|
storeState: 'store__state',
|
|
69
67
|
storeCount: '.store__count',
|
|
70
68
|
ccBtn: '.bw__cc-btn',
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
var Wick = Wick || {};
|
|
2
|
+
Wick.DefaultStoreProto = {
|
|
3
|
+
el: {
|
|
4
|
+
searchStoreForm: '.search-store',
|
|
5
|
+
$searchStoreWrapInput: $('.search-store__input'),
|
|
6
|
+
searchStoreErrorClass: 'search-store__input-error',
|
|
7
|
+
searchStoreInput: '.search-store #postcode',
|
|
8
|
+
$searchStoreError: $('.form-row__error'),
|
|
9
|
+
$storeUnavailableSection: $('.store-unavailable'),
|
|
10
|
+
$listOfStoreForm: $('.list-of-store'),
|
|
11
|
+
btnCancel: '.my-account_cancel-store',
|
|
12
|
+
btnLocation: '.btn--location',
|
|
13
|
+
iconLocation: '.btn--location .icon',
|
|
14
|
+
errorIconLocation: '.btn--location .icon-error',
|
|
15
|
+
$bigWins: $('.bw'),
|
|
16
|
+
$bwActions: $('.bw_act'),
|
|
17
|
+
$sDetails: $('.s-details_hide'),
|
|
18
|
+
sDetailsHide: 's-details_hide',
|
|
19
|
+
$storeMoreLink: $('.store__more a'),
|
|
20
|
+
},
|
|
21
|
+
showStoreList() {
|
|
22
|
+
Wick.DefaultStoreProto.el.$searchStoreError.hide();
|
|
23
|
+
Wick.DefaultStoreProto.el.$storeUnavailableSection.hide();
|
|
24
|
+
Wick.DefaultStoreProto.el.$listOfStoreForm.show();
|
|
25
|
+
Wick.DefaultStoreProto.el.$searchStoreWrapInput.removeClass(Wick.DefaultStoreProto.el.searchStoreErrorClass);
|
|
26
|
+
|
|
27
|
+
if (Wick.DefaultStoreProto.el.$bigWins.css('display') === 'none') {
|
|
28
|
+
Wick.DefaultStoreProto.el.$bigWins.show();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (Wick.DefaultStoreProto.el.$bwActions.css('display') === 'none') {
|
|
32
|
+
Wick.DefaultStoreProto.el.$bwActions.show();
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
showErrorState() {
|
|
36
|
+
Wick.DefaultStoreProto.el.$searchStoreError.show();
|
|
37
|
+
Wick.DefaultStoreProto.el.$storeUnavailableSection.show();
|
|
38
|
+
Wick.DefaultStoreProto.el.$listOfStoreForm.hide();
|
|
39
|
+
Wick.DefaultStoreProto.el.$searchStoreWrapInput.addClass(Wick.DefaultStoreProto.el.searchStoreErrorClass);
|
|
40
|
+
},
|
|
41
|
+
showUnavailableState() {
|
|
42
|
+
Wick.DefaultStoreProto.el.$storeUnavailableSection.show();
|
|
43
|
+
Wick.DefaultStoreProto.el.$listOfStoreForm.hide();
|
|
44
|
+
|
|
45
|
+
Wick.DefaultStoreProto.el.$sDetails.filter(function () {
|
|
46
|
+
let isNotElementHide = !$(this).hasClass(Wick.DefaultStoreProto.el.sDetailsHide);
|
|
47
|
+
|
|
48
|
+
if (isNotElementHide) {
|
|
49
|
+
$(this)
|
|
50
|
+
.closest(Wick.DefaultStoreProto.el.$bigWins)
|
|
51
|
+
.find(Wick.DefaultStoreProto.el.$storeMoreLink)
|
|
52
|
+
.text('Store Info');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return isNotElementHide;
|
|
56
|
+
}).addClass(Wick.DefaultStoreProto.el.sDetailsHide);
|
|
57
|
+
},
|
|
58
|
+
clearSearchInput() {
|
|
59
|
+
$(Wick.DefaultStoreProto.el.searchStoreInput).val('');
|
|
60
|
+
Wick.DefaultStore.checkVisibilityOfClearButton();
|
|
61
|
+
},
|
|
62
|
+
toggleErrorStateForLocation() {
|
|
63
|
+
const iconIsVisible = $(Wick.DefaultStoreProto.el.iconLocation).is(':visible');
|
|
64
|
+
|
|
65
|
+
if (iconIsVisible) {
|
|
66
|
+
$(Wick.DefaultStoreProto.el.iconLocation).hide();
|
|
67
|
+
$(Wick.DefaultStoreProto.el.errorIconLocation).show();
|
|
68
|
+
} else {
|
|
69
|
+
$(Wick.DefaultStoreProto.el.iconLocation).show();
|
|
70
|
+
$(Wick.DefaultStoreProto.el.errorIconLocation).hide();
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
init() {
|
|
74
|
+
$(Wick.DefaultStoreProto.el.searchStoreForm).on('submit', (event) => {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
const value = Wick.DefaultStore.getPostCode();
|
|
77
|
+
if (value.length) {
|
|
78
|
+
Wick.DefaultStoreProto.showStoreList();
|
|
79
|
+
} else {
|
|
80
|
+
Wick.DefaultStoreProto.showErrorState();
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
$(Wick.DefaultStoreProto.el.btnCancel).on('click', (event) => {
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
Wick.DefaultStoreProto.clearSearchInput();
|
|
86
|
+
Wick.DefaultStoreProto.showUnavailableState();
|
|
87
|
+
})
|
|
88
|
+
$(Wick.DefaultStoreProto.el.btnLocation).on('click', (event) => {
|
|
89
|
+
event.preventDefault();
|
|
90
|
+
Wick.DefaultStoreProto.toggleErrorStateForLocation();
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
$(document).ready(function () {
|
|
96
|
+
Wick.DefaultStoreProto.init();
|
|
97
|
+
});
|
|
@@ -5,7 +5,7 @@ Wick.Forms = (function(){
|
|
|
5
5
|
fieldError = '.form-row__error',
|
|
6
6
|
formInvalid = 'form_invalid',
|
|
7
7
|
rowValidationError = 'form-row_validation-error',
|
|
8
|
-
excludedClassesForForm = ['header', 'quiz-modal__form'],
|
|
8
|
+
excludedClassesForForm = ['header', 'quiz-modal__form', 'search-store'],
|
|
9
9
|
// validationError = '<div class="form-row__error">Error message here</div>',
|
|
10
10
|
$forgotPassword = $('.link-forgot-password'),
|
|
11
11
|
scenarios = [{
|