@ordergroove/offers 2.48.1 → 2.48.2-alpha-PR-1444-2.310

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ordergroove/offers",
3
- "version": "2.48.1",
3
+ "version": "2.48.2-alpha-PR-1444-2.310+fd36ffa23",
4
4
  "description": "offer state component",
5
5
  "author": "Eugenio Lattanzio <eugenio63@gmail.com>",
6
6
  "homepage": "https://github.com/ordergroove/plush-toys#readme",
@@ -46,8 +46,8 @@
46
46
  "throttle-debounce": "^2.1.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@ordergroove/offers-templates": "^0.10.0",
49
+ "@ordergroove/offers-templates": "^0.10.1-alpha-PR-1444-2.766+fd36ffa23",
50
50
  "@types/lodash.memoize": "^4.1.9"
51
51
  },
52
- "gitHead": "1bae47be7eb0c5cc01f719fdba66b3fe903024df"
52
+ "gitHead": "fd36ffa23e85242d2a36ec8b236156164a6019b5"
53
53
  }
@@ -13,7 +13,9 @@ export class OptinSelect extends withChildOptions(OptinStatus) {
13
13
  ...super.properties,
14
14
  frequencies: { type: Array, attribute: false },
15
15
  frequency: { type: String },
16
- defaultFrequency
16
+ defaultFrequency,
17
+ /* The label used for the underlying select. */
18
+ selectLabel: { type: String, attribute: 'select-label' }
17
19
  };
18
20
  }
19
21
 
@@ -69,6 +71,7 @@ export class OptinSelect extends withChildOptions(OptinStatus) {
69
71
  .options="${options}"
70
72
  .selected="${this.currentFrequency}"
71
73
  .onChange="${({ target: { value } }) => this.onOptinChange(value)}"
74
+ .ariaLabel="${this.selectLabel}"
72
75
  ></og-select>
73
76
  `;
74
77
  }
@@ -18,7 +18,9 @@ export class PrepaidSelect extends PrepaidStatus {
18
18
  static get properties() {
19
19
  return {
20
20
  ...super.properties,
21
- text: { type: String }
21
+ text: { type: String },
22
+ /* The label used for the underlying select. */
23
+ selectLabel: { type: String, attribute: 'select-label' }
22
24
  };
23
25
  }
24
26
 
@@ -53,6 +55,7 @@ export class PrepaidSelect extends PrepaidStatus {
53
55
  .options=${displayOptions}
54
56
  .selected=${this.selectedNumberOfShipments}
55
57
  .onChange="${e => this.handleSelect(e)}"
58
+ .ariaLabel="${this.selectLabel}"
56
59
  ></og-select>
57
60
  `
58
61
  : html`
@@ -1,4 +1,5 @@
1
1
  import { LitElement, css, html } from 'lit-element';
2
+ import { ifDefined } from 'lit-html/directives/if-defined.js';
2
3
 
3
4
  export class Select extends LitElement {
4
5
  static get styles() {
@@ -61,6 +62,9 @@ export class Select extends LitElement {
61
62
  return {
62
63
  options: { type: Array },
63
64
  selected: { type: String },
65
+ // we intentionally don't convert from the "aria-label" attribute here
66
+ // since if we set that on the element, we are also assigning a label to the wraper <og-select> element which can cause screen readers to read out the same text twice
67
+ // https://github.com/WICG/webcomponents/issues/1073
64
68
  ariaLabel: { type: String }
65
69
  };
66
70
  }
@@ -68,7 +72,7 @@ export class Select extends LitElement {
68
72
  render() {
69
73
  const handleOnChange = ev => this.onChange(ev);
70
74
  return html`
71
- <select @change="${handleOnChange}" aria-label="${this.ariaLabel}">
75
+ <select @change="${handleOnChange}" aria-label="${ifDefined(this.ariaLabel)}">
72
76
  ${this.options.map(
73
77
  option => html`
74
78
  <option
@@ -127,7 +127,7 @@ export class SelectFrequency extends withChildOptions(FrequencyStatus) {
127
127
 
128
128
  return html`
129
129
  <og-select
130
- ariaLabel="Delivery frequency"
130
+ .ariaLabel="Delivery frequency"
131
131
  .options="${options}"
132
132
  .selected="${this.currentFrequency}"
133
133
  .onChange="${({ target: { value } }) => {