@ionic/core 7.3.3-dev.11693454416.1cb6a7ec → 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 (142) 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-nav-link.js +1 -7
  7. package/components/ion-picker.js +8 -16
  8. package/components/ion-router-outlet.js +1 -0
  9. package/components/ion-toast.js +8 -16
  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-loading.cjs.entry.js +10 -18
  19. package/dist/cjs/ion-menu_3.cjs.entry.js +2 -2
  20. package/dist/cjs/ion-modal.cjs.entry.js +23 -31
  21. package/dist/cjs/ion-nav_2.cjs.entry.js +2 -8
  22. package/dist/cjs/ion-popover.cjs.entry.js +17 -31
  23. package/dist/cjs/ion-select_3.cjs.entry.js +2 -2
  24. package/dist/cjs/ion-tab_2.cjs.entry.js +1 -1
  25. package/dist/cjs/ion-toast.cjs.entry.js +10 -18
  26. package/dist/cjs/lock-controller-4ae2eb59.js +40 -0
  27. package/dist/cjs/{overlays-0ea06fcb.js → overlays-5c1706ed.js} +1 -1
  28. package/dist/collection/components/action-sheet/action-sheet.js +8 -16
  29. package/dist/collection/components/alert/alert.js +8 -16
  30. package/dist/collection/components/datetime/test/presentation/datetime.e2e.js +48 -17
  31. package/dist/collection/components/loading/loading.js +8 -16
  32. package/dist/collection/components/modal/modal.js +21 -29
  33. package/dist/collection/components/nav-link/nav-link.js +1 -7
  34. package/dist/collection/components/picker/picker.js +8 -16
  35. package/dist/collection/components/popover/popover.js +15 -29
  36. package/dist/collection/components/popover/test/async/popover.e2e.js +42 -0
  37. package/dist/collection/components/router-outlet/router-outlet.js +1 -0
  38. package/dist/collection/components/textarea/test/bottom-content/textarea.e2e.js +6 -6
  39. package/dist/collection/components/textarea/test/card/textarea.e2e.js +1 -1
  40. package/dist/collection/components/textarea/test/color/textarea.e2e.js +15 -15
  41. package/dist/collection/components/textarea/test/fill/textarea.e2e.js +10 -10
  42. package/dist/collection/components/textarea/test/highlight/textarea.e2e.js +9 -9
  43. package/dist/collection/components/textarea/test/item/textarea.e2e.js +2 -2
  44. package/dist/collection/components/textarea/test/label-placement/textarea.e2e.js +21 -21
  45. package/dist/collection/components/textarea/test/legacy/autogrow/textarea.e2e.js +5 -5
  46. package/dist/collection/components/textarea/test/states/textarea.e2e.js +2 -2
  47. package/dist/collection/components/toast/toast.js +8 -16
  48. package/dist/collection/utils/framework-delegate.js +21 -2
  49. package/dist/collection/utils/lock-controller.js +36 -0
  50. package/dist/docs.json +1 -1
  51. package/dist/esm/{framework-delegate-2b76c681.js → framework-delegate-aa433dea.js} +21 -2
  52. package/dist/esm/index.js +2 -2
  53. package/dist/esm/ion-action-sheet.entry.js +10 -18
  54. package/dist/esm/ion-alert.entry.js +10 -18
  55. package/dist/esm/ion-app_8.entry.js +2 -1
  56. package/dist/esm/ion-datetime_3.entry.js +10 -18
  57. package/dist/esm/ion-loading.entry.js +10 -18
  58. package/dist/esm/ion-menu_3.entry.js +2 -2
  59. package/dist/esm/ion-modal.entry.js +23 -31
  60. package/dist/esm/ion-nav_2.entry.js +2 -8
  61. package/dist/esm/ion-popover.entry.js +17 -31
  62. package/dist/esm/ion-select_3.entry.js +2 -2
  63. package/dist/esm/ion-tab_2.entry.js +1 -1
  64. package/dist/esm/ion-toast.entry.js +10 -18
  65. package/dist/esm/lock-controller-e8c6c051.js +38 -0
  66. package/dist/esm/{overlays-c3387ec0.js → overlays-e1dadfe6.js} +1 -1
  67. package/dist/esm-es5/framework-delegate-aa433dea.js +4 -0
  68. package/dist/esm-es5/index.js +1 -1
  69. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  70. package/dist/esm-es5/ion-alert.entry.js +1 -1
  71. package/dist/esm-es5/ion-app_8.entry.js +1 -1
  72. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  73. package/dist/esm-es5/ion-loading.entry.js +1 -1
  74. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  75. package/dist/esm-es5/ion-modal.entry.js +1 -1
  76. package/dist/esm-es5/ion-nav_2.entry.js +1 -1
  77. package/dist/esm-es5/ion-popover.entry.js +1 -1
  78. package/dist/esm-es5/ion-select_3.entry.js +1 -1
  79. package/dist/esm-es5/ion-tab_2.entry.js +1 -1
  80. package/dist/esm-es5/ion-toast.entry.js +1 -1
  81. package/dist/esm-es5/lock-controller-e8c6c051.js +4 -0
  82. package/dist/esm-es5/{overlays-c3387ec0.js → overlays-e1dadfe6.js} +1 -1
  83. package/dist/ionic/index.esm.js +1 -1
  84. package/dist/ionic/ionic.esm.js +1 -1
  85. package/dist/ionic/{p-958bde76.entry.js → p-091cd81e.entry.js} +1 -1
  86. package/dist/ionic/{p-c32e09fe.system.entry.js → p-0b68c41d.system.entry.js} +1 -1
  87. package/dist/ionic/p-0cc2bf5a.system.entry.js +4 -0
  88. package/dist/ionic/p-208f640c.entry.js +4 -0
  89. package/dist/ionic/p-2539e967.system.entry.js +4 -0
  90. package/dist/ionic/{p-74bd26b8.system.entry.js → p-28f5715a.system.entry.js} +1 -1
  91. package/dist/ionic/p-38dd9aec.entry.js +4 -0
  92. package/dist/ionic/p-3ff018da.entry.js +4 -0
  93. package/dist/ionic/{p-8074bdd7.system.entry.js → p-45ee211b.system.entry.js} +1 -1
  94. package/dist/ionic/p-5009cb46.entry.js +4 -0
  95. package/dist/ionic/p-53b2a46f.js +4 -0
  96. package/dist/ionic/{p-5ef91692.js → p-582dc7c1.js} +1 -1
  97. package/dist/ionic/{p-c0d1e5a1.entry.js → p-5c17f888.entry.js} +1 -1
  98. package/dist/ionic/{p-8d9475b5.system.js → p-613d4042.system.js} +1 -1
  99. package/dist/ionic/p-647d15d4.system.entry.js +4 -0
  100. package/dist/ionic/p-653f2fc6.entry.js +4 -0
  101. package/dist/ionic/p-721933ff.system.js +1 -1
  102. package/dist/ionic/p-772f6c84.system.js +4 -0
  103. package/dist/ionic/p-87383d00.system.entry.js +4 -0
  104. package/dist/ionic/{p-db46fc66.system.js → p-8843b046.system.js} +1 -1
  105. package/dist/ionic/p-93e47822.entry.js +4 -0
  106. package/dist/ionic/{p-0e6ca480.entry.js → p-98ebc376.entry.js} +1 -1
  107. package/dist/ionic/p-af0bc751.system.entry.js +4 -0
  108. package/dist/ionic/p-b0e9e0b8.system.entry.js +4 -0
  109. package/dist/ionic/p-b287ab05.js +4 -0
  110. package/dist/ionic/{p-81b46714.system.js → p-b32742f3.system.js} +1 -1
  111. package/dist/ionic/p-b3394798.system.entry.js +4 -0
  112. package/dist/ionic/{p-20087c90.entry.js → p-c759a704.entry.js} +1 -1
  113. package/dist/ionic/{p-6b9bf14c.system.entry.js → p-d1d3b740.system.entry.js} +1 -1
  114. package/dist/ionic/{p-8fa43732.system.entry.js → p-d693e765.system.entry.js} +1 -1
  115. package/dist/ionic/{p-5c96dc4e.entry.js → p-f7faa32d.entry.js} +1 -1
  116. package/dist/ionic/p-fabb7294.entry.js +4 -0
  117. package/dist/types/components/action-sheet/action-sheet.d.ts +1 -1
  118. package/dist/types/components/alert/alert.d.ts +1 -1
  119. package/dist/types/components/loading/loading.d.ts +1 -1
  120. package/dist/types/components/modal/modal.d.ts +1 -1
  121. package/dist/types/components/picker/picker.d.ts +1 -1
  122. package/dist/types/components/popover/popover.d.ts +1 -1
  123. package/dist/types/components/toast/toast.d.ts +1 -1
  124. package/dist/types/utils/lock-controller.d.ts +10 -0
  125. package/hydrate/index.js +126 -147
  126. package/package.json +1 -1
  127. package/dist/esm-es5/framework-delegate-2b76c681.js +0 -4
  128. package/dist/ionic/p-06f1f560.system.entry.js +0 -4
  129. package/dist/ionic/p-2936ec7f.system.entry.js +0 -4
  130. package/dist/ionic/p-29b3e70a.entry.js +0 -4
  131. package/dist/ionic/p-2bc49e5d.system.entry.js +0 -4
  132. package/dist/ionic/p-2da3e015.system.entry.js +0 -4
  133. package/dist/ionic/p-423d5a4d.entry.js +0 -4
  134. package/dist/ionic/p-564aaba3.entry.js +0 -4
  135. package/dist/ionic/p-61769039.entry.js +0 -4
  136. package/dist/ionic/p-74723f41.entry.js +0 -4
  137. package/dist/ionic/p-9b3c3564.entry.js +0 -4
  138. package/dist/ionic/p-b34c1ae1.js +0 -4
  139. package/dist/ionic/p-ccea9adc.system.entry.js +0 -4
  140. package/dist/ionic/p-d5db0834.system.entry.js +0 -4
  141. package/dist/ionic/p-d8538837.entry.js +0 -4
  142. package/dist/ionic/p-dd0b6889.system.entry.js +0 -4
@@ -6,10 +6,11 @@
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-484b1104.js');
9
- const frameworkDelegate = require('./framework-delegate-e8174951.js');
9
+ const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
10
10
  const helpers = require('./helpers-ea4ccbcb.js');
11
+ const lockController = require('./lock-controller-4ae2eb59.js');
11
12
  const index$1 = require('./index-cc7dfb7c.js');
12
- const overlays = require('./overlays-0ea06fcb.js');
13
+ const overlays = require('./overlays-5c1706ed.js');
13
14
  const ionicGlobal = require('./ionic-global-f81d8b73.js');
14
15
  const theme = require('./theme-fbc56b3b.js');
15
16
  const index$2 = require('./index-8568bedb.js');
@@ -987,6 +988,7 @@ const Popover = class {
987
988
  this.ionMount = index.createEvent(this, "ionMount", 7);
988
989
  this.parentPopover = null;
989
990
  this.coreDelegate = frameworkDelegate.CoreDelegate();
991
+ this.lockController = lockController.createLockController();
990
992
  this.inline = false;
991
993
  this.focusDescendantOnPresent = false;
992
994
  this.onBackdropTap = () => {
@@ -1160,28 +1162,24 @@ const Popover = class {
1160
1162
  * was dispatched.
1161
1163
  */
1162
1164
  async present(event) {
1165
+ const unlock = await this.lockController.lock();
1163
1166
  if (this.presented) {
1167
+ unlock();
1164
1168
  return;
1165
1169
  }
1166
- /**
1167
- * When using an inline popover
1168
- * and dismissing a popover it is possible to
1169
- * quickly present the popover while it is
1170
- * dismissing. We need to await any current
1171
- * transition to allow the dismiss to finish
1172
- * before presenting again.
1173
- */
1174
- if (this.currentTransition !== undefined) {
1175
- await this.currentTransition;
1176
- }
1177
1170
  const { el } = this;
1178
1171
  const { inline, delegate } = this.getDelegate(true);
1172
+ /**
1173
+ * Emit ionMount so JS Frameworks have an opportunity
1174
+ * to add the child component to the DOM. The child
1175
+ * component will be assigned to this.usersElement below.
1176
+ */
1177
+ this.ionMount.emit();
1179
1178
  this.usersElement = await frameworkDelegate.attachComponent(delegate, el, this.component, ['popover-viewport'], this.componentProps, inline);
1180
1179
  if (!this.keyboardEvents) {
1181
1180
  this.configureKeyboardInteraction();
1182
1181
  }
1183
1182
  this.configureDismissInteraction();
1184
- this.ionMount.emit();
1185
1183
  /**
1186
1184
  * When using the lazy loaded build of Stencil, we need to wait
1187
1185
  * for every Stencil component instance to be ready before presenting
@@ -1204,7 +1202,7 @@ const Popover = class {
1204
1202
  else if (!this.keepContentsMounted) {
1205
1203
  await index$2.waitForMount();
1206
1204
  }
1207
- this.currentTransition = overlays.present(this, 'popoverEnter', iosEnterAnimation, mdEnterAnimation, {
1205
+ await overlays.present(this, 'popoverEnter', iosEnterAnimation, mdEnterAnimation, {
1208
1206
  event: event || this.event,
1209
1207
  size: this.size,
1210
1208
  trigger: this.triggerEl,
@@ -1212,8 +1210,6 @@ const Popover = class {
1212
1210
  side: this.side,
1213
1211
  align: this.alignment,
1214
1212
  });
1215
- await this.currentTransition;
1216
- this.currentTransition = undefined;
1217
1213
  /**
1218
1214
  * If popover is nested and was
1219
1215
  * presented using the "Right" arrow key,
@@ -1223,6 +1219,7 @@ const Popover = class {
1223
1219
  if (this.focusDescendantOnPresent) {
1224
1220
  overlays.focusFirstDescendant(this.el, this.el);
1225
1221
  }
1222
+ unlock();
1226
1223
  }
1227
1224
  /**
1228
1225
  * Dismiss the popover overlay after it has been presented.
@@ -1233,23 +1230,12 @@ const Popover = class {
1233
1230
  * a parent popover if this popover is nested. Defaults to `true`.
1234
1231
  */
1235
1232
  async dismiss(data, role, dismissParentPopover = true) {
1236
- /**
1237
- * When using an inline popover
1238
- * and presenting a popover it is possible to
1239
- * quickly dismiss the popover while it is
1240
- * presenting. We need to await any current
1241
- * transition to allow the present to finish
1242
- * before dismissing again.
1243
- */
1244
- if (this.currentTransition !== undefined) {
1245
- await this.currentTransition;
1246
- }
1233
+ const unlock = await this.lockController.lock();
1247
1234
  const { destroyKeyboardInteraction, destroyDismissInteraction } = this;
1248
1235
  if (dismissParentPopover && this.parentPopover) {
1249
1236
  this.parentPopover.dismiss(data, role, dismissParentPopover);
1250
1237
  }
1251
- this.currentTransition = overlays.dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation, mdLeaveAnimation, this.event);
1252
- const shouldDismiss = await this.currentTransition;
1238
+ const shouldDismiss = await overlays.dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation, mdLeaveAnimation, this.event);
1253
1239
  if (shouldDismiss) {
1254
1240
  if (destroyKeyboardInteraction) {
1255
1241
  destroyKeyboardInteraction();
@@ -1267,7 +1253,7 @@ const Popover = class {
1267
1253
  const { delegate } = this.getDelegate();
1268
1254
  await frameworkDelegate.detachComponent(delegate, this.usersElement);
1269
1255
  }
1270
- this.currentTransition = undefined;
1256
+ unlock();
1271
1257
  return shouldDismiss;
1272
1258
  }
1273
1259
  /**
@@ -10,14 +10,14 @@ const formController = require('./form-controller-5e223b54.js');
10
10
  const notchController = require('./notch-controller-c27fe0b7.js');
11
11
  const helpers = require('./helpers-ea4ccbcb.js');
12
12
  const index$1 = require('./index-cc7dfb7c.js');
13
- const overlays = require('./overlays-0ea06fcb.js');
13
+ const overlays = require('./overlays-5c1706ed.js');
14
14
  const dir = require('./dir-f1e0ca26.js');
15
15
  const theme = require('./theme-fbc56b3b.js');
16
16
  const watchOptions = require('./watch-options-f3f77e54.js');
17
17
  const index$2 = require('./index-d8d1fc0b.js');
18
18
  const ionicGlobal = require('./ionic-global-f81d8b73.js');
19
19
  require('./index-306a7476.js');
20
- require('./framework-delegate-e8174951.js');
20
+ require('./framework-delegate-c0873a6f.js');
21
21
  require('./hardware-back-button-b67c8e75.js');
22
22
 
23
23
  const selectIosCss = ":host{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--placeholder-color:currentColor;--placeholder-opacity:0.6;--background:transparent;--border-style:solid;--highlight-color-focused:var(--ion-color-primary, #3880ff);--highlight-color-valid:var(--ion-color-success, #2dd36f);--highlight-color-invalid:var(--ion-color-danger, #eb445a);--highlight-color:var(--highlight-color-focused);display:block;position:relative;font-family:var(--ion-font-family, inherit);white-space:nowrap;cursor:pointer;z-index:2}:host(:not(.legacy-select)){width:100%}:host(.ion-color){--highlight-color-focused:var(--ion-color-base)}:host(.legacy-select){-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;overflow:hidden}:host(.in-item.legacy-select){position:static;max-width:45%}:host(.select-disabled){pointer-events:none}:host(.ion-focused) button{border:2px solid #5e9ed6}:host([slot=start]:not(.legacy-select)),:host([slot=end]:not(.legacy-select)){width:auto}.select-placeholder{color:var(--placeholder-color);opacity:var(--placeholder-opacity)}:host(.legacy-select) label{top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}@supports (inset-inline-start: 0){:host(.legacy-select) label{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.legacy-select) label{left:0}:host-context([dir=rtl]):host(.legacy-select) label,:host-context([dir=rtl]).legacy-select label{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.legacy-select) label:dir(rtl){left:unset;right:unset;right:0}}}:host(.legacy-select) label::-moz-focus-inner{border:0}button{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.select-icon{-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0;position:relative}:host(.in-item-color) .select-icon{color:inherit}:host(.select-label-placement-stacked) .select-icon,:host(.select-label-placement-floating) .select-icon{position:absolute;height:100%}:host(.select-ltr.select-label-placement-stacked) .select-icon,:host(.select-ltr.select-label-placement-floating) .select-icon{right:var(--padding-end, 0)}:host(.select-rtl.select-label-placement-stacked) .select-icon,:host(.select-rtl.select-label-placement-floating) .select-icon{left:var(--padding-start, 0)}.select-text{-ms-flex:1;flex:1;min-width:16px;font-size:inherit;text-overflow:ellipsis;white-space:inherit;overflow:hidden}.select-wrapper{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;-webkit-transition:background-color 15ms linear;transition:background-color 15ms linear;background:var(--background);line-height:normal;cursor:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}.select-wrapper .select-placeholder{-webkit-transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}:host(.ion-touched.ion-invalid){--highlight-color:var(--highlight-color-invalid)}:host(.ion-valid){--highlight-color:var(--highlight-color-valid)}.label-text-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;max-width:200px;-webkit-transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);pointer-events:none}.label-text,::slotted([slot=label]){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label-text-wrapper-hidden,.select-outline-notch-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden}:host(.select-justify-space-between) .select-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.select-justify-start) .select-wrapper{-ms-flex-pack:start;justify-content:start}:host(.select-justify-end) .select-wrapper{-ms-flex-pack:end;justify-content:end}:host(.select-label-placement-start) .select-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.select-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.select-label-placement-end) .select-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.select-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.select-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.select-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.select-label-placement-stacked) .select-wrapper,:host(.select-label-placement-floating) .select-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:start}:host(.select-label-placement-stacked) .label-text-wrapper,:host(.select-label-placement-floating) .label-text-wrapper{max-width:100%}:host(.select-ltr.select-label-placement-stacked) .label-text-wrapper,:host(.select-ltr.select-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host(.select-rtl.select-label-placement-stacked) .label-text-wrapper,:host(.select-rtl.select-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}:host(.select-label-placement-stacked) .native-wrapper,:host(.select-label-placement-floating) .native-wrapper{margin-left:0;margin-right:0;margin-top:1px;margin-bottom:0;-ms-flex-positive:1;flex-grow:1;width:100%}:host(.select-label-placement-floating) .label-text-wrapper{-webkit-transform:translateY(100%) scale(1);transform:translateY(100%) scale(1)}:host(.select-label-placement-floating) .native-wrapper .select-placeholder{opacity:0}:host(.select-expanded.select-label-placement-floating) .native-wrapper .select-placeholder,:host(.ion-focused.select-label-placement-floating) .native-wrapper .select-placeholder,:host(.has-value.select-label-placement-floating) .native-wrapper .select-placeholder{opacity:1}:host(.select-label-placement-stacked) .label-text-wrapper,:host(.select-expanded.select-label-placement-floating) .label-text-wrapper,:host(.ion-focused.select-label-placement-floating) .label-text-wrapper,:host(.has-value.select-label-placement-floating) .label-text-wrapper{-webkit-transform:translateY(50%) scale(0.75);transform:translateY(50%) scale(0.75);max-width:calc(100% / 0.75)}:host(.legacy-select){--padding-top:10px;--padding-end:8px;--padding-bottom:10px;--padding-start:16px}:host(:not(.legacy-select)){min-height:44px}:host(.select-label-placement-floating),:host(.select-label-placement-stacked){min-height:56px}.select-icon{width:18px;height:18px;color:var(--ion-color-step-650, #595959)}:host(.select-label-placement-stacked) .native-wrapper,:host(.select-label-placement-floating) .native-wrapper{width:calc(100% - 18px - 4px)}:host(.select-disabled){opacity:0.3}";
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-484b1104.js');
9
- const frameworkDelegate = require('./framework-delegate-e8174951.js');
9
+ const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
10
10
  require('./helpers-ea4ccbcb.js');
11
11
 
12
12
  const tabCss = ":host(.tab-hidden){display:none !important}";
@@ -8,12 +8,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
8
8
  const index = require('./index-484b1104.js');
9
9
  const config = require('./config-d5882735.js');
10
10
  const helpers = require('./helpers-ea4ccbcb.js');
11
+ const lockController = require('./lock-controller-4ae2eb59.js');
11
12
  const index$1 = require('./index-cc7dfb7c.js');
12
- const overlays = require('./overlays-0ea06fcb.js');
13
+ const overlays = require('./overlays-5c1706ed.js');
13
14
  const theme = require('./theme-fbc56b3b.js');
14
15
  const ionicGlobal = require('./ionic-global-f81d8b73.js');
15
16
  const animation = require('./animation-2bb33618.js');
16
- require('./framework-delegate-e8174951.js');
17
+ require('./framework-delegate-c0873a6f.js');
17
18
  require('./hardware-back-button-b67c8e75.js');
18
19
  require('./index-306a7476.js');
19
20
 
@@ -126,6 +127,7 @@ const Toast = class {
126
127
  this.willDismissShorthand = index.createEvent(this, "willDismiss", 7);
127
128
  this.didDismissShorthand = index.createEvent(this, "didDismiss", 7);
128
129
  this.delegateController = overlays.createDelegateController(this);
130
+ this.lockController = lockController.createLockController();
129
131
  this.triggerController = overlays.createTriggerController();
130
132
  this.customHTMLEnabled = ionicGlobal.config.get('innerHTMLTemplatesEnabled', config.ENABLE_HTML_CONTENT_DEFAULT);
131
133
  this.presented = false;
@@ -195,30 +197,19 @@ const Toast = class {
195
197
  * Present the toast overlay after it has been created.
196
198
  */
197
199
  async present() {
198
- /**
199
- * When using an inline toast
200
- * and dismissing a toast it is possible to
201
- * quickly present the toast while it is
202
- * dismissing. We need to await any current
203
- * transition to allow the dismiss to finish
204
- * before presenting again.
205
- */
206
- if (this.currentTransition !== undefined) {
207
- await this.currentTransition;
208
- }
200
+ const unlock = await this.lockController.lock();
209
201
  await this.delegateController.attachViewToDom();
210
- this.currentTransition = overlays.present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
211
- await this.currentTransition;
202
+ await overlays.present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
212
203
  /**
213
204
  * Content is revealed to screen readers after
214
205
  * the transition to avoid jank since this
215
206
  * state updates will cause a re-render.
216
207
  */
217
208
  this.revealContentToScreenReader = true;
218
- this.currentTransition = undefined;
219
209
  if (this.duration > 0) {
220
210
  this.durationTimeout = setTimeout(() => this.dismiss(undefined, 'timeout'), this.duration);
221
211
  }
212
+ unlock();
222
213
  }
223
214
  /**
224
215
  * Dismiss the toast overlay after it has been presented.
@@ -230,15 +221,16 @@ const Toast = class {
230
221
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
231
222
  */
232
223
  async dismiss(data, role) {
224
+ const unlock = await this.lockController.lock();
233
225
  if (this.durationTimeout) {
234
226
  clearTimeout(this.durationTimeout);
235
227
  }
236
- this.currentTransition = overlays.dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
237
- const dismissed = await this.currentTransition;
228
+ const dismissed = await overlays.dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
238
229
  if (dismissed) {
239
230
  this.delegateController.removeViewFromDom();
240
231
  this.revealContentToScreenReader = false;
241
232
  }
233
+ unlock();
242
234
  return dismissed;
243
235
  }
244
236
  /**
@@ -0,0 +1,40 @@
1
+ /*!
2
+ * (C) Ionic http://ionicframework.com - MIT License
3
+ */
4
+ 'use strict';
5
+
6
+ /**
7
+ * Creates a lock controller.
8
+ *
9
+ * Claiming a lock means that nothing else can acquire the lock until it is released.
10
+ * This can momentarily prevent execution of code that needs to wait for the earlier code to finish.
11
+ * For example, this can be used to prevent multiple transitions from occurring at the same time.
12
+ */
13
+ const createLockController = () => {
14
+ let waitPromise;
15
+ /**
16
+ * When lock() is called, the lock is claimed.
17
+ * Once a lock has been claimed, it cannot be claimed again until it is released.
18
+ * When this function gets resolved, the lock is released, allowing it to be claimed again.
19
+ *
20
+ * @example ```tsx
21
+ * const unlock = await this.lockController.lock();
22
+ * // do other stuff
23
+ * unlock();
24
+ * ```
25
+ */
26
+ const lock = async () => {
27
+ const p = waitPromise;
28
+ let resolve;
29
+ waitPromise = new Promise((r) => (resolve = r));
30
+ if (p !== undefined) {
31
+ await p;
32
+ }
33
+ return resolve;
34
+ };
35
+ return {
36
+ lock,
37
+ };
38
+ };
39
+
40
+ exports.createLockController = createLockController;
@@ -4,7 +4,7 @@
4
4
  'use strict';
5
5
 
6
6
  const ionicGlobal = require('./ionic-global-f81d8b73.js');
7
- const frameworkDelegate = require('./framework-delegate-e8174951.js');
7
+ const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
8
8
  const hardwareBackButton = require('./hardware-back-button-b67c8e75.js');
9
9
  const helpers = require('./helpers-ea4ccbcb.js');
10
10
  const index = require('./index-cc7dfb7c.js');
@@ -4,6 +4,7 @@
4
4
  import { Host, h, readTask } from "@stencil/core";
5
5
  import { createButtonActiveGesture } from "../../utils/gesture/button-active";
6
6
  import { raf } from "../../utils/helpers";
7
+ import { createLockController } from "../../utils/lock-controller";
7
8
  import { BACKDROP, createDelegateController, createTriggerController, dismiss, eventMethod, isCancel, prepareOverlay, present, safeCall, setOverlayId, } from "../../utils/overlays";
8
9
  import { getClassMap } from "../../utils/theme";
9
10
  import { getIonMode } from "../../global/ionic-global";
@@ -17,6 +18,7 @@ import { mdLeaveAnimation } from "./animations/md.leave";
17
18
  export class ActionSheet {
18
19
  constructor() {
19
20
  this.delegateController = createDelegateController(this);
21
+ this.lockController = createLockController();
20
22
  this.triggerController = createTriggerController();
21
23
  this.presented = false;
22
24
  this.onBackdropTap = () => {
@@ -64,21 +66,10 @@ export class ActionSheet {
64
66
  * Present the action sheet overlay after it has been created.
65
67
  */
66
68
  async present() {
67
- /**
68
- * When using an inline action sheet
69
- * and dismissing a action sheet it is possible to
70
- * quickly present the action sheet while it is
71
- * dismissing. We need to await any current
72
- * transition to allow the dismiss to finish
73
- * before presenting again.
74
- */
75
- if (this.currentTransition !== undefined) {
76
- await this.currentTransition;
77
- }
69
+ const unlock = await this.lockController.lock();
78
70
  await this.delegateController.attachViewToDom();
79
- this.currentTransition = present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
80
- await this.currentTransition;
81
- this.currentTransition = undefined;
71
+ await present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
72
+ unlock();
82
73
  }
83
74
  /**
84
75
  * Dismiss the action sheet overlay after it has been presented.
@@ -90,11 +81,12 @@ export class ActionSheet {
90
81
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
91
82
  */
92
83
  async dismiss(data, role) {
93
- this.currentTransition = dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation, mdLeaveAnimation);
94
- const dismissed = await this.currentTransition;
84
+ const unlock = await this.lockController.lock();
85
+ const dismissed = await dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation, mdLeaveAnimation);
95
86
  if (dismissed) {
96
87
  this.delegateController.removeViewFromDom();
97
88
  }
89
+ unlock();
98
90
  return dismissed;
99
91
  }
100
92
  /**
@@ -5,6 +5,7 @@ import { Host, forceUpdate, h } from "@stencil/core";
5
5
  import { ENABLE_HTML_CONTENT_DEFAULT } from "../../utils/config";
6
6
  import { createButtonActiveGesture } from "../../utils/gesture/button-active";
7
7
  import { raf } from "../../utils/helpers";
8
+ import { createLockController } from "../../utils/lock-controller";
8
9
  import { createDelegateController, createTriggerController, BACKDROP, dismiss, eventMethod, isCancel, prepareOverlay, present, safeCall, setOverlayId, } from "../../utils/overlays";
9
10
  import { sanitizeDOMString } from "../../utils/sanitization/index";
10
11
  import { getClassMap } from "../../utils/theme";
@@ -21,6 +22,7 @@ import { mdLeaveAnimation } from "./animations/md.leave";
21
22
  export class Alert {
22
23
  constructor() {
23
24
  this.delegateController = createDelegateController(this);
25
+ this.lockController = createLockController();
24
26
  this.triggerController = createTriggerController();
25
27
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
26
28
  this.processedInputs = [];
@@ -187,21 +189,10 @@ export class Alert {
187
189
  * Present the alert overlay after it has been created.
188
190
  */
189
191
  async present() {
190
- /**
191
- * When using an inline alert
192
- * and dismissing an alert it is possible to
193
- * quickly present the alert while it is
194
- * dismissing. We need to await any current
195
- * transition to allow the dismiss to finish
196
- * before presenting again.
197
- */
198
- if (this.currentTransition !== undefined) {
199
- await this.currentTransition;
200
- }
192
+ const unlock = await this.lockController.lock();
201
193
  await this.delegateController.attachViewToDom();
202
- this.currentTransition = present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation);
203
- await this.currentTransition;
204
- this.currentTransition = undefined;
194
+ await present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation);
195
+ unlock();
205
196
  }
206
197
  /**
207
198
  * Dismiss the alert overlay after it has been presented.
@@ -213,11 +204,12 @@ export class Alert {
213
204
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
214
205
  */
215
206
  async dismiss(data, role) {
216
- this.currentTransition = dismiss(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation);
217
- const dismissed = await this.currentTransition;
207
+ const unlock = await this.lockController.lock();
208
+ const dismissed = await dismiss(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation);
218
209
  if (dismissed) {
219
210
  this.delegateController.removeViewFromDom();
220
211
  }
212
+ unlock();
221
213
  return dismissed;
222
214
  }
223
215
  /**
@@ -4,23 +4,39 @@
4
4
  import { expect } from "@playwright/test";
5
5
  import { configs, test } from "../../../../utils/test/playwright/index";
6
6
  configs().forEach(({ title, screenshot, config }) => {
7
- test(title('should not have visual regressions'), async ({ page }) => {
8
- await page.goto(`/src/components/datetime/test/presentation`, config);
9
- await page.waitForSelector('.datetime-ready');
10
- const datetime = page.locator('ion-datetime');
11
- const compares = [];
12
- const presentations = ['date-time', 'time-date', 'time', 'date', 'month-year', 'month', 'year'];
13
- for (const presentation of presentations) {
14
- await page.locator('select').selectOption(presentation);
15
- await page.waitForChanges();
16
- compares.push({
17
- presentation,
18
- screenshot: datetime,
19
- });
20
- }
21
- for (const compare of compares) {
22
- await expect(compare.screenshot).toHaveScreenshot(screenshot(`datetime-presentation-${compare.presentation}-diff`));
23
- }
7
+ test.describe(title('datetime: presentation rendering'), () => {
8
+ let presentationFixture;
9
+ test.beforeEach(({ page }) => {
10
+ presentationFixture = new DatetimePresentationFixture(page);
11
+ });
12
+ test('should not have visual regressions with date-time presentation', async () => {
13
+ await presentationFixture.goto('date-time', config);
14
+ await presentationFixture.screenshot('datetime-presentation-date-time-diff', screenshot);
15
+ });
16
+ test('should not have visual regressions with time-date presentation', async () => {
17
+ await presentationFixture.goto('time-date', config);
18
+ await presentationFixture.screenshot('datetime-presentation-time-date-diff', screenshot);
19
+ });
20
+ test('should not have visual regressions with time presentation', async () => {
21
+ await presentationFixture.goto('time', config);
22
+ await presentationFixture.screenshot('datetime-presentation-time-diff', screenshot);
23
+ });
24
+ test('should not have visual regressions with date presentation', async () => {
25
+ await presentationFixture.goto('date', config);
26
+ await presentationFixture.screenshot('datetime-presentation-date-diff', screenshot);
27
+ });
28
+ test('should not have visual regressions with month-year presentation', async () => {
29
+ await presentationFixture.goto('month-year', config);
30
+ await presentationFixture.screenshot('datetime-presentation-month-year-diff', screenshot);
31
+ });
32
+ test('should not have visual regressions with month presentation', async () => {
33
+ await presentationFixture.goto('month', config);
34
+ await presentationFixture.screenshot('datetime-presentation-month-diff', screenshot);
35
+ });
36
+ test('should not have visual regressions with year presentation', async () => {
37
+ await presentationFixture.goto('year', config);
38
+ await presentationFixture.screenshot('datetime-presentation-year-diff', screenshot);
39
+ });
24
40
  });
25
41
  });
26
42
  /**
@@ -112,6 +128,21 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>
112
128
  });
113
129
  });
114
130
  });
131
+ class DatetimePresentationFixture {
132
+ constructor(page) {
133
+ this.page = page;
134
+ }
135
+ async goto(presentation, config) {
136
+ await this.page.setContent(`
137
+ <ion-datetime presentation="${presentation}" value="2010-03-10T13:00:00"></ion-datetime>
138
+ `, config);
139
+ await this.page.waitForSelector('.datetime-ready');
140
+ this.datetime = this.page.locator('ion-datetime');
141
+ }
142
+ async screenshot(name, screenshotFn) {
143
+ await expect(this.datetime).toHaveScreenshot(screenshotFn(name));
144
+ }
145
+ }
115
146
  class TimePickerFixture {
116
147
  constructor(page) {
117
148
  this.page = page;
@@ -4,6 +4,7 @@
4
4
  import { Host, h } 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 { BACKDROP, dismiss, eventMethod, prepareOverlay, present, createDelegateController, createTriggerController, setOverlayId, } from "../../utils/overlays";
8
9
  import { sanitizeDOMString } from "../../utils/sanitization/index";
9
10
  import { getClassMap } from "../../utils/theme";
@@ -20,6 +21,7 @@ import { mdLeaveAnimation } from "./animations/md.leave";
20
21
  export class Loading {
21
22
  constructor() {
22
23
  this.delegateController = createDelegateController(this);
24
+ this.lockController = createLockController();
23
25
  this.triggerController = createTriggerController();
24
26
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
25
27
  this.presented = false;
@@ -85,24 +87,13 @@ export class Loading {
85
87
  * Present the loading overlay after it has been created.
86
88
  */
87
89
  async present() {
88
- /**
89
- * When using an inline loading indicator
90
- * and dismissing a loading indicator it is possible to
91
- * quickly present the loading indicator while it is
92
- * dismissing. We need to await any current
93
- * transition to allow the dismiss to finish
94
- * before presenting again.
95
- */
96
- if (this.currentTransition !== undefined) {
97
- await this.currentTransition;
98
- }
90
+ const unlock = await this.lockController.lock();
99
91
  await this.delegateController.attachViewToDom();
100
- this.currentTransition = present(this, 'loadingEnter', iosEnterAnimation, mdEnterAnimation);
101
- await this.currentTransition;
92
+ await present(this, 'loadingEnter', iosEnterAnimation, mdEnterAnimation);
102
93
  if (this.duration > 0) {
103
94
  this.durationTimeout = setTimeout(() => this.dismiss(), this.duration + 10);
104
95
  }
105
- this.currentTransition = undefined;
96
+ unlock();
106
97
  }
107
98
  /**
108
99
  * Dismiss the loading overlay after it has been presented.
@@ -114,14 +105,15 @@ export class Loading {
114
105
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
115
106
  */
116
107
  async dismiss(data, role) {
108
+ const unlock = await this.lockController.lock();
117
109
  if (this.durationTimeout) {
118
110
  clearTimeout(this.durationTimeout);
119
111
  }
120
- this.currentTransition = dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation, mdLeaveAnimation);
121
- const dismissed = await this.currentTransition;
112
+ const dismissed = await dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation, mdLeaveAnimation);
122
113
  if (dismissed) {
123
114
  this.delegateController.removeViewFromDom();
124
115
  }
116
+ unlock();
125
117
  return dismissed;
126
118
  }
127
119
  /**