@ordergroove/offers 2.34.2-alpha-PR-756-1.63 → 2.34.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/CHANGELOG.md +11 -0
- package/dist/bundle-report.html +7 -7
- package/dist/offers.js +8 -7
- package/dist/offers.js.map +2 -2
- package/package.json +2 -2
- package/src/components/OptinButton.js +2 -2
- package/src/components/OptoutButton.js +2 -2
- package/src/components/Select.js +3 -2
- package/src/components/SelectFrequency.js +1 -0
- package/src/shopify/shopifyMiddleware.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordergroove/offers",
|
|
3
|
-
"version": "2.34.2
|
|
3
|
+
"version": "2.34.2",
|
|
4
4
|
"description": "offer state component",
|
|
5
5
|
"author": "Eugenio Lattanzio <eugenio63@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ordergroove/plush-toys#readme",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@ordergroove/offers-templates": "^0.9.1"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "8c58a6749f57037290ecc6fa52f44dde8c8f57a1"
|
|
51
51
|
}
|
|
@@ -54,8 +54,8 @@ export class OptinButton extends OptinStatus {
|
|
|
54
54
|
render() {
|
|
55
55
|
return html`
|
|
56
56
|
<slot name="default">
|
|
57
|
-
<button
|
|
58
|
-
<label
|
|
57
|
+
<button aria-labelledby="ogOfferOptInLabel" class="btn radio ${this.subscribed ? 'active' : ''}"></button>
|
|
58
|
+
<label id="ogOfferOptInLabel">
|
|
59
59
|
<slot>
|
|
60
60
|
<slot name="label"><og-text key="offerOptInLabel"></og-text></slot>
|
|
61
61
|
</slot>
|
|
@@ -19,8 +19,8 @@ export class OptoutButton extends OptinStatus {
|
|
|
19
19
|
render() {
|
|
20
20
|
return html`
|
|
21
21
|
<slot name="default">
|
|
22
|
-
<button
|
|
23
|
-
<label
|
|
22
|
+
<button aria-labelledby="ogOfferOptOutLabel" class="btn radio ${this.subscribed ? '' : 'active'}"></button>
|
|
23
|
+
<label id="ogOfferOptOutLabel">
|
|
24
24
|
<slot>
|
|
25
25
|
<og-text key="offerOptOutLabel"></og-text>
|
|
26
26
|
</slot>
|
package/src/components/Select.js
CHANGED
|
@@ -60,14 +60,15 @@ export class Select extends LitElement {
|
|
|
60
60
|
static get properties() {
|
|
61
61
|
return {
|
|
62
62
|
options: { type: Array },
|
|
63
|
-
selected: { type: String }
|
|
63
|
+
selected: { type: String },
|
|
64
|
+
ariaLabel: { type: String }
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
render() {
|
|
68
69
|
const handleOnChange = ev => this.onChange(ev);
|
|
69
70
|
return html`
|
|
70
|
-
<select @change="${handleOnChange}">
|
|
71
|
+
<select @change="${handleOnChange}" aria-label="${this.ariaLabel}">
|
|
71
72
|
${this.options.map(
|
|
72
73
|
option => html`
|
|
73
74
|
<option
|
|
@@ -123,6 +123,7 @@ export class SelectFrequency extends withChildOptions(FrequencyStatus) {
|
|
|
123
123
|
|
|
124
124
|
return html`
|
|
125
125
|
<og-select
|
|
126
|
+
ariaLabel="Delivery frequency"
|
|
126
127
|
.options="${options}"
|
|
127
128
|
.selected="${this.currentFrequency}"
|
|
128
129
|
.onChange="${({ target: { value } }) => {
|
|
@@ -316,6 +316,8 @@ export function getSubscribedFrequency(productId, store) {
|
|
|
316
316
|
* @param store
|
|
317
317
|
*/
|
|
318
318
|
function synchronizeSellingPlan(store: any, offerElement?: HTMLElement) {
|
|
319
|
+
if (offerElement.isCart) return; // hidden inputs are used when product page, not cart.
|
|
320
|
+
|
|
319
321
|
[...document.querySelectorAll('form[action$="/cart/add"] [name=id]')].forEach((productIdInput: HTMLInputElement) => {
|
|
320
322
|
const productId = productIdInput.value;
|
|
321
323
|
|