@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.
- package/components/action-sheet.js +8 -16
- package/components/alert.js +8 -16
- package/components/framework-delegate.js +21 -2
- package/components/ion-loading.js +8 -16
- package/components/ion-modal.js +21 -29
- package/components/ion-picker.js +8 -16
- package/components/ion-router-outlet.js +1 -0
- package/components/ion-toast.js +8 -16
- package/components/label.js +2 -2
- package/components/lock-controller.js +38 -0
- package/components/popover.js +15 -29
- package/dist/cjs/{framework-delegate-e8174951.js → framework-delegate-c0873a6f.js} +21 -2
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/ion-action-sheet.cjs.entry.js +10 -18
- package/dist/cjs/ion-alert.cjs.entry.js +10 -18
- package/dist/cjs/ion-app_8.cjs.entry.js +2 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +10 -18
- package/dist/cjs/ion-item_8.cjs.entry.js +2 -2
- package/dist/cjs/ion-loading.cjs.entry.js +10 -18
- package/dist/cjs/ion-menu_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-modal.cjs.entry.js +23 -31
- package/dist/cjs/ion-nav_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-popover.cjs.entry.js +17 -31
- package/dist/cjs/ion-select_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-toast.cjs.entry.js +10 -18
- package/dist/cjs/lock-controller-4ae2eb59.js +40 -0
- package/dist/cjs/{overlays-0ea06fcb.js → overlays-5c1706ed.js} +1 -1
- package/dist/collection/components/action-sheet/action-sheet.js +8 -16
- package/dist/collection/components/alert/alert.js +8 -16
- package/dist/collection/components/checkbox/test/color/checkbox.e2e.js +2 -2
- package/dist/collection/components/checkbox/test/item/checkbox.e2e.js +4 -4
- package/dist/collection/components/checkbox/test/label/checkbox.e2e.js +10 -10
- package/dist/collection/components/checkbox/test/legacy/basic/checkbox.e2e.js +1 -1
- package/dist/collection/components/checkbox/test/legacy/indeterminate/checkbox.e2e.js +1 -1
- package/dist/collection/components/checkbox/test/states/checkbox.e2e.js +4 -4
- package/dist/collection/components/datetime/test/custom/datetime.e2e.js +0 -7
- package/dist/collection/components/datetime/test/presentation/datetime.e2e.js +48 -17
- package/dist/collection/components/input/test/bottom-content/input.e2e.js +7 -7
- package/dist/collection/components/input/test/card/input.e2e.js +1 -1
- package/dist/collection/components/input/test/color/input.e2e.js +15 -15
- package/dist/collection/components/input/test/fill/input.e2e.js +10 -10
- package/dist/collection/components/input/test/highlight/input.e2e.js +9 -9
- package/dist/collection/components/input/test/item/input.e2e.js +2 -2
- package/dist/collection/components/input/test/label-placement/input.e2e.js +16 -16
- package/dist/collection/components/input/test/legacy/basic/input.e2e.js +10 -10
- package/dist/collection/components/input/test/states/input.e2e.js +2 -2
- package/dist/collection/components/label/label.ios.css +2 -4
- package/dist/collection/components/label/label.md.css +2 -4
- package/dist/collection/components/loading/loading.js +8 -16
- package/dist/collection/components/modal/modal.js +21 -29
- package/dist/collection/components/picker/picker.js +8 -16
- package/dist/collection/components/popover/popover.js +15 -29
- package/dist/collection/components/popover/test/async/popover.e2e.js +42 -0
- package/dist/collection/components/radio/test/color/radio.e2e.js +2 -2
- package/dist/collection/components/radio/test/item/radio.e2e.js +3 -3
- package/dist/collection/components/radio/test/label-placement/radio.e2e.js +9 -9
- package/dist/collection/components/radio/test/states/radio.e2e.js +4 -4
- package/dist/collection/components/range/test/color/range.e2e.js +1 -1
- package/dist/collection/components/range/test/custom/range.e2e.js +1 -1
- package/dist/collection/components/range/test/item/range.e2e.js +3 -3
- package/dist/collection/components/range/test/label/range.e2e.js +12 -12
- package/dist/collection/components/range/test/legacy/a11y/range.e2e.js +3 -3
- package/dist/collection/components/range/test/legacy/active-bar-start/range.e2e.js +1 -1
- package/dist/collection/components/range/test/legacy/basic/range.e2e.js +1 -1
- package/dist/collection/components/range/test/states/range.e2e.js +4 -4
- package/dist/collection/components/router-outlet/router-outlet.js +1 -0
- package/dist/collection/components/select/test/card/select.e2e.js +1 -1
- package/dist/collection/components/select/test/color/select.e2e.js +3 -3
- package/dist/collection/components/select/test/fill/select.e2e.js +10 -10
- package/dist/collection/components/select/test/highlight/select.e2e.js +3 -3
- package/dist/collection/components/select/test/item/select.e2e.js +2 -2
- package/dist/collection/components/select/test/label/select.e2e.js +20 -20
- package/dist/collection/components/select/test/states/select.e2e.js +4 -4
- package/dist/collection/components/textarea/test/bottom-content/textarea.e2e.js +6 -6
- package/dist/collection/components/textarea/test/card/textarea.e2e.js +1 -1
- package/dist/collection/components/textarea/test/color/textarea.e2e.js +15 -15
- package/dist/collection/components/textarea/test/fill/textarea.e2e.js +10 -10
- package/dist/collection/components/textarea/test/highlight/textarea.e2e.js +9 -9
- package/dist/collection/components/textarea/test/item/textarea.e2e.js +2 -2
- package/dist/collection/components/textarea/test/label-placement/textarea.e2e.js +21 -21
- package/dist/collection/components/textarea/test/legacy/autogrow/textarea.e2e.js +5 -5
- package/dist/collection/components/textarea/test/states/textarea.e2e.js +2 -2
- package/dist/collection/components/toast/toast.js +8 -16
- package/dist/collection/components/toggle/test/color/toggle.e2e.js +2 -2
- package/dist/collection/components/toggle/test/item/toggle.e2e.js +4 -4
- package/dist/collection/components/toggle/test/label/toggle.e2e.js +9 -9
- package/dist/collection/components/toggle/test/legacy/enable-on-off-labels/toggle.e2e.js +2 -2
- package/dist/collection/components/toggle/test/legacy/sizes/toggle.e2e.js +1 -1
- package/dist/collection/components/toggle/test/states/toggle.e2e.js +3 -3
- package/dist/collection/utils/framework-delegate.js +21 -2
- package/dist/collection/utils/lock-controller.js +36 -0
- package/dist/docs.json +1 -1
- package/dist/esm/{framework-delegate-2b76c681.js → framework-delegate-aa433dea.js} +21 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/ion-action-sheet.entry.js +10 -18
- package/dist/esm/ion-alert.entry.js +10 -18
- package/dist/esm/ion-app_8.entry.js +2 -1
- package/dist/esm/ion-datetime_3.entry.js +10 -18
- package/dist/esm/ion-item_8.entry.js +2 -2
- package/dist/esm/ion-loading.entry.js +10 -18
- package/dist/esm/ion-menu_3.entry.js +2 -2
- package/dist/esm/ion-modal.entry.js +23 -31
- package/dist/esm/ion-nav_2.entry.js +1 -1
- package/dist/esm/ion-popover.entry.js +17 -31
- package/dist/esm/ion-select_3.entry.js +2 -2
- package/dist/esm/ion-tab_2.entry.js +1 -1
- package/dist/esm/ion-toast.entry.js +10 -18
- package/dist/esm/lock-controller-e8c6c051.js +38 -0
- package/dist/esm/{overlays-c3387ec0.js → overlays-e1dadfe6.js} +1 -1
- package/dist/esm-es5/framework-delegate-aa433dea.js +4 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
- package/dist/esm-es5/ion-alert.entry.js +1 -1
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-item_8.entry.js +1 -1
- package/dist/esm-es5/ion-loading.entry.js +1 -1
- package/dist/esm-es5/ion-menu_3.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-nav_2.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-tab_2.entry.js +1 -1
- package/dist/esm-es5/ion-toast.entry.js +1 -1
- package/dist/esm-es5/lock-controller-e8c6c051.js +4 -0
- package/dist/esm-es5/{overlays-c3387ec0.js → overlays-e1dadfe6.js} +1 -1
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-958bde76.entry.js → p-091cd81e.entry.js} +1 -1
- package/dist/ionic/{p-d1356034.system.entry.js → p-0b68c41d.system.entry.js} +1 -1
- package/dist/ionic/p-0cc2bf5a.system.entry.js +4 -0
- package/dist/ionic/p-208f640c.entry.js +4 -0
- package/dist/ionic/p-2539e967.system.entry.js +4 -0
- package/dist/ionic/{p-74bd26b8.system.entry.js → p-28f5715a.system.entry.js} +1 -1
- package/dist/ionic/{p-b9312889.entry.js → p-341d5877.entry.js} +1 -1
- package/dist/ionic/p-38dd9aec.entry.js +4 -0
- package/dist/ionic/p-3ff018da.entry.js +4 -0
- package/dist/ionic/{p-8074bdd7.system.entry.js → p-45ee211b.system.entry.js} +1 -1
- package/dist/ionic/p-5009cb46.entry.js +4 -0
- package/dist/ionic/p-53b2a46f.js +4 -0
- package/dist/ionic/{p-5ef91692.js → p-582dc7c1.js} +1 -1
- package/dist/ionic/{p-79e30193.system.entry.js → p-5ba27716.system.entry.js} +1 -1
- package/dist/ionic/{p-c0d1e5a1.entry.js → p-5c17f888.entry.js} +1 -1
- package/dist/ionic/{p-8d9475b5.system.js → p-613d4042.system.js} +1 -1
- package/dist/ionic/p-647d15d4.system.entry.js +4 -0
- package/dist/ionic/p-653f2fc6.entry.js +4 -0
- package/dist/ionic/p-721933ff.system.js +1 -1
- package/dist/ionic/p-772f6c84.system.js +4 -0
- package/dist/ionic/p-87383d00.system.entry.js +4 -0
- package/dist/ionic/{p-db46fc66.system.js → p-8843b046.system.js} +1 -1
- package/dist/ionic/p-93e47822.entry.js +4 -0
- package/dist/ionic/{p-229df0d8.entry.js → p-98ebc376.entry.js} +1 -1
- package/dist/ionic/p-af0bc751.system.entry.js +4 -0
- package/dist/ionic/p-b0e9e0b8.system.entry.js +4 -0
- package/dist/ionic/p-b287ab05.js +4 -0
- package/dist/ionic/{p-81b46714.system.js → p-b32742f3.system.js} +1 -1
- package/dist/ionic/p-b3394798.system.entry.js +4 -0
- package/dist/ionic/{p-20087c90.entry.js → p-c759a704.entry.js} +1 -1
- package/dist/ionic/{p-6b9bf14c.system.entry.js → p-d1d3b740.system.entry.js} +1 -1
- package/dist/ionic/{p-8fa43732.system.entry.js → p-d693e765.system.entry.js} +1 -1
- package/dist/ionic/{p-5c96dc4e.entry.js → p-f7faa32d.entry.js} +1 -1
- package/dist/ionic/p-fabb7294.entry.js +4 -0
- package/dist/types/components/action-sheet/action-sheet.d.ts +1 -1
- package/dist/types/components/alert/alert.d.ts +1 -1
- package/dist/types/components/loading/loading.d.ts +1 -1
- package/dist/types/components/modal/modal.d.ts +1 -1
- package/dist/types/components/picker/picker.d.ts +1 -1
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/toast/toast.d.ts +1 -1
- package/dist/types/utils/lock-controller.d.ts +10 -0
- package/hydrate/index.js +127 -142
- package/package.json +1 -1
- package/dist/esm-es5/framework-delegate-2b76c681.js +0 -4
- package/dist/ionic/p-06f1f560.system.entry.js +0 -4
- package/dist/ionic/p-2936ec7f.system.entry.js +0 -4
- package/dist/ionic/p-29b3e70a.entry.js +0 -4
- package/dist/ionic/p-2bc49e5d.system.entry.js +0 -4
- package/dist/ionic/p-2da3e015.system.entry.js +0 -4
- package/dist/ionic/p-423d5a4d.entry.js +0 -4
- package/dist/ionic/p-564aaba3.entry.js +0 -4
- package/dist/ionic/p-61769039.entry.js +0 -4
- package/dist/ionic/p-74723f41.entry.js +0 -4
- package/dist/ionic/p-9b3c3564.entry.js +0 -4
- package/dist/ionic/p-b34c1ae1.js +0 -4
- package/dist/ionic/p-ccea9adc.system.entry.js +0 -4
- package/dist/ionic/p-d5db0834.system.entry.js +0 -4
- package/dist/ionic/p-d8538837.entry.js +0 -4
- package/dist/ionic/p-dd0b6889.system.entry.js +0 -4
|
@@ -7,11 +7,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
7
7
|
|
|
8
8
|
const index$3 = require('./index-484b1104.js');
|
|
9
9
|
const index$2 = require('./index-10873539.js');
|
|
10
|
-
const frameworkDelegate = require('./framework-delegate-
|
|
10
|
+
const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
|
|
11
11
|
const helpers = require('./helpers-ea4ccbcb.js');
|
|
12
|
+
const lockController = require('./lock-controller-4ae2eb59.js');
|
|
12
13
|
const index$4 = require('./index-cc7dfb7c.js');
|
|
13
14
|
const capacitor = require('./capacitor-2ffba62a.js');
|
|
14
|
-
const overlays = require('./overlays-
|
|
15
|
+
const overlays = require('./overlays-5c1706ed.js');
|
|
15
16
|
const theme = require('./theme-fbc56b3b.js');
|
|
16
17
|
const index$5 = require('./index-8568bedb.js');
|
|
17
18
|
const ionicGlobal = require('./ionic-global-f81d8b73.js');
|
|
@@ -1117,6 +1118,7 @@ const Modal = class {
|
|
|
1117
1118
|
this.willDismissShorthand = index$3.createEvent(this, "willDismiss", 7);
|
|
1118
1119
|
this.didDismissShorthand = index$3.createEvent(this, "didDismiss", 7);
|
|
1119
1120
|
this.ionMount = index$3.createEvent(this, "ionMount", 7);
|
|
1121
|
+
this.lockController = lockController.createLockController();
|
|
1120
1122
|
this.triggerController = overlays.createTriggerController();
|
|
1121
1123
|
this.coreDelegate = frameworkDelegate.CoreDelegate();
|
|
1122
1124
|
this.isSheetModal = false;
|
|
@@ -1281,29 +1283,25 @@ const Modal = class {
|
|
|
1281
1283
|
* Present the modal overlay after it has been created.
|
|
1282
1284
|
*/
|
|
1283
1285
|
async present() {
|
|
1286
|
+
const unlock = await this.lockController.lock();
|
|
1284
1287
|
if (this.presented) {
|
|
1288
|
+
unlock();
|
|
1285
1289
|
return;
|
|
1286
1290
|
}
|
|
1287
1291
|
const { presentingElement, el } = this;
|
|
1288
|
-
/**
|
|
1289
|
-
* When using an inline modal
|
|
1290
|
-
* and dismissing a modal it is possible to
|
|
1291
|
-
* quickly present the modal while it is
|
|
1292
|
-
* dismissing. We need to await any current
|
|
1293
|
-
* transition to allow the dismiss to finish
|
|
1294
|
-
* before presenting again.
|
|
1295
|
-
*/
|
|
1296
|
-
if (this.currentTransition !== undefined) {
|
|
1297
|
-
await this.currentTransition;
|
|
1298
|
-
}
|
|
1299
1292
|
/**
|
|
1300
1293
|
* If the modal is presented multiple times (inline modals), we
|
|
1301
1294
|
* need to reset the current breakpoint to the initial breakpoint.
|
|
1302
1295
|
*/
|
|
1303
1296
|
this.currentBreakpoint = this.initialBreakpoint;
|
|
1304
1297
|
const { inline, delegate } = this.getDelegate(true);
|
|
1305
|
-
|
|
1298
|
+
/**
|
|
1299
|
+
* Emit ionMount so JS Frameworks have an opportunity
|
|
1300
|
+
* to add the child component to the DOM. The child
|
|
1301
|
+
* component will be assigned to this.usersElement below.
|
|
1302
|
+
*/
|
|
1306
1303
|
this.ionMount.emit();
|
|
1304
|
+
this.usersElement = await frameworkDelegate.attachComponent(delegate, el, this.component, ['ion-page'], this.componentProps, inline);
|
|
1307
1305
|
/**
|
|
1308
1306
|
* When using the lazy loaded build of Stencil, we need to wait
|
|
1309
1307
|
* for every Stencil component instance to be ready before presenting
|
|
@@ -1327,7 +1325,7 @@ const Modal = class {
|
|
|
1327
1325
|
await index$5.waitForMount();
|
|
1328
1326
|
}
|
|
1329
1327
|
index$3.writeTask(() => this.el.classList.add('show-modal'));
|
|
1330
|
-
|
|
1328
|
+
await overlays.present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {
|
|
1331
1329
|
presentingEl: presentingElement,
|
|
1332
1330
|
currentBreakpoint: this.initialBreakpoint,
|
|
1333
1331
|
backdropBreakpoint: this.backdropBreakpoint,
|
|
@@ -1374,14 +1372,13 @@ const Modal = class {
|
|
|
1374
1372
|
this.statusBarStyle = await StatusBar.getStyle();
|
|
1375
1373
|
setCardStatusBarDark();
|
|
1376
1374
|
}
|
|
1377
|
-
await this.currentTransition;
|
|
1378
1375
|
if (this.isSheetModal) {
|
|
1379
1376
|
this.initSheetGesture();
|
|
1380
1377
|
}
|
|
1381
1378
|
else if (hasCardModal) {
|
|
1382
1379
|
this.initSwipeToClose();
|
|
1383
1380
|
}
|
|
1384
|
-
|
|
1381
|
+
unlock();
|
|
1385
1382
|
}
|
|
1386
1383
|
initSwipeToClose() {
|
|
1387
1384
|
var _a;
|
|
@@ -1471,12 +1468,19 @@ const Modal = class {
|
|
|
1471
1468
|
if (this.gestureAnimationDismissing && role !== overlays.GESTURE) {
|
|
1472
1469
|
return false;
|
|
1473
1470
|
}
|
|
1471
|
+
/**
|
|
1472
|
+
* Because the canDismiss check below is async,
|
|
1473
|
+
* we need to claim a lock before the check happens,
|
|
1474
|
+
* in case the dismiss transition does run.
|
|
1475
|
+
*/
|
|
1476
|
+
const unlock = await this.lockController.lock();
|
|
1474
1477
|
/**
|
|
1475
1478
|
* If a canDismiss handler is responsible
|
|
1476
1479
|
* for calling the dismiss method, we should
|
|
1477
1480
|
* not run the canDismiss check again.
|
|
1478
1481
|
*/
|
|
1479
1482
|
if (role !== 'handler' && !(await this.checkCanDismiss(data, role))) {
|
|
1483
|
+
unlock();
|
|
1480
1484
|
return false;
|
|
1481
1485
|
}
|
|
1482
1486
|
const { presentingElement } = this;
|
|
@@ -1494,24 +1498,12 @@ const Modal = class {
|
|
|
1494
1498
|
window.removeEventListener(keyboard.KEYBOARD_DID_OPEN, this.keyboardOpenCallback);
|
|
1495
1499
|
this.keyboardOpenCallback = undefined;
|
|
1496
1500
|
}
|
|
1497
|
-
/**
|
|
1498
|
-
* When using an inline modal
|
|
1499
|
-
* and presenting a modal it is possible to
|
|
1500
|
-
* quickly dismiss the modal while it is
|
|
1501
|
-
* presenting. We need to await any current
|
|
1502
|
-
* transition to allow the present to finish
|
|
1503
|
-
* before dismissing again.
|
|
1504
|
-
*/
|
|
1505
|
-
if (this.currentTransition !== undefined) {
|
|
1506
|
-
await this.currentTransition;
|
|
1507
|
-
}
|
|
1508
1501
|
const enteringAnimation = overlays.activeAnimations.get(this) || [];
|
|
1509
|
-
|
|
1502
|
+
const dismissed = await overlays.dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {
|
|
1510
1503
|
presentingEl: presentingElement,
|
|
1511
1504
|
currentBreakpoint: (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : this.initialBreakpoint,
|
|
1512
1505
|
backdropBreakpoint: this.backdropBreakpoint,
|
|
1513
1506
|
});
|
|
1514
|
-
const dismissed = await this.currentTransition;
|
|
1515
1507
|
if (dismissed) {
|
|
1516
1508
|
const { delegate } = this.getDelegate();
|
|
1517
1509
|
await frameworkDelegate.detachComponent(delegate, this.usersElement);
|
|
@@ -1525,8 +1517,8 @@ const Modal = class {
|
|
|
1525
1517
|
enteringAnimation.forEach((ani) => ani.destroy());
|
|
1526
1518
|
}
|
|
1527
1519
|
this.currentBreakpoint = undefined;
|
|
1528
|
-
this.currentTransition = undefined;
|
|
1529
1520
|
this.animation = undefined;
|
|
1521
|
+
unlock();
|
|
1530
1522
|
return dismissed;
|
|
1531
1523
|
}
|
|
1532
1524
|
/**
|
|
@@ -10,7 +10,7 @@ const cubicBezier = require('./cubic-bezier-6b9222ad.js');
|
|
|
10
10
|
const helpers = require('./helpers-ea4ccbcb.js');
|
|
11
11
|
const index$1 = require('./index-8568bedb.js');
|
|
12
12
|
const ionicGlobal = require('./ionic-global-f81d8b73.js');
|
|
13
|
-
const frameworkDelegate = require('./framework-delegate-
|
|
13
|
+
const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
|
|
14
14
|
|
|
15
15
|
const VIEW_STATE_NEW = 1;
|
|
16
16
|
const VIEW_STATE_ATTACHED = 2;
|
|
@@ -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-
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
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
|
-
|
|
80
|
-
|
|
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
|
-
|
|
94
|
-
const dismissed = await this
|
|
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
|
-
|
|
203
|
-
|
|
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
|
-
|
|
217
|
-
const dismissed = await this
|
|
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
|
/**
|
|
@@ -10,14 +10,14 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|
|
10
10
|
<ion-checkbox color="danger" checked="true">Label</ion-checkbox>
|
|
11
11
|
`, config);
|
|
12
12
|
const checkbox = page.locator('ion-checkbox');
|
|
13
|
-
expect(
|
|
13
|
+
await expect(checkbox).toHaveScreenshot(screenshot(`checkbox-color-checked`));
|
|
14
14
|
});
|
|
15
15
|
test('should not apply color when unchecked', async ({ page }) => {
|
|
16
16
|
await page.setContent(`
|
|
17
17
|
<ion-checkbox color="danger">Label</ion-checkbox>
|
|
18
18
|
`, config);
|
|
19
19
|
const checkbox = page.locator('ion-checkbox');
|
|
20
|
-
expect(
|
|
20
|
+
await expect(checkbox).toHaveScreenshot(screenshot(`checkbox-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(
|
|
17
|
+
await expect(list).toHaveScreenshot(screenshot(`checkbox-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(
|
|
28
|
+
await expect(list).toHaveScreenshot(screenshot(`checkbox-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(
|
|
41
|
+
await expect(item).toHaveScreenshot(screenshot(`checkbox-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(
|
|
58
|
+
await expect(list).toHaveScreenshot(screenshot(`checkbox-long-label-in-item`));
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
});
|