@ionic/core 7.3.2 → 7.3.3-dev.11693533652.1969cc78

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 (189) hide show
  1. package/components/action-sheet.js +8 -16
  2. package/components/alert.js +8 -16
  3. package/components/framework-delegate.js +21 -2
  4. package/components/ion-loading.js +8 -16
  5. package/components/ion-modal.js +21 -29
  6. package/components/ion-picker.js +8 -16
  7. package/components/ion-router-outlet.js +1 -0
  8. package/components/ion-toast.js +8 -16
  9. package/components/label.js +2 -2
  10. package/components/lock-controller.js +38 -0
  11. package/components/popover.js +15 -29
  12. package/dist/cjs/{framework-delegate-e8174951.js → framework-delegate-c0873a6f.js} +21 -2
  13. package/dist/cjs/index.cjs.js +2 -2
  14. package/dist/cjs/ion-action-sheet.cjs.entry.js +10 -18
  15. package/dist/cjs/ion-alert.cjs.entry.js +10 -18
  16. package/dist/cjs/ion-app_8.cjs.entry.js +2 -1
  17. package/dist/cjs/ion-datetime_3.cjs.entry.js +10 -18
  18. package/dist/cjs/ion-item_8.cjs.entry.js +2 -2
  19. package/dist/cjs/ion-loading.cjs.entry.js +10 -18
  20. package/dist/cjs/ion-menu_3.cjs.entry.js +2 -2
  21. package/dist/cjs/ion-modal.cjs.entry.js +23 -31
  22. package/dist/cjs/ion-nav_2.cjs.entry.js +1 -1
  23. package/dist/cjs/ion-popover.cjs.entry.js +17 -31
  24. package/dist/cjs/ion-select_3.cjs.entry.js +2 -2
  25. package/dist/cjs/ion-tab_2.cjs.entry.js +1 -1
  26. package/dist/cjs/ion-toast.cjs.entry.js +10 -18
  27. package/dist/cjs/lock-controller-4ae2eb59.js +40 -0
  28. package/dist/cjs/{overlays-0ea06fcb.js → overlays-5c1706ed.js} +1 -1
  29. package/dist/collection/components/action-sheet/action-sheet.js +8 -16
  30. package/dist/collection/components/alert/alert.js +8 -16
  31. package/dist/collection/components/checkbox/test/color/checkbox.e2e.js +2 -2
  32. package/dist/collection/components/checkbox/test/item/checkbox.e2e.js +4 -4
  33. package/dist/collection/components/checkbox/test/label/checkbox.e2e.js +10 -10
  34. package/dist/collection/components/checkbox/test/legacy/basic/checkbox.e2e.js +1 -1
  35. package/dist/collection/components/checkbox/test/legacy/indeterminate/checkbox.e2e.js +1 -1
  36. package/dist/collection/components/checkbox/test/states/checkbox.e2e.js +4 -4
  37. package/dist/collection/components/datetime/test/custom/datetime.e2e.js +0 -7
  38. package/dist/collection/components/datetime/test/presentation/datetime.e2e.js +48 -17
  39. package/dist/collection/components/input/test/bottom-content/input.e2e.js +7 -7
  40. package/dist/collection/components/input/test/card/input.e2e.js +1 -1
  41. package/dist/collection/components/input/test/color/input.e2e.js +15 -15
  42. package/dist/collection/components/input/test/fill/input.e2e.js +10 -10
  43. package/dist/collection/components/input/test/highlight/input.e2e.js +9 -9
  44. package/dist/collection/components/input/test/item/input.e2e.js +2 -2
  45. package/dist/collection/components/input/test/label-placement/input.e2e.js +16 -16
  46. package/dist/collection/components/input/test/legacy/basic/input.e2e.js +10 -10
  47. package/dist/collection/components/input/test/states/input.e2e.js +2 -2
  48. package/dist/collection/components/label/label.ios.css +2 -4
  49. package/dist/collection/components/label/label.md.css +2 -4
  50. package/dist/collection/components/loading/loading.js +8 -16
  51. package/dist/collection/components/modal/modal.js +21 -29
  52. package/dist/collection/components/picker/picker.js +8 -16
  53. package/dist/collection/components/popover/popover.js +15 -29
  54. package/dist/collection/components/popover/test/async/popover.e2e.js +42 -0
  55. package/dist/collection/components/radio/test/color/radio.e2e.js +2 -2
  56. package/dist/collection/components/radio/test/item/radio.e2e.js +3 -3
  57. package/dist/collection/components/radio/test/label-placement/radio.e2e.js +9 -9
  58. package/dist/collection/components/radio/test/states/radio.e2e.js +4 -4
  59. package/dist/collection/components/range/test/color/range.e2e.js +1 -1
  60. package/dist/collection/components/range/test/custom/range.e2e.js +1 -1
  61. package/dist/collection/components/range/test/item/range.e2e.js +3 -3
  62. package/dist/collection/components/range/test/label/range.e2e.js +12 -12
  63. package/dist/collection/components/range/test/legacy/a11y/range.e2e.js +3 -3
  64. package/dist/collection/components/range/test/legacy/active-bar-start/range.e2e.js +1 -1
  65. package/dist/collection/components/range/test/legacy/basic/range.e2e.js +1 -1
  66. package/dist/collection/components/range/test/states/range.e2e.js +4 -4
  67. package/dist/collection/components/router-outlet/router-outlet.js +1 -0
  68. package/dist/collection/components/select/test/card/select.e2e.js +1 -1
  69. package/dist/collection/components/select/test/color/select.e2e.js +3 -3
  70. package/dist/collection/components/select/test/fill/select.e2e.js +10 -10
  71. package/dist/collection/components/select/test/highlight/select.e2e.js +3 -3
  72. package/dist/collection/components/select/test/item/select.e2e.js +2 -2
  73. package/dist/collection/components/select/test/label/select.e2e.js +20 -20
  74. package/dist/collection/components/select/test/states/select.e2e.js +4 -4
  75. package/dist/collection/components/textarea/test/bottom-content/textarea.e2e.js +6 -6
  76. package/dist/collection/components/textarea/test/card/textarea.e2e.js +1 -1
  77. package/dist/collection/components/textarea/test/color/textarea.e2e.js +15 -15
  78. package/dist/collection/components/textarea/test/fill/textarea.e2e.js +10 -10
  79. package/dist/collection/components/textarea/test/highlight/textarea.e2e.js +9 -9
  80. package/dist/collection/components/textarea/test/item/textarea.e2e.js +2 -2
  81. package/dist/collection/components/textarea/test/label-placement/textarea.e2e.js +21 -21
  82. package/dist/collection/components/textarea/test/legacy/autogrow/textarea.e2e.js +5 -5
  83. package/dist/collection/components/textarea/test/states/textarea.e2e.js +2 -2
  84. package/dist/collection/components/toast/toast.js +8 -16
  85. package/dist/collection/components/toggle/test/color/toggle.e2e.js +2 -2
  86. package/dist/collection/components/toggle/test/item/toggle.e2e.js +4 -4
  87. package/dist/collection/components/toggle/test/label/toggle.e2e.js +9 -9
  88. package/dist/collection/components/toggle/test/legacy/enable-on-off-labels/toggle.e2e.js +2 -2
  89. package/dist/collection/components/toggle/test/legacy/sizes/toggle.e2e.js +1 -1
  90. package/dist/collection/components/toggle/test/states/toggle.e2e.js +3 -3
  91. package/dist/collection/utils/framework-delegate.js +21 -2
  92. package/dist/collection/utils/lock-controller.js +36 -0
  93. package/dist/docs.json +1 -1
  94. package/dist/esm/{framework-delegate-2b76c681.js → framework-delegate-aa433dea.js} +21 -2
  95. package/dist/esm/index.js +2 -2
  96. package/dist/esm/ion-action-sheet.entry.js +10 -18
  97. package/dist/esm/ion-alert.entry.js +10 -18
  98. package/dist/esm/ion-app_8.entry.js +2 -1
  99. package/dist/esm/ion-datetime_3.entry.js +10 -18
  100. package/dist/esm/ion-item_8.entry.js +2 -2
  101. package/dist/esm/ion-loading.entry.js +10 -18
  102. package/dist/esm/ion-menu_3.entry.js +2 -2
  103. package/dist/esm/ion-modal.entry.js +23 -31
  104. package/dist/esm/ion-nav_2.entry.js +1 -1
  105. package/dist/esm/ion-popover.entry.js +17 -31
  106. package/dist/esm/ion-select_3.entry.js +2 -2
  107. package/dist/esm/ion-tab_2.entry.js +1 -1
  108. package/dist/esm/ion-toast.entry.js +10 -18
  109. package/dist/esm/lock-controller-e8c6c051.js +38 -0
  110. package/dist/esm/{overlays-c3387ec0.js → overlays-e1dadfe6.js} +1 -1
  111. package/dist/esm-es5/framework-delegate-aa433dea.js +4 -0
  112. package/dist/esm-es5/index.js +1 -1
  113. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  114. package/dist/esm-es5/ion-alert.entry.js +1 -1
  115. package/dist/esm-es5/ion-app_8.entry.js +1 -1
  116. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  117. package/dist/esm-es5/ion-item_8.entry.js +1 -1
  118. package/dist/esm-es5/ion-loading.entry.js +1 -1
  119. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  120. package/dist/esm-es5/ion-modal.entry.js +1 -1
  121. package/dist/esm-es5/ion-nav_2.entry.js +1 -1
  122. package/dist/esm-es5/ion-popover.entry.js +1 -1
  123. package/dist/esm-es5/ion-select_3.entry.js +1 -1
  124. package/dist/esm-es5/ion-tab_2.entry.js +1 -1
  125. package/dist/esm-es5/ion-toast.entry.js +1 -1
  126. package/dist/esm-es5/lock-controller-e8c6c051.js +4 -0
  127. package/dist/esm-es5/{overlays-c3387ec0.js → overlays-e1dadfe6.js} +1 -1
  128. package/dist/ionic/index.esm.js +1 -1
  129. package/dist/ionic/ionic.esm.js +1 -1
  130. package/dist/ionic/{p-958bde76.entry.js → p-091cd81e.entry.js} +1 -1
  131. package/dist/ionic/{p-d1356034.system.entry.js → p-0b68c41d.system.entry.js} +1 -1
  132. package/dist/ionic/p-0cc2bf5a.system.entry.js +4 -0
  133. package/dist/ionic/p-208f640c.entry.js +4 -0
  134. package/dist/ionic/p-2539e967.system.entry.js +4 -0
  135. package/dist/ionic/{p-74bd26b8.system.entry.js → p-28f5715a.system.entry.js} +1 -1
  136. package/dist/ionic/{p-b9312889.entry.js → p-341d5877.entry.js} +1 -1
  137. package/dist/ionic/p-38dd9aec.entry.js +4 -0
  138. package/dist/ionic/p-3ff018da.entry.js +4 -0
  139. package/dist/ionic/{p-8074bdd7.system.entry.js → p-45ee211b.system.entry.js} +1 -1
  140. package/dist/ionic/p-5009cb46.entry.js +4 -0
  141. package/dist/ionic/p-53b2a46f.js +4 -0
  142. package/dist/ionic/{p-5ef91692.js → p-582dc7c1.js} +1 -1
  143. package/dist/ionic/{p-79e30193.system.entry.js → p-5ba27716.system.entry.js} +1 -1
  144. package/dist/ionic/{p-c0d1e5a1.entry.js → p-5c17f888.entry.js} +1 -1
  145. package/dist/ionic/{p-8d9475b5.system.js → p-613d4042.system.js} +1 -1
  146. package/dist/ionic/p-647d15d4.system.entry.js +4 -0
  147. package/dist/ionic/p-653f2fc6.entry.js +4 -0
  148. package/dist/ionic/p-721933ff.system.js +1 -1
  149. package/dist/ionic/p-772f6c84.system.js +4 -0
  150. package/dist/ionic/p-87383d00.system.entry.js +4 -0
  151. package/dist/ionic/{p-db46fc66.system.js → p-8843b046.system.js} +1 -1
  152. package/dist/ionic/p-93e47822.entry.js +4 -0
  153. package/dist/ionic/{p-229df0d8.entry.js → p-98ebc376.entry.js} +1 -1
  154. package/dist/ionic/p-af0bc751.system.entry.js +4 -0
  155. package/dist/ionic/p-b0e9e0b8.system.entry.js +4 -0
  156. package/dist/ionic/p-b287ab05.js +4 -0
  157. package/dist/ionic/{p-81b46714.system.js → p-b32742f3.system.js} +1 -1
  158. package/dist/ionic/p-b3394798.system.entry.js +4 -0
  159. package/dist/ionic/{p-20087c90.entry.js → p-c759a704.entry.js} +1 -1
  160. package/dist/ionic/{p-6b9bf14c.system.entry.js → p-d1d3b740.system.entry.js} +1 -1
  161. package/dist/ionic/{p-8fa43732.system.entry.js → p-d693e765.system.entry.js} +1 -1
  162. package/dist/ionic/{p-5c96dc4e.entry.js → p-f7faa32d.entry.js} +1 -1
  163. package/dist/ionic/p-fabb7294.entry.js +4 -0
  164. package/dist/types/components/action-sheet/action-sheet.d.ts +1 -1
  165. package/dist/types/components/alert/alert.d.ts +1 -1
  166. package/dist/types/components/loading/loading.d.ts +1 -1
  167. package/dist/types/components/modal/modal.d.ts +1 -1
  168. package/dist/types/components/picker/picker.d.ts +1 -1
  169. package/dist/types/components/popover/popover.d.ts +1 -1
  170. package/dist/types/components/toast/toast.d.ts +1 -1
  171. package/dist/types/utils/lock-controller.d.ts +10 -0
  172. package/hydrate/index.js +127 -142
  173. package/package.json +1 -1
  174. package/dist/esm-es5/framework-delegate-2b76c681.js +0 -4
  175. package/dist/ionic/p-06f1f560.system.entry.js +0 -4
  176. package/dist/ionic/p-2936ec7f.system.entry.js +0 -4
  177. package/dist/ionic/p-29b3e70a.entry.js +0 -4
  178. package/dist/ionic/p-2bc49e5d.system.entry.js +0 -4
  179. package/dist/ionic/p-2da3e015.system.entry.js +0 -4
  180. package/dist/ionic/p-423d5a4d.entry.js +0 -4
  181. package/dist/ionic/p-564aaba3.entry.js +0 -4
  182. package/dist/ionic/p-61769039.entry.js +0 -4
  183. package/dist/ionic/p-74723f41.entry.js +0 -4
  184. package/dist/ionic/p-9b3c3564.entry.js +0 -4
  185. package/dist/ionic/p-b34c1ae1.js +0 -4
  186. package/dist/ionic/p-ccea9adc.system.entry.js +0 -4
  187. package/dist/ionic/p-d5db0834.system.entry.js +0 -4
  188. package/dist/ionic/p-d8538837.entry.js +0 -4
  189. package/dist/ionic/p-dd0b6889.system.entry.js +0 -4
@@ -10,14 +10,14 @@ configs().forEach(({ title, screenshot, config }) => {
10
10
  <ion-textarea label="Standard" value="Lorem ipsum" label-placement="start"></ion-textarea>
11
11
  `, config);
12
12
  const textarea = page.locator('ion-textarea');
13
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-start`));
13
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-start`));
14
14
  });
15
15
  test('textarea should render multiple lines of text', async ({ page }) => {
16
16
  await page.setContent(`
17
17
  <ion-textarea label="Standard" label-placement="start" value="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."></ion-textarea>
18
18
  `, config);
19
19
  const textarea = page.locator('ion-textarea');
20
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-start-multi-line-value`));
20
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-start-multi-line-value`));
21
21
  });
22
22
  });
23
23
  test.describe(title('textarea: label placement end'), () => {
@@ -26,14 +26,14 @@ configs().forEach(({ title, screenshot, config }) => {
26
26
  <ion-textarea label="Standard" value="Lorem ipsum" label-placement="end"></ion-textarea>
27
27
  `, config);
28
28
  const textarea = page.locator('ion-textarea');
29
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-end`));
29
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-end`));
30
30
  });
31
31
  test('textarea should render multiple lines of text', async ({ page }) => {
32
32
  await page.setContent(`
33
33
  <ion-textarea label="Standard" label-placement="end" value="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."></ion-textarea>
34
34
  `, config);
35
35
  const textarea = page.locator('ion-textarea');
36
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-end-multi-line-value`));
36
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-end-multi-line-value`));
37
37
  });
38
38
  });
39
39
  test.describe(title('textarea: label placement fixed'), () => {
@@ -42,21 +42,21 @@ configs().forEach(({ title, screenshot, config }) => {
42
42
  <ion-textarea label="Standard" value="Lorem ipsum" label-placement="fixed"></ion-textarea>
43
43
  `, config);
44
44
  const textarea = page.locator('ion-textarea');
45
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-fixed`));
45
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-fixed`));
46
46
  });
47
47
  test('textarea should render multiple lines of text', async ({ page }) => {
48
48
  await page.setContent(`
49
49
  <ion-textarea label="Standard" label-placement="fixed" value="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."></ion-textarea>
50
50
  `, config);
51
51
  const textarea = page.locator('ion-textarea');
52
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-fixed-multi-line-value`));
52
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-fixed-multi-line-value`));
53
53
  });
54
54
  test('label should be truncated', async ({ page }) => {
55
55
  await page.setContent(`
56
56
  <ion-textarea label="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur." label-placement="fixed"></ion-textarea>
57
57
  `, config);
58
58
  const textarea = page.locator('ion-textarea');
59
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-fixed-label-truncated`));
59
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-fixed-label-truncated`));
60
60
  });
61
61
  });
62
62
  test.describe(title('textarea: label placement stacked'), () => {
@@ -65,28 +65,28 @@ configs().forEach(({ title, screenshot, config }) => {
65
65
  <ion-textarea label="Standard" value="Lorem ipsum" label-placement="stacked"></ion-textarea>
66
66
  `, config);
67
67
  const textarea = page.locator('ion-textarea');
68
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-stacked-value`));
68
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-stacked-value`));
69
69
  });
70
70
  test('label should appear above the textarea when there is a no value', async ({ page }) => {
71
71
  await page.setContent(`
72
72
  <ion-textarea label="Standard" label-placement="stacked"></ion-textarea>
73
73
  `, config);
74
74
  const textarea = page.locator('ion-textarea');
75
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-stacked-no-value`));
75
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-stacked-no-value`));
76
76
  });
77
77
  test('textarea should render multiple lines of text', async ({ page }) => {
78
78
  await page.setContent(`
79
79
  <ion-textarea label="Standard" label-placement="stacked" value="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."></ion-textarea>
80
80
  `, config);
81
81
  const textarea = page.locator('ion-textarea');
82
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-stacked-multi-line-value`));
82
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-stacked-multi-line-value`));
83
83
  });
84
84
  test('label should be truncated', async ({ page }) => {
85
85
  await page.setContent(`
86
86
  <ion-textarea label="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur." label-placement="stacked"></ion-textarea>
87
87
  `, config);
88
88
  const textarea = page.locator('ion-textarea');
89
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-stacked-label-truncated`));
89
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-stacked-label-truncated`));
90
90
  });
91
91
  });
92
92
  test.describe(title('textarea: label placement floating'), () => {
@@ -95,21 +95,21 @@ configs().forEach(({ title, screenshot, config }) => {
95
95
  <ion-textarea label="Standard" value="Lorem ipsum" label-placement="floating"></ion-textarea>
96
96
  `, config);
97
97
  const textarea = page.locator('ion-textarea');
98
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-floating-value`));
98
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-floating-value`));
99
99
  });
100
100
  test('label should appear on top of the textarea and hide the textarea when there is a no value', async ({ page, }) => {
101
101
  await page.setContent(`
102
102
  <ion-textarea label="Standard" label-placement="floating" placeholder="Placeholder"></ion-textarea>
103
103
  `, config);
104
104
  const textarea = page.locator('ion-textarea');
105
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-floating-no-value`));
105
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-floating-no-value`));
106
106
  });
107
107
  test('label should appear on top of the textarea when there is a placeholder and no value', async ({ page }) => {
108
108
  await page.setContent(`
109
109
  <ion-textarea label="Standard" label-placement="floating" placeholder="Placeholder"></ion-textarea>
110
110
  `, config);
111
111
  const textarea = page.locator('ion-textarea');
112
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-floating-no-value-placeholder`));
112
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-floating-no-value-placeholder`));
113
113
  });
114
114
  test('label should appear on top of the textarea when the textarea is focused', async ({ page }) => {
115
115
  await page.setContent(`
@@ -119,21 +119,21 @@ configs().forEach(({ title, screenshot, config }) => {
119
119
  const nativeTextarea = textarea.locator('textarea');
120
120
  await nativeTextarea.click();
121
121
  await page.waitForChanges();
122
- expect(await textarea.screenshot({ animations: 'disabled' })).toMatchSnapshot(screenshot(`textarea-focused-placement-floating-no-value`));
122
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-focused-placement-floating-no-value`));
123
123
  });
124
124
  test('textarea should render multiple lines of text', async ({ page }) => {
125
125
  await page.setContent(`
126
126
  <ion-textarea label="Standard" label-placement="floating" value="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."></ion-textarea>
127
127
  `, config);
128
128
  const textarea = page.locator('ion-textarea');
129
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-floating-multi-line-value`));
129
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-floating-multi-line-value`));
130
130
  });
131
131
  test('label should be truncated', async ({ page }) => {
132
132
  await page.setContent(`
133
133
  <ion-textarea label="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur." label-placement="floating"></ion-textarea>
134
134
  `, config);
135
135
  const textarea = page.locator('ion-textarea');
136
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-placement-floating-label-truncated`));
136
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-placement-floating-label-truncated`));
137
137
  });
138
138
  });
139
139
  });
@@ -144,7 +144,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
144
144
  <ion-textarea label="Label Label Label Label Label" placeholder="Text Input"></ion-textarea>
145
145
  `, config);
146
146
  const textarea = page.locator('ion-textarea');
147
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-label-truncate`));
147
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-label-truncate`));
148
148
  });
149
149
  test('label slot should be truncated with an ellipsis', async ({ page }) => {
150
150
  await page.setContent(`
@@ -153,7 +153,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
153
153
  </ion-textarea>
154
154
  `, config);
155
155
  const textarea = page.locator('ion-textarea');
156
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-label-slot-truncate`));
156
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-label-slot-truncate`));
157
157
  });
158
158
  });
159
159
  });
@@ -171,7 +171,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
171
171
  el.appendChild(labelEl);
172
172
  });
173
173
  await page.waitForChanges();
174
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-async-label`));
174
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-async-label`));
175
175
  });
176
176
  });
177
177
  test.describe(title('textarea: flex in grid rendering'), () => {
@@ -218,7 +218,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
218
218
  <ion-textarea class="custom-textarea" label="My Label" label-placement="stacked"></ion-textarea>
219
219
  `, config);
220
220
  const textarea = page.locator('ion-textarea');
221
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-label-layering`));
221
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-label-layering`));
222
222
  });
223
223
  });
224
224
  });
@@ -11,7 +11,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
11
11
  test('should not have visual regressions', async ({ page }) => {
12
12
  await page.goto(`/src/components/textarea/test/legacy/autogrow`, config);
13
13
  await page.setIonViewport();
14
- expect(await page.screenshot()).toMatchSnapshot(screenshot(`textarea-autogrow-diff`));
14
+ await expect(page).toHaveScreenshot(screenshot(`textarea-autogrow-diff`));
15
15
  });
16
16
  test('should grow when typing', async ({ page }) => {
17
17
  await page.setContent(`
@@ -24,19 +24,19 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
24
24
  </ion-list>
25
25
  </ion-content>
26
26
  </ion-app>`, config);
27
- const textarea = await page.waitForSelector('ion-textarea');
27
+ const textarea = page.locator('ion-textarea');
28
28
  await textarea.click();
29
29
  await page.waitForChanges();
30
30
  await textarea.type('Now, this is a story all about how');
31
31
  await page.setIonViewport();
32
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-autogrow-initial`));
32
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-autogrow-initial`));
33
33
  await textarea.type([
34
34
  `\nMy life got flipped-turned upside down`,
35
35
  `And I'd like to take a minute`,
36
36
  `Just sit right there`,
37
37
  `I'll tell you how I became the prince of a town called Bel-Air`,
38
38
  ].join('\n'));
39
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-autogrow-after`));
39
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-autogrow-after`));
40
40
  });
41
41
  test('should break long lines without white space', async ({ page }) => {
42
42
  test.info().annotations.push({
@@ -52,7 +52,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
52
52
  </ion-content>
53
53
  </ion-app>`, config);
54
54
  const textarea = page.locator('ion-textarea');
55
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-autogrow-word-break`));
55
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-autogrow-word-break`));
56
56
  });
57
57
  });
58
58
  });
@@ -10,14 +10,14 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
10
10
  <ion-textarea label="Email" value="hi@ionic.io" readonly="true"></ion-textarea>
11
11
  `, config);
12
12
  const textarea = page.locator('ion-textarea');
13
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-readonly`));
13
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-readonly`));
14
14
  });
15
15
  test('should render disabled textarea correctly', async ({ page }) => {
16
16
  await page.setContent(`
17
17
  <ion-textarea label="Email" value="hi@ionic.io" disabled="true"></ion-textarea>
18
18
  `, config);
19
19
  const textarea = page.locator('ion-textarea');
20
- expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-disabled`));
20
+ await expect(textarea).toHaveScreenshot(screenshot(`textarea-disabled`));
21
21
  });
22
22
  });
23
23
  });
@@ -4,6 +4,7 @@
4
4
  import { h, Host } from "@stencil/core";
5
5
  import { ENABLE_HTML_CONTENT_DEFAULT } from "../../utils/config";
6
6
  import { raf } from "../../utils/helpers";
7
+ import { createLockController } from "../../utils/lock-controller";
7
8
  import { printIonWarning } from "../../utils/logging/index";
8
9
  import { createDelegateController, createTriggerController, dismiss, eventMethod, isCancel, prepareOverlay, present, safeCall, setOverlayId, } from "../../utils/overlays";
9
10
  import { sanitizeDOMString } from "../../utils/sanitization/index";
@@ -28,6 +29,7 @@ import { mdLeaveAnimation } from "./animations/md.leave";
28
29
  export class Toast {
29
30
  constructor() {
30
31
  this.delegateController = createDelegateController(this);
32
+ this.lockController = createLockController();
31
33
  this.triggerController = createTriggerController();
32
34
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
33
35
  this.presented = false;
@@ -97,30 +99,19 @@ export class Toast {
97
99
  * Present the toast overlay after it has been created.
98
100
  */
99
101
  async present() {
100
- /**
101
- * When using an inline toast
102
- * and dismissing a toast it is possible to
103
- * quickly present the toast while it is
104
- * dismissing. We need to await any current
105
- * transition to allow the dismiss to finish
106
- * before presenting again.
107
- */
108
- if (this.currentTransition !== undefined) {
109
- await this.currentTransition;
110
- }
102
+ const unlock = await this.lockController.lock();
111
103
  await this.delegateController.attachViewToDom();
112
- this.currentTransition = present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
113
- await this.currentTransition;
104
+ await present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
114
105
  /**
115
106
  * Content is revealed to screen readers after
116
107
  * the transition to avoid jank since this
117
108
  * state updates will cause a re-render.
118
109
  */
119
110
  this.revealContentToScreenReader = true;
120
- this.currentTransition = undefined;
121
111
  if (this.duration > 0) {
122
112
  this.durationTimeout = setTimeout(() => this.dismiss(undefined, 'timeout'), this.duration);
123
113
  }
114
+ unlock();
124
115
  }
125
116
  /**
126
117
  * Dismiss the toast overlay after it has been presented.
@@ -132,15 +123,16 @@ export class Toast {
132
123
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
133
124
  */
134
125
  async dismiss(data, role) {
126
+ const unlock = await this.lockController.lock();
135
127
  if (this.durationTimeout) {
136
128
  clearTimeout(this.durationTimeout);
137
129
  }
138
- this.currentTransition = dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
139
- const dismissed = await this.currentTransition;
130
+ const dismissed = await dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
140
131
  if (dismissed) {
141
132
  this.delegateController.removeViewFromDom();
142
133
  this.revealContentToScreenReader = false;
143
134
  }
135
+ unlock();
144
136
  return dismissed;
145
137
  }
146
138
  /**
@@ -10,14 +10,14 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
10
10
  <ion-toggle color="danger" checked="true">Label</ion-toggle>
11
11
  `, config);
12
12
  const toggle = page.locator('ion-toggle');
13
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-color-checked`));
13
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-color-checked`));
14
14
  });
15
15
  test('should not apply color when unchecked', async ({ page }) => {
16
16
  await page.setContent(`
17
17
  <ion-toggle color="danger">Label</ion-toggle>
18
18
  `, config);
19
19
  const toggle = page.locator('ion-toggle');
20
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-color-unchecked`));
20
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-color-unchecked`));
21
21
  });
22
22
  });
23
23
  });
@@ -14,7 +14,7 @@ configs().forEach(({ title, screenshot, config }) => {
14
14
  </ion-list>
15
15
  `, config);
16
16
  const list = page.locator('ion-list');
17
- expect(await list.screenshot()).toMatchSnapshot(screenshot(`toggle-list`));
17
+ await expect(list).toHaveScreenshot(screenshot(`toggle-list`));
18
18
  });
19
19
  test('should render correctly in inset list', async ({ page }) => {
20
20
  await page.setContent(`
@@ -25,7 +25,7 @@ configs().forEach(({ title, screenshot, config }) => {
25
25
  </ion-list>
26
26
  `, config);
27
27
  const list = page.locator('ion-list');
28
- expect(await list.screenshot()).toMatchSnapshot(screenshot(`toggle-inset-list`));
28
+ await expect(list).toHaveScreenshot(screenshot(`toggle-inset-list`));
29
29
  });
30
30
  });
31
31
  });
@@ -38,7 +38,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
38
38
  </ion-item>
39
39
  `, config);
40
40
  const item = page.locator('ion-item');
41
- expect(await item.screenshot()).toMatchSnapshot(screenshot(`toggle-item-color`));
41
+ await expect(item).toHaveScreenshot(screenshot(`toggle-item-color`));
42
42
  });
43
43
  });
44
44
  });
@@ -55,7 +55,7 @@ configs({ directions: ['ltr'], modes: ['md'] }).forEach(({ title, screenshot, co
55
55
  </ion-list>
56
56
  `, config);
57
57
  const list = page.locator('ion-list');
58
- expect(await list.screenshot()).toMatchSnapshot(screenshot(`toggle-long-label-in-item`));
58
+ await expect(list).toHaveScreenshot(screenshot(`toggle-long-label-in-item`));
59
59
  });
60
60
  });
61
61
  });
@@ -19,7 +19,7 @@ configs().forEach(({ title, screenshot, config }) => {
19
19
  <ion-toggle label-placement="start" justify="start" style="width: 200px">Label</ion-toggle>
20
20
  `, config);
21
21
  const toggle = page.locator('ion-toggle');
22
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-label-start-justify-start`));
22
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-label-start-justify-start`));
23
23
  });
24
24
  test('should render an end justification with label in the start position', async ({ page }) => {
25
25
  await page.setContent(`
@@ -27,7 +27,7 @@ configs().forEach(({ title, screenshot, config }) => {
27
27
  <ion-toggle label-placement="start" justify="end" style="width: 200px">Label</ion-toggle>
28
28
  `, config);
29
29
  const toggle = page.locator('ion-toggle');
30
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-label-start-justify-end`));
30
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-label-start-justify-end`));
31
31
  });
32
32
  test('should render a space between justification with label in the start position', async ({ page }) => {
33
33
  await page.setContent(`
@@ -35,7 +35,7 @@ configs().forEach(({ title, screenshot, config }) => {
35
35
  <ion-toggle label-placement="start" justify="space-between" style="width: 200px">Label</ion-toggle>
36
36
  `, config);
37
37
  const toggle = page.locator('ion-toggle');
38
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-label-start-justify-space-between`));
38
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-label-start-justify-space-between`));
39
39
  });
40
40
  });
41
41
  test.describe(title('toggle: end placement'), () => {
@@ -45,7 +45,7 @@ configs().forEach(({ title, screenshot, config }) => {
45
45
  <ion-toggle label-placement="end" justify="start" style="width: 200px">Label</ion-toggle>
46
46
  `, config);
47
47
  const toggle = page.locator('ion-toggle');
48
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-label-end-justify-start`));
48
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-label-end-justify-start`));
49
49
  });
50
50
  test('should render an end justification with label in the end position', async ({ page }) => {
51
51
  await page.setContent(`
@@ -53,7 +53,7 @@ configs().forEach(({ title, screenshot, config }) => {
53
53
  <ion-toggle label-placement="end" justify="end" style="width: 200px">Label</ion-toggle>
54
54
  `, config);
55
55
  const toggle = page.locator('ion-toggle');
56
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-label-end-justify-end`));
56
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-label-end-justify-end`));
57
57
  });
58
58
  test('should render a space between justification with label in the end position', async ({ page }) => {
59
59
  await page.setContent(`
@@ -61,7 +61,7 @@ configs().forEach(({ title, screenshot, config }) => {
61
61
  <ion-toggle label-placement="end" justify="space-between" style="width: 200px">Label</ion-toggle>
62
62
  `, config);
63
63
  const toggle = page.locator('ion-toggle');
64
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-label-end-justify-space-between`));
64
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-label-end-justify-space-between`));
65
65
  });
66
66
  });
67
67
  test.describe(title('toggle: fixed placement'), () => {
@@ -71,7 +71,7 @@ configs().forEach(({ title, screenshot, config }) => {
71
71
  <ion-toggle label-placement="fixed" justify="start" style="width: 200px">This is a long label</ion-toggle>
72
72
  `, config);
73
73
  const toggle = page.locator('ion-toggle');
74
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-label-fixed-justify-start`));
74
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-label-fixed-justify-start`));
75
75
  });
76
76
  test('should render an end justification with label in the fixed position', async ({ page }) => {
77
77
  await page.setContent(`
@@ -79,7 +79,7 @@ configs().forEach(({ title, screenshot, config }) => {
79
79
  <ion-toggle label-placement="fixed" justify="end" style="width: 200px">This is a long label</ion-toggle>
80
80
  `, config);
81
81
  const toggle = page.locator('ion-toggle');
82
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-label-fixed-justify-end`));
82
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-label-fixed-justify-end`));
83
83
  });
84
84
  test('should render a space between justification with label in the fixed position', async ({ page }) => {
85
85
  await page.setContent(`
@@ -87,7 +87,7 @@ configs().forEach(({ title, screenshot, config }) => {
87
87
  <ion-toggle label-placement="fixed" justify="space-between" style="width: 200px">This is a long label</ion-toggle>
88
88
  `, config);
89
89
  const toggle = page.locator('ion-toggle');
90
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-label-fixed-justify-space-between`));
90
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-label-fixed-justify-space-between`));
91
91
  });
92
92
  });
93
93
  });
@@ -8,7 +8,7 @@ configs().forEach(({ title, screenshot, config }) => {
8
8
  test('should not have visual regressions', async ({ page }) => {
9
9
  await page.goto(`/src/components/toggle/test/legacy/enable-on-off-labels`, config);
10
10
  await page.setIonViewport();
11
- expect(await page.screenshot()).toMatchSnapshot(screenshot(`toggle-on-off-labels-diff`));
11
+ await expect(page).toHaveScreenshot(screenshot(`toggle-on-off-labels-diff`));
12
12
  });
13
13
  });
14
14
  });
@@ -31,7 +31,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
31
31
  await ionPopoverDidDismiss.next();
32
32
  await page.waitForChanges();
33
33
  await page.setIonViewport();
34
- expect(await page.screenshot()).toMatchSnapshot(screenshot(`toggle-on-off-labels-dark-mode-diff`));
34
+ await expect(page).toHaveScreenshot(screenshot(`toggle-on-off-labels-dark-mode-diff`));
35
35
  });
36
36
  });
37
37
  });
@@ -8,7 +8,7 @@ configs().forEach(({ title, screenshot, config }) => {
8
8
  test('should not have visual regressions', async ({ page }) => {
9
9
  await page.goto(`/src/components/toggle/test/legacy/sizes`, config);
10
10
  await page.setIonViewport();
11
- expect(await page.screenshot()).toMatchSnapshot(screenshot(`toggle-sizes-diff`));
11
+ await expect(page).toHaveScreenshot(screenshot(`toggle-sizes-diff`));
12
12
  });
13
13
  });
14
14
  });
@@ -10,21 +10,21 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
10
10
  <ion-toggle disabled="true">Label</ion-toggle>
11
11
  `, config);
12
12
  const toggle = page.locator('ion-toggle');
13
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-disabled`));
13
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-disabled`));
14
14
  });
15
15
  test('should render checked toggle correctly', async ({ page }) => {
16
16
  await page.setContent(`
17
17
  <ion-toggle checked="true">Label</ion-toggle>
18
18
  `, config);
19
19
  const toggle = page.locator('ion-toggle');
20
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-checked`));
20
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-checked`));
21
21
  });
22
22
  test('should render unchecked toggle correctly', async ({ page }) => {
23
23
  await page.setContent(`
24
24
  <ion-toggle>Label</ion-toggle>
25
25
  `, config);
26
26
  const toggle = page.locator('ion-toggle');
27
- expect(await toggle.screenshot()).toMatchSnapshot(screenshot(`toggle-unchecked`));
27
+ await expect(toggle).toHaveScreenshot(screenshot(`toggle-unchecked`));
28
28
  });
29
29
  });
30
30
  });
@@ -38,6 +38,7 @@ export const CoreDelegate = () => {
38
38
  const attachViewToDom = async (parentElement, userComponent, userComponentProps = {}, cssClasses = []) => {
39
39
  var _a, _b;
40
40
  BaseComponent = parentElement;
41
+ let ChildComponent;
41
42
  /**
42
43
  * If passing in a component via the `component` props
43
44
  * we need to append it inside of our overlay component.
@@ -64,6 +65,7 @@ export const CoreDelegate = () => {
64
65
  * inside of the overlay component.
65
66
  */
66
67
  BaseComponent.appendChild(el);
68
+ ChildComponent = el;
67
69
  await new Promise((resolve) => componentOnReady(el, resolve));
68
70
  }
69
71
  else if (BaseComponent.children.length > 0 &&
@@ -72,7 +74,7 @@ export const CoreDelegate = () => {
72
74
  * The delegate host wrapper el is only needed for modals and popovers
73
75
  * because they allow the dev to provide custom content to the overlay.
74
76
  */
75
- const root = BaseComponent.children[0];
77
+ const root = (ChildComponent = BaseComponent.children[0]);
76
78
  if (!root.classList.contains('ion-delegate-host')) {
77
79
  /**
78
80
  * If the root element is not a delegate host, it means
@@ -87,6 +89,12 @@ export const CoreDelegate = () => {
87
89
  el.append(...BaseComponent.children);
88
90
  // Append the new parent element to the original parent element.
89
91
  BaseComponent.appendChild(el);
92
+ /**
93
+ * Update the ChildComponent to be the
94
+ * newly created div in the event that one
95
+ * does not already exist.
96
+ */
97
+ ChildComponent = el;
90
98
  }
91
99
  }
92
100
  /**
@@ -102,7 +110,18 @@ export const CoreDelegate = () => {
102
110
  Reference = document.createComment('ionic teleport');
103
111
  BaseComponent.parentNode.insertBefore(Reference, BaseComponent);
104
112
  app.appendChild(BaseComponent);
105
- return BaseComponent;
113
+ /**
114
+ * We return the child component rather than the overlay
115
+ * reference itself since modal and popover will
116
+ * use this to wait for any Ionic components in the child view
117
+ * to be ready (i.e. componentOnReady) when using the
118
+ * lazy loaded component bundle.
119
+ *
120
+ * However, we fall back to returning BaseComponent
121
+ * in the event that a modal or popover is presented
122
+ * with no child content.
123
+ */
124
+ return ChildComponent !== null && ChildComponent !== void 0 ? ChildComponent : BaseComponent;
106
125
  };
107
126
  const removeViewFromDom = () => {
108
127
  /**
@@ -0,0 +1,36 @@
1
+ /*!
2
+ * (C) Ionic http://ionicframework.com - MIT License
3
+ */
4
+ /**
5
+ * Creates a lock controller.
6
+ *
7
+ * Claiming a lock means that nothing else can acquire the lock until it is released.
8
+ * This can momentarily prevent execution of code that needs to wait for the earlier code to finish.
9
+ * For example, this can be used to prevent multiple transitions from occurring at the same time.
10
+ */
11
+ export const createLockController = () => {
12
+ let waitPromise;
13
+ /**
14
+ * When lock() is called, the lock is claimed.
15
+ * Once a lock has been claimed, it cannot be claimed again until it is released.
16
+ * When this function gets resolved, the lock is released, allowing it to be claimed again.
17
+ *
18
+ * @example ```tsx
19
+ * const unlock = await this.lockController.lock();
20
+ * // do other stuff
21
+ * unlock();
22
+ * ```
23
+ */
24
+ const lock = async () => {
25
+ const p = waitPromise;
26
+ let resolve;
27
+ waitPromise = new Promise((r) => (resolve = r));
28
+ if (p !== undefined) {
29
+ await p;
30
+ }
31
+ return resolve;
32
+ };
33
+ return {
34
+ lock,
35
+ };
36
+ };
package/dist/docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-08-30T12:42:07",
2
+ "timestamp": "2023-09-01T02:03:56",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.1.0",