@ionic/core 7.5.8-dev.11701293337.112ba209 → 7.5.8-dev.11701374238.101cd738

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.
Files changed (67) hide show
  1. package/components/action-sheet.js +10 -0
  2. package/components/alert.js +10 -0
  3. package/components/ion-datetime.js +16 -25
  4. package/components/ion-loading.js +10 -0
  5. package/components/ion-modal.js +10 -0
  6. package/components/ion-picker.js +10 -0
  7. package/components/ion-toast.js +10 -0
  8. package/components/popover.js +10 -0
  9. package/dist/cjs/ion-action-sheet.cjs.entry.js +10 -0
  10. package/dist/cjs/ion-alert.cjs.entry.js +10 -0
  11. package/dist/cjs/ion-datetime_3.cjs.entry.js +26 -25
  12. package/dist/cjs/ion-loading.cjs.entry.js +10 -0
  13. package/dist/cjs/ion-modal.cjs.entry.js +10 -0
  14. package/dist/cjs/ion-popover.cjs.entry.js +10 -0
  15. package/dist/cjs/ion-toast.cjs.entry.js +10 -0
  16. package/dist/collection/components/action-sheet/action-sheet.js +10 -0
  17. package/dist/collection/components/alert/alert.js +10 -0
  18. package/dist/collection/components/datetime/datetime.js +16 -25
  19. package/dist/collection/components/datetime/test/set-value/datetime.e2e.js +0 -15
  20. package/dist/collection/components/loading/loading.js +10 -0
  21. package/dist/collection/components/modal/modal.js +10 -0
  22. package/dist/collection/components/picker/picker.js +10 -0
  23. package/dist/collection/components/popover/popover.js +10 -0
  24. package/dist/collection/components/toast/toast.js +10 -0
  25. package/dist/collection/utils/test/playwright/generator.js +28 -5
  26. package/dist/collection/utils/test/playwright/page/utils/set-content.js +8 -0
  27. package/dist/docs.json +1 -1
  28. package/dist/esm/ion-action-sheet.entry.js +10 -0
  29. package/dist/esm/ion-alert.entry.js +10 -0
  30. package/dist/esm/ion-datetime_3.entry.js +26 -25
  31. package/dist/esm/ion-loading.entry.js +10 -0
  32. package/dist/esm/ion-modal.entry.js +10 -0
  33. package/dist/esm/ion-popover.entry.js +10 -0
  34. package/dist/esm/ion-toast.entry.js +10 -0
  35. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  36. package/dist/esm-es5/ion-alert.entry.js +1 -1
  37. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  38. package/dist/esm-es5/ion-loading.entry.js +1 -1
  39. package/dist/esm-es5/ion-modal.entry.js +1 -1
  40. package/dist/esm-es5/ion-popover.entry.js +1 -1
  41. package/dist/esm-es5/ion-toast.entry.js +1 -1
  42. package/dist/ionic/ionic.esm.js +1 -1
  43. package/dist/ionic/{p-d9e5e5e6.system.entry.js → p-0827d00e.system.entry.js} +1 -1
  44. package/dist/ionic/p-27e6473f.entry.js +4 -0
  45. package/dist/ionic/p-33f3cd49.entry.js +4 -0
  46. package/dist/ionic/{p-b614392e.system.entry.js → p-41f7af3f.system.entry.js} +1 -1
  47. package/dist/ionic/p-46dbd723.entry.js +4 -0
  48. package/dist/ionic/{p-1a6ec317.system.entry.js → p-57c0d5bf.system.entry.js} +1 -1
  49. package/dist/ionic/p-742e11cf.system.entry.js +4 -0
  50. package/dist/ionic/{p-4b04acbc.system.entry.js → p-83fada9e.system.entry.js} +1 -1
  51. package/dist/ionic/p-a1b4dba7.entry.js +4 -0
  52. package/dist/ionic/{p-29ed6c32.entry.js → p-b11ceee2.entry.js} +1 -1
  53. package/dist/ionic/{p-10b4b6f7.system.entry.js → p-b5e33ebc.system.entry.js} +1 -1
  54. package/dist/ionic/{p-f094b8e8.system.entry.js → p-bc97b5cd.system.entry.js} +1 -1
  55. package/dist/ionic/p-c5ae50be.system.js +1 -1
  56. package/dist/ionic/p-d1530ea9.entry.js +4 -0
  57. package/dist/ionic/p-f444fea5.entry.js +4 -0
  58. package/dist/types/utils/test/playwright/generator.d.ts +9 -0
  59. package/hydrate/index.js +86 -25
  60. package/package.json +1 -1
  61. package/dist/ionic/p-17fc5d75.entry.js +0 -4
  62. package/dist/ionic/p-80874516.system.entry.js +0 -4
  63. package/dist/ionic/p-94af06eb.entry.js +0 -4
  64. package/dist/ionic/p-a07ce93b.entry.js +0 -4
  65. package/dist/ionic/p-c40d5610.entry.js +0 -4
  66. package/dist/ionic/p-d51bae0c.entry.js +0 -4
  67. package/dist/ionic/p-dfd7d5ee.entry.js +0 -4
@@ -265,6 +265,16 @@ const ActionSheet = /*@__PURE__*/ proxyCustomElement(class ActionSheet extends H
265
265
  if (this.isOpen === true) {
266
266
  raf(() => this.present());
267
267
  }
268
+ /**
269
+ * When binding values in frameworks such as Angular
270
+ * it is possible for the value to be set after the Web Component
271
+ * initializes but before the value watcher is set up in Stencil.
272
+ * As a result, the watcher callback may not be fired.
273
+ * We work around this by manually calling the watcher
274
+ * callback when the component has loaded and the watcher
275
+ * is configured.
276
+ */
277
+ this.triggerChanged();
268
278
  }
269
279
  render() {
270
280
  const { header, htmlAttributes, overlayIndex } = this;
@@ -285,6 +285,16 @@ const Alert = /*@__PURE__*/ proxyCustomElement(class Alert extends HTMLElement {
285
285
  if (this.isOpen === true) {
286
286
  raf(() => this.present());
287
287
  }
288
+ /**
289
+ * When binding values in frameworks such as Angular
290
+ * it is possible for the value to be set after the Web Component
291
+ * initializes but before the value watcher is set up in Stencil.
292
+ * As a result, the watcher callback may not be fired.
293
+ * We work around this by manually calling the watcher
294
+ * callback when the component has loaded and the watcher
295
+ * is configured.
296
+ */
297
+ this.triggerChanged();
288
298
  }
289
299
  /**
290
300
  * Present the alert overlay after it has been created.
@@ -689,31 +689,22 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
689
689
  const didChangeMonth = (month !== undefined && month !== workingParts.month) || (year !== undefined && year !== workingParts.year);
690
690
  const bodyIsVisible = el.classList.contains('datetime-ready');
691
691
  const { isGridStyle, showMonthAndYear } = this;
692
- const hasSingleDateSelected = Array.isArray(valueToProcess) ? valueToProcess.length === 1 : true;
693
- /**
694
- * If there is more than one date selected
695
- * then we should neither animate to the date
696
- * nor update the working parts because we do
697
- * not know which date the user wants to view.
698
- */
699
- if (hasSingleDateSelected) {
700
- if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
701
- this.animateToDate(targetValue);
702
- }
703
- else {
704
- /**
705
- * We only need to do this if we didn't just animate to a new month,
706
- * since that calls prevMonth/nextMonth which calls setWorkingParts for us.
707
- */
708
- this.setWorkingParts({
709
- month,
710
- day,
711
- year,
712
- hour,
713
- minute,
714
- ampm,
715
- });
716
- }
692
+ if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
693
+ this.animateToDate(targetValue);
694
+ }
695
+ else {
696
+ /**
697
+ * We only need to do this if we didn't just animate to a new month,
698
+ * since that calls prevMonth/nextMonth which calls setWorkingParts for us.
699
+ */
700
+ this.setWorkingParts({
701
+ month,
702
+ day,
703
+ year,
704
+ hour,
705
+ minute,
706
+ ampm,
707
+ });
717
708
  }
718
709
  };
719
710
  this.animateToDate = async (targetValue) => {
@@ -175,6 +175,16 @@ const Loading = /*@__PURE__*/ proxyCustomElement(class Loading extends HTMLEleme
175
175
  if (this.isOpen === true) {
176
176
  raf(() => this.present());
177
177
  }
178
+ /**
179
+ * When binding values in frameworks such as Angular
180
+ * it is possible for the value to be set after the Web Component
181
+ * initializes but before the value watcher is set up in Stencil.
182
+ * As a result, the watcher callback may not be fired.
183
+ * We work around this by manually calling the watcher
184
+ * callback when the component has loaded and the watcher
185
+ * is configured.
186
+ */
187
+ this.triggerChanged();
178
188
  }
179
189
  disconnectedCallback() {
180
190
  this.triggerController.removeClickListener();
@@ -1232,6 +1232,16 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1232
1232
  raf(() => this.present());
1233
1233
  }
1234
1234
  this.breakpointsChanged(this.breakpoints);
1235
+ /**
1236
+ * When binding values in frameworks such as Angular
1237
+ * it is possible for the value to be set after the Web Component
1238
+ * initializes but before the value watcher is set up in Stencil.
1239
+ * As a result, the watcher callback may not be fired.
1240
+ * We work around this by manually calling the watcher
1241
+ * callback when the component has loaded and the watcher
1242
+ * is configured.
1243
+ */
1244
+ this.triggerChanged();
1235
1245
  }
1236
1246
  /**
1237
1247
  * Determines whether or not an overlay
@@ -134,6 +134,16 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class Picker extends HTMLElement
134
134
  if (this.isOpen === true) {
135
135
  raf(() => this.present());
136
136
  }
137
+ /**
138
+ * When binding values in frameworks such as Angular
139
+ * it is possible for the value to be set after the Web Component
140
+ * initializes but before the value watcher is set up in Stencil.
141
+ * As a result, the watcher callback may not be fired.
142
+ * We work around this by manually calling the watcher
143
+ * callback when the component has loaded and the watcher
144
+ * is configured.
145
+ */
146
+ this.triggerChanged();
137
147
  }
138
148
  /**
139
149
  * Present the picker overlay after it has been created.
@@ -269,6 +269,16 @@ const Toast = /*@__PURE__*/ proxyCustomElement(class Toast extends HTMLElement {
269
269
  if (this.isOpen === true) {
270
270
  raf(() => this.present());
271
271
  }
272
+ /**
273
+ * When binding values in frameworks such as Angular
274
+ * it is possible for the value to be set after the Web Component
275
+ * initializes but before the value watcher is set up in Stencil.
276
+ * As a result, the watcher callback may not be fired.
277
+ * We work around this by manually calling the watcher
278
+ * callback when the component has loaded and the watcher
279
+ * is configured.
280
+ */
281
+ this.triggerChanged();
272
282
  }
273
283
  /**
274
284
  * Present the toast overlay after it has been created.
@@ -1107,6 +1107,16 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1107
1107
  this.dismiss(undefined, undefined, false);
1108
1108
  });
1109
1109
  }
1110
+ /**
1111
+ * When binding values in frameworks such as Angular
1112
+ * it is possible for the value to be set after the Web Component
1113
+ * initializes but before the value watcher is set up in Stencil.
1114
+ * As a result, the watcher callback may not be fired.
1115
+ * We work around this by manually calling the watcher
1116
+ * callback when the component has loaded and the watcher
1117
+ * is configured.
1118
+ */
1119
+ this.configureTriggerInteraction();
1110
1120
  }
1111
1121
  /**
1112
1122
  * When opening a popover from a trigger, we should not be
@@ -273,6 +273,16 @@ const ActionSheet = class {
273
273
  if (this.isOpen === true) {
274
274
  helpers.raf(() => this.present());
275
275
  }
276
+ /**
277
+ * When binding values in frameworks such as Angular
278
+ * it is possible for the value to be set after the Web Component
279
+ * initializes but before the value watcher is set up in Stencil.
280
+ * As a result, the watcher callback may not be fired.
281
+ * We work around this by manually calling the watcher
282
+ * callback when the component has loaded and the watcher
283
+ * is configured.
284
+ */
285
+ this.triggerChanged();
276
286
  }
277
287
  render() {
278
288
  const { header, htmlAttributes, overlayIndex } = this;
@@ -294,6 +294,16 @@ const Alert = class {
294
294
  if (this.isOpen === true) {
295
295
  helpers.raf(() => this.present());
296
296
  }
297
+ /**
298
+ * When binding values in frameworks such as Angular
299
+ * it is possible for the value to be set after the Web Component
300
+ * initializes but before the value watcher is set up in Stencil.
301
+ * As a result, the watcher callback may not be fired.
302
+ * We work around this by manually calling the watcher
303
+ * callback when the component has loaded and the watcher
304
+ * is configured.
305
+ */
306
+ this.triggerChanged();
297
307
  }
298
308
  /**
299
309
  * Present the alert overlay after it has been created.
@@ -688,31 +688,22 @@ const Datetime = class {
688
688
  const didChangeMonth = (month !== undefined && month !== workingParts.month) || (year !== undefined && year !== workingParts.year);
689
689
  const bodyIsVisible = el.classList.contains('datetime-ready');
690
690
  const { isGridStyle, showMonthAndYear } = this;
691
- const hasSingleDateSelected = Array.isArray(valueToProcess) ? valueToProcess.length === 1 : true;
692
- /**
693
- * If there is more than one date selected
694
- * then we should neither animate to the date
695
- * nor update the working parts because we do
696
- * not know which date the user wants to view.
697
- */
698
- if (hasSingleDateSelected) {
699
- if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
700
- this.animateToDate(targetValue);
701
- }
702
- else {
703
- /**
704
- * We only need to do this if we didn't just animate to a new month,
705
- * since that calls prevMonth/nextMonth which calls setWorkingParts for us.
706
- */
707
- this.setWorkingParts({
708
- month,
709
- day,
710
- year,
711
- hour,
712
- minute,
713
- ampm,
714
- });
715
- }
691
+ if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
692
+ this.animateToDate(targetValue);
693
+ }
694
+ else {
695
+ /**
696
+ * We only need to do this if we didn't just animate to a new month,
697
+ * since that calls prevMonth/nextMonth which calls setWorkingParts for us.
698
+ */
699
+ this.setWorkingParts({
700
+ month,
701
+ day,
702
+ year,
703
+ hour,
704
+ minute,
705
+ ampm,
706
+ });
716
707
  }
717
708
  };
718
709
  this.animateToDate = async (targetValue) => {
@@ -1879,6 +1870,16 @@ const Picker = class {
1879
1870
  if (this.isOpen === true) {
1880
1871
  helpers.raf(() => this.present());
1881
1872
  }
1873
+ /**
1874
+ * When binding values in frameworks such as Angular
1875
+ * it is possible for the value to be set after the Web Component
1876
+ * initializes but before the value watcher is set up in Stencil.
1877
+ * As a result, the watcher callback may not be fired.
1878
+ * We work around this by manually calling the watcher
1879
+ * callback when the component has loaded and the watcher
1880
+ * is configured.
1881
+ */
1882
+ this.triggerChanged();
1882
1883
  }
1883
1884
  /**
1884
1885
  * Present the picker overlay after it has been created.
@@ -180,6 +180,16 @@ const Loading = class {
180
180
  if (this.isOpen === true) {
181
181
  helpers.raf(() => this.present());
182
182
  }
183
+ /**
184
+ * When binding values in frameworks such as Angular
185
+ * it is possible for the value to be set after the Web Component
186
+ * initializes but before the value watcher is set up in Stencil.
187
+ * As a result, the watcher callback may not be fired.
188
+ * We work around this by manually calling the watcher
189
+ * callback when the component has loaded and the watcher
190
+ * is configured.
191
+ */
192
+ this.triggerChanged();
183
193
  }
184
194
  disconnectedCallback() {
185
195
  this.triggerController.removeClickListener();
@@ -1236,6 +1236,16 @@ const Modal = class {
1236
1236
  helpers.raf(() => this.present());
1237
1237
  }
1238
1238
  this.breakpointsChanged(this.breakpoints);
1239
+ /**
1240
+ * When binding values in frameworks such as Angular
1241
+ * it is possible for the value to be set after the Web Component
1242
+ * initializes but before the value watcher is set up in Stencil.
1243
+ * As a result, the watcher callback may not be fired.
1244
+ * We work around this by manually calling the watcher
1245
+ * callback when the component has loaded and the watcher
1246
+ * is configured.
1247
+ */
1248
+ this.triggerChanged();
1239
1249
  }
1240
1250
  /**
1241
1251
  * Determines whether or not an overlay
@@ -1110,6 +1110,16 @@ const Popover = class {
1110
1110
  this.dismiss(undefined, undefined, false);
1111
1111
  });
1112
1112
  }
1113
+ /**
1114
+ * When binding values in frameworks such as Angular
1115
+ * it is possible for the value to be set after the Web Component
1116
+ * initializes but before the value watcher is set up in Stencil.
1117
+ * As a result, the watcher callback may not be fired.
1118
+ * We work around this by manually calling the watcher
1119
+ * callback when the component has loaded and the watcher
1120
+ * is configured.
1121
+ */
1122
+ this.configureTriggerInteraction();
1113
1123
  }
1114
1124
  /**
1115
1125
  * When opening a popover from a trigger, we should not be
@@ -271,6 +271,16 @@ const Toast = class {
271
271
  if (this.isOpen === true) {
272
272
  helpers.raf(() => this.present());
273
273
  }
274
+ /**
275
+ * When binding values in frameworks such as Angular
276
+ * it is possible for the value to be set after the Web Component
277
+ * initializes but before the value watcher is set up in Stencil.
278
+ * As a result, the watcher callback may not be fired.
279
+ * We work around this by manually calling the watcher
280
+ * callback when the component has loaded and the watcher
281
+ * is configured.
282
+ */
283
+ this.triggerChanged();
274
284
  }
275
285
  /**
276
286
  * Present the toast overlay after it has been created.
@@ -169,6 +169,16 @@ export class ActionSheet {
169
169
  if (this.isOpen === true) {
170
170
  raf(() => this.present());
171
171
  }
172
+ /**
173
+ * When binding values in frameworks such as Angular
174
+ * it is possible for the value to be set after the Web Component
175
+ * initializes but before the value watcher is set up in Stencil.
176
+ * As a result, the watcher callback may not be fired.
177
+ * We work around this by manually calling the watcher
178
+ * callback when the component has loaded and the watcher
179
+ * is configured.
180
+ */
181
+ this.triggerChanged();
172
182
  }
173
183
  render() {
174
184
  const { header, htmlAttributes, overlayIndex } = this;
@@ -192,6 +192,16 @@ export class Alert {
192
192
  if (this.isOpen === true) {
193
193
  raf(() => this.present());
194
194
  }
195
+ /**
196
+ * When binding values in frameworks such as Angular
197
+ * it is possible for the value to be set after the Web Component
198
+ * initializes but before the value watcher is set up in Stencil.
199
+ * As a result, the watcher callback may not be fired.
200
+ * We work around this by manually calling the watcher
201
+ * callback when the component has loaded and the watcher
202
+ * is configured.
203
+ */
204
+ this.triggerChanged();
195
205
  }
196
206
  /**
197
207
  * Present the alert overlay after it has been created.
@@ -526,31 +526,22 @@ export class Datetime {
526
526
  const didChangeMonth = (month !== undefined && month !== workingParts.month) || (year !== undefined && year !== workingParts.year);
527
527
  const bodyIsVisible = el.classList.contains('datetime-ready');
528
528
  const { isGridStyle, showMonthAndYear } = this;
529
- const hasSingleDateSelected = Array.isArray(valueToProcess) ? valueToProcess.length === 1 : true;
530
- /**
531
- * If there is more than one date selected
532
- * then we should neither animate to the date
533
- * nor update the working parts because we do
534
- * not know which date the user wants to view.
535
- */
536
- if (hasSingleDateSelected) {
537
- if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
538
- this.animateToDate(targetValue);
539
- }
540
- else {
541
- /**
542
- * We only need to do this if we didn't just animate to a new month,
543
- * since that calls prevMonth/nextMonth which calls setWorkingParts for us.
544
- */
545
- this.setWorkingParts({
546
- month,
547
- day,
548
- year,
549
- hour,
550
- minute,
551
- ampm,
552
- });
553
- }
529
+ if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
530
+ this.animateToDate(targetValue);
531
+ }
532
+ else {
533
+ /**
534
+ * We only need to do this if we didn't just animate to a new month,
535
+ * since that calls prevMonth/nextMonth which calls setWorkingParts for us.
536
+ */
537
+ this.setWorkingParts({
538
+ month,
539
+ day,
540
+ year,
541
+ hour,
542
+ minute,
543
+ ampm,
544
+ });
554
545
  }
555
546
  };
556
547
  this.animateToDate = async (targetValue) => {
@@ -46,20 +46,5 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>
46
46
  const calendarHeader = datetime.locator('.calendar-month-year');
47
47
  await expect(calendarHeader).toHaveText(/May 2021/);
48
48
  });
49
- test('should scroll to new month when value is initially set and then updated with multiple selection', async ({ page, }) => {
50
- await page.setContent(`
51
- <ion-datetime multiple="true" presentation="date"></ion-datetime>
52
- <script>
53
- const datetime = document.querySelector('ion-datetime');
54
- datetime.value = ['2021-04-25'];
55
- </script>
56
- `, config);
57
- await page.waitForSelector('.datetime-ready');
58
- const datetime = page.locator('ion-datetime');
59
- await datetime.evaluate((el) => (el.value = '2021-05-25T12:40:00.000Z'));
60
- await page.waitForChanges();
61
- const calendarHeader = datetime.locator('.calendar-month-year');
62
- await expect(calendarHeader).toHaveText(/May 2021/);
63
- });
64
49
  });
65
50
  });
@@ -79,6 +79,16 @@ export class Loading {
79
79
  if (this.isOpen === true) {
80
80
  raf(() => this.present());
81
81
  }
82
+ /**
83
+ * When binding values in frameworks such as Angular
84
+ * it is possible for the value to be set after the Web Component
85
+ * initializes but before the value watcher is set up in Stencil.
86
+ * As a result, the watcher callback may not be fired.
87
+ * We work around this by manually calling the watcher
88
+ * callback when the component has loaded and the watcher
89
+ * is configured.
90
+ */
91
+ this.triggerChanged();
82
92
  }
83
93
  disconnectedCallback() {
84
94
  this.triggerController.removeClickListener();
@@ -151,6 +151,16 @@ export class Modal {
151
151
  raf(() => this.present());
152
152
  }
153
153
  this.breakpointsChanged(this.breakpoints);
154
+ /**
155
+ * When binding values in frameworks such as Angular
156
+ * it is possible for the value to be set after the Web Component
157
+ * initializes but before the value watcher is set up in Stencil.
158
+ * As a result, the watcher callback may not be fired.
159
+ * We work around this by manually calling the watcher
160
+ * callback when the component has loaded and the watcher
161
+ * is configured.
162
+ */
163
+ this.triggerChanged();
154
164
  }
155
165
  /**
156
166
  * Determines whether or not an overlay
@@ -78,6 +78,16 @@ export class Picker {
78
78
  if (this.isOpen === true) {
79
79
  raf(() => this.present());
80
80
  }
81
+ /**
82
+ * When binding values in frameworks such as Angular
83
+ * it is possible for the value to be set after the Web Component
84
+ * initializes but before the value watcher is set up in Stencil.
85
+ * As a result, the watcher callback may not be fired.
86
+ * We work around this by manually calling the watcher
87
+ * callback when the component has loaded and the watcher
88
+ * is configured.
89
+ */
90
+ this.triggerChanged();
81
91
  }
82
92
  /**
83
93
  * Present the picker overlay after it has been created.
@@ -152,6 +152,16 @@ export class Popover {
152
152
  this.dismiss(undefined, undefined, false);
153
153
  });
154
154
  }
155
+ /**
156
+ * When binding values in frameworks such as Angular
157
+ * it is possible for the value to be set after the Web Component
158
+ * initializes but before the value watcher is set up in Stencil.
159
+ * As a result, the watcher callback may not be fired.
160
+ * We work around this by manually calling the watcher
161
+ * callback when the component has loaded and the watcher
162
+ * is configured.
163
+ */
164
+ this.configureTriggerInteraction();
155
165
  }
156
166
  /**
157
167
  * When opening a popover from a trigger, we should not be
@@ -96,6 +96,16 @@ export class Toast {
96
96
  if (this.isOpen === true) {
97
97
  raf(() => this.present());
98
98
  }
99
+ /**
100
+ * When binding values in frameworks such as Angular
101
+ * it is possible for the value to be set after the Web Component
102
+ * initializes but before the value watcher is set up in Stencil.
103
+ * As a result, the watcher callback may not be fired.
104
+ * We work around this by manually calling the watcher
105
+ * callback when the component has loaded and the watcher
106
+ * is configured.
107
+ */
108
+ this.triggerChanged();
99
109
  }
100
110
  /**
101
111
  * Present the toast overlay after it has been created.
@@ -8,21 +8,40 @@
8
8
  * each test title is unique.
9
9
  */
10
10
  const generateTitle = (title, config) => {
11
- const { mode, direction } = config;
12
- return `${title} - ${mode}/${direction}`;
11
+ const { mode, direction, theme } = config;
12
+ if (theme === 'light') {
13
+ /**
14
+ * Ionic has many existing tests that existed prior to
15
+ * the introduction of theme testing. To maintain backwards
16
+ * compatibility, we will not include the theme in the test
17
+ * title if the theme is set to light.
18
+ */
19
+ return `${title} - ${mode}/${direction}`;
20
+ }
21
+ return `${title} - ${mode}/${direction}/${theme}`;
13
22
  };
14
23
  /**
15
24
  * Generates a unique filename based on a base filename
16
25
  * and a test config.
17
26
  */
18
27
  const generateScreenshotName = (fileName, config) => {
19
- const { mode, direction } = config;
20
- return `${fileName}-${mode}-${direction}.png`;
28
+ const { mode, direction, theme } = config;
29
+ if (theme === 'light') {
30
+ /**
31
+ * Ionic has many existing tests that existed prior to
32
+ * the introduction of theme testing. To maintain backwards
33
+ * compatibility, we will not include the theme in the screenshot
34
+ * name if the theme is set to light.
35
+ */
36
+ return `${fileName}-${mode}-${direction}.png`;
37
+ }
38
+ return `${fileName}-${mode}-${direction}-${theme}.png`;
21
39
  };
22
40
  /**
23
41
  * Given a config generate an array of test variants.
24
42
  */
25
43
  export const configs = (testConfig = DEFAULT_TEST_CONFIG_OPTION) => {
44
+ var _a;
26
45
  const { modes, directions } = testConfig;
27
46
  const configs = [];
28
47
  /**
@@ -31,9 +50,12 @@ export const configs = (testConfig = DEFAULT_TEST_CONFIG_OPTION) => {
31
50
  */
32
51
  const processedMode = modes !== null && modes !== void 0 ? modes : DEFAULT_MODES;
33
52
  const processedDirection = directions !== null && directions !== void 0 ? directions : DEFAULT_DIRECTIONS;
53
+ const processedTheme = (_a = testConfig.themes) !== null && _a !== void 0 ? _a : DEFAULT_THEMES;
34
54
  processedMode.forEach((mode) => {
35
55
  processedDirection.forEach((direction) => {
36
- configs.push({ mode, direction });
56
+ processedTheme.forEach((theme) => {
57
+ configs.push({ mode, direction, theme });
58
+ });
37
59
  });
38
60
  });
39
61
  return configs.map((config) => {
@@ -46,6 +68,7 @@ export const configs = (testConfig = DEFAULT_TEST_CONFIG_OPTION) => {
46
68
  };
47
69
  const DEFAULT_MODES = ['ios', 'md'];
48
70
  const DEFAULT_DIRECTIONS = ['ltr', 'rtl'];
71
+ const DEFAULT_THEMES = ['light'];
49
72
  const DEFAULT_TEST_CONFIG_OPTION = {
50
73
  modes: DEFAULT_MODES,
51
74
  directions: DEFAULT_DIRECTIONS,
@@ -18,13 +18,16 @@ export const setContent = async (page, html, testInfo, options) => {
18
18
  }
19
19
  let mode;
20
20
  let direction;
21
+ let theme;
21
22
  if (options == undefined) {
22
23
  mode = testInfo.project.metadata.mode;
23
24
  direction = testInfo.project.metadata.rtl ? 'rtl' : 'ltr';
25
+ theme = testInfo.project.metadata.theme;
24
26
  }
25
27
  else {
26
28
  mode = options.mode;
27
29
  direction = options.direction;
30
+ theme = options.theme;
28
31
  }
29
32
  const baseUrl = process.env.PLAYWRIGHT_TEST_BASE_URL;
30
33
  const output = `
@@ -36,6 +39,7 @@ export const setContent = async (page, html, testInfo, options) => {
36
39
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
37
40
  <link href="${baseUrl}/css/ionic.bundle.css" rel="stylesheet" />
38
41
  <link href="${baseUrl}/scripts/testing/styles.css" rel="stylesheet" />
42
+ ${theme !== 'light' ? `<link href="${baseUrl}/scripts/testing/themes/${theme}.css" rel="stylesheet" />` : ''}
39
43
  <script src="${baseUrl}/scripts/testing/scripts.js"></script>
40
44
  <script type="module" src="${baseUrl}/dist/ionic/ionic.esm.js"></script>
41
45
  <script>
@@ -51,6 +55,10 @@ export const setContent = async (page, html, testInfo, options) => {
51
55
  </body>
52
56
  </html>
53
57
  `;
58
+ testInfo.annotations.push({
59
+ type: 'theme',
60
+ description: theme,
61
+ });
54
62
  if (baseUrl) {
55
63
  await page.route(baseUrl, (route) => {
56
64
  if (route.request().url() === `${baseUrl}/`) {