@ionic/core 8.7.17-dev.11771865171.14f4c2cf → 8.7.17-dev.11771870864.19b2cde1
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/ion-range.js +39 -152
- package/components/ion-segment-view.js +11 -5
- package/components/ion-select.js +3 -3
- package/components/ion-textarea.js +4 -4
- package/components/modal.js +206 -43
- package/dist/cjs/ion-modal.cjs.entry.js +206 -43
- package/dist/cjs/ion-range.cjs.entry.js +39 -149
- package/dist/cjs/ion-segment-view.cjs.entry.js +10 -5
- package/dist/cjs/ion-select_3.cjs.entry.js +3 -3
- package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/modal/gestures/sheet.js +108 -11
- package/dist/collection/components/modal/gestures/swipe-to-close.js +54 -1
- package/dist/collection/components/modal/modal.js +98 -31
- package/dist/collection/components/range/range.js +42 -172
- package/dist/collection/components/segment-view/segment-view.ios.css +2 -1
- package/dist/collection/components/segment-view/segment-view.js +28 -3
- package/dist/collection/components/segment-view/segment-view.md.css +2 -1
- package/dist/collection/components/select/select.js +6 -3
- package/dist/collection/components/textarea/textarea.js +4 -4
- package/dist/docs.json +120 -144
- package/dist/esm/ion-modal.entry.js +206 -43
- package/dist/esm/ion-range.entry.js +39 -149
- package/dist/esm/ion-segment-view.entry.js +10 -5
- package/dist/esm/ion-select_3.entry.js +3 -3
- package/dist/esm/ion-textarea.entry.js +2 -2
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/html.html-data.json +4 -0
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-012212e4.entry.js +4 -0
- package/dist/ionic/p-0f418a37.entry.js +4 -0
- package/dist/ionic/p-1838bed5.entry.js +4 -0
- package/dist/ionic/p-9a2d390d.entry.js +4 -0
- package/dist/ionic/{p-c19f63d0.entry.js → p-e1d1f3cc.entry.js} +1 -1
- package/dist/types/components/modal/gestures/sheet.d.ts +2 -2
- package/dist/types/components/modal/gestures/swipe-to-close.d.ts +2 -2
- package/dist/types/components/modal/modal-interface.d.ts +7 -0
- package/dist/types/components/modal/modal.d.ts +17 -1
- package/dist/types/components/range/range-interface.d.ts +0 -1
- package/dist/types/components/range/range.d.ts +4 -33
- package/dist/types/components/segment-view/segment-view.d.ts +4 -0
- package/dist/types/components/select/select.d.ts +3 -0
- package/dist/types/components.d.ts +27 -2
- package/hydrate/index.js +270 -228
- package/hydrate/index.mjs +270 -228
- package/package.json +1 -1
- package/dist/ionic/p-020af078.entry.js +0 -4
- package/dist/ionic/p-88367362.entry.js +0 -4
- package/dist/ionic/p-91840a80.entry.js +0 -4
- package/dist/ionic/p-991a3dd9.entry.js +0 -4
|
@@ -249,7 +249,7 @@ const calculateSpringStep = (t) => {
|
|
|
249
249
|
const SwipeToCloseDefaults = {
|
|
250
250
|
MIN_PRESENTING_SCALE: 0.915,
|
|
251
251
|
};
|
|
252
|
-
const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) => {
|
|
252
|
+
const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss, onDragStart, onDragMove, onDragEnd) => {
|
|
253
253
|
/**
|
|
254
254
|
* The step value at which a card modal
|
|
255
255
|
* is eligible for dismissing via gesture.
|
|
@@ -359,6 +359,7 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) =>
|
|
|
359
359
|
index$2.disableContentScrollY(contentEl);
|
|
360
360
|
}
|
|
361
361
|
animation.progressStart(true, isOpen ? 1 : 0);
|
|
362
|
+
onDragStart();
|
|
362
363
|
};
|
|
363
364
|
const onMove = (detail) => {
|
|
364
365
|
const { deltaY } = detail;
|
|
@@ -426,6 +427,13 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) =>
|
|
|
426
427
|
setCardStatusBarDark();
|
|
427
428
|
}
|
|
428
429
|
lastStep = clampedStep;
|
|
430
|
+
const eventDetail = {
|
|
431
|
+
currentY: detail.currentY,
|
|
432
|
+
deltaY: detail.deltaY,
|
|
433
|
+
velocityY: detail.velocityY,
|
|
434
|
+
progress: calculateProgress(el, detail.deltaY),
|
|
435
|
+
};
|
|
436
|
+
onDragMove(eventDetail);
|
|
429
437
|
};
|
|
430
438
|
const onEnd = (detail) => {
|
|
431
439
|
const velocity = detail.velocityY;
|
|
@@ -484,6 +492,13 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) =>
|
|
|
484
492
|
else if (shouldComplete) {
|
|
485
493
|
onDismiss();
|
|
486
494
|
}
|
|
495
|
+
const eventDetail = {
|
|
496
|
+
currentY: detail.currentY,
|
|
497
|
+
deltaY: detail.deltaY,
|
|
498
|
+
velocityY: detail.velocityY,
|
|
499
|
+
progress: calculateProgress(el, detail.deltaY),
|
|
500
|
+
};
|
|
501
|
+
onDragEnd(eventDetail);
|
|
487
502
|
};
|
|
488
503
|
const gesture = index$1.createGesture({
|
|
489
504
|
el,
|
|
@@ -501,6 +516,44 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) =>
|
|
|
501
516
|
const computeDuration = (remaining, velocity) => {
|
|
502
517
|
return helpers.clamp(400, remaining / Math.abs(velocity * 1.1), 500);
|
|
503
518
|
};
|
|
519
|
+
/**
|
|
520
|
+
* Calculates the progress of the swipe gesture.
|
|
521
|
+
*
|
|
522
|
+
* The progress is a value between 0 and 1 that represents how far
|
|
523
|
+
* the swipe has progressed towards closing the modal.
|
|
524
|
+
*
|
|
525
|
+
* A value closer to 1 means the modal is closer to being opened,
|
|
526
|
+
* while a value closer to 0 means the modal is closer to being closed.
|
|
527
|
+
*
|
|
528
|
+
* @param el The modal
|
|
529
|
+
* @param deltaY The change in Y position (positive when dragging down, negative when dragging up)
|
|
530
|
+
* @returns The progress of the swipe gesture
|
|
531
|
+
*/
|
|
532
|
+
const calculateProgress = (el, deltaY) => {
|
|
533
|
+
const windowHeight = window.innerHeight;
|
|
534
|
+
// Position when fully open
|
|
535
|
+
const modalTop = el.getBoundingClientRect().top;
|
|
536
|
+
/**
|
|
537
|
+
* The distance between the top of the modal and the bottom of the screen
|
|
538
|
+
* is the total distance the modal needs to travel to be fully closed.
|
|
539
|
+
*/
|
|
540
|
+
const totalDistance = windowHeight - modalTop;
|
|
541
|
+
/**
|
|
542
|
+
* The pull percentage is how far the user has swiped compared to the total
|
|
543
|
+
* distance needed to close the modal.
|
|
544
|
+
*/
|
|
545
|
+
const pullPercentage = deltaY / totalDistance;
|
|
546
|
+
/**
|
|
547
|
+
* The progress is the inverse of the pull percentage because
|
|
548
|
+
* when the user starts swiping up, the progress should be close to 1,
|
|
549
|
+
* and when the user has swiped all the way down, the progress should be
|
|
550
|
+
* close to 0.
|
|
551
|
+
*/
|
|
552
|
+
const progress = 1 - pullPercentage;
|
|
553
|
+
// Round to the nearest thousandth to avoid returning very small decimal
|
|
554
|
+
const roundedProgress = Math.round(progress * 1000) / 1000;
|
|
555
|
+
return Math.max(0, Math.min(1, roundedProgress));
|
|
556
|
+
};
|
|
504
557
|
|
|
505
558
|
const createSheetEnterAnimation = (opts) => {
|
|
506
559
|
const { currentBreakpoint, backdropBreakpoint, expandToScroll } = opts;
|
|
@@ -949,7 +1002,7 @@ const mdLeaveAnimation = (baseEl, opts) => {
|
|
|
949
1002
|
return baseAnimation;
|
|
950
1003
|
};
|
|
951
1004
|
|
|
952
|
-
const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
|
|
1005
|
+
const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange, onDragStart, onDragMove, onDragEnd) => {
|
|
953
1006
|
// Defaults for the sheet swipe animation
|
|
954
1007
|
const defaultBackdrop = [
|
|
955
1008
|
{ offset: 0, opacity: 'var(--backdrop-opacity)' },
|
|
@@ -1212,6 +1265,7 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1212
1265
|
baseEl.focus();
|
|
1213
1266
|
});
|
|
1214
1267
|
animation.progressStart(true, 1 - currentBreakpoint);
|
|
1268
|
+
onDragStart();
|
|
1215
1269
|
};
|
|
1216
1270
|
const onMove = (detail) => {
|
|
1217
1271
|
/**
|
|
@@ -1280,6 +1334,15 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1280
1334
|
: step;
|
|
1281
1335
|
offset = helpers.clamp(0.0001, processedStep, maxStep);
|
|
1282
1336
|
animation.progressStep(offset);
|
|
1337
|
+
const closest = calculateClosestBreakpoint(detail.velocityY, detail.deltaY);
|
|
1338
|
+
const eventDetail = {
|
|
1339
|
+
currentY: detail.currentY,
|
|
1340
|
+
deltaY: detail.deltaY,
|
|
1341
|
+
velocityY: detail.velocityY,
|
|
1342
|
+
progress: calculateProgress(detail.currentY),
|
|
1343
|
+
currentBreakpoint: closest,
|
|
1344
|
+
};
|
|
1345
|
+
onDragMove(eventDetail);
|
|
1283
1346
|
};
|
|
1284
1347
|
const onEnd = (detail) => {
|
|
1285
1348
|
/**
|
|
@@ -1298,16 +1361,7 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1298
1361
|
swapFooterPosition('stationary');
|
|
1299
1362
|
return;
|
|
1300
1363
|
}
|
|
1301
|
-
|
|
1302
|
-
* When the gesture releases, we need to determine
|
|
1303
|
-
* the closest breakpoint to snap to.
|
|
1304
|
-
*/
|
|
1305
|
-
const velocity = detail.velocityY;
|
|
1306
|
-
const threshold = (detail.deltaY + velocity * 350) / height;
|
|
1307
|
-
const diff = currentBreakpoint - threshold;
|
|
1308
|
-
const closest = breakpoints.reduce((a, b) => {
|
|
1309
|
-
return Math.abs(b - diff) < Math.abs(a - diff) ? b : a;
|
|
1310
|
-
});
|
|
1364
|
+
const closest = calculateClosestBreakpoint(detail.velocityY, detail.deltaY);
|
|
1311
1365
|
moveSheetToBreakpoint({
|
|
1312
1366
|
breakpoint: closest,
|
|
1313
1367
|
breakpointOffset: offset,
|
|
@@ -1318,6 +1372,14 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1318
1372
|
*/
|
|
1319
1373
|
animated: true,
|
|
1320
1374
|
});
|
|
1375
|
+
const eventDetail = {
|
|
1376
|
+
currentY: detail.currentY,
|
|
1377
|
+
deltaY: detail.deltaY,
|
|
1378
|
+
velocityY: detail.velocityY,
|
|
1379
|
+
progress: calculateProgress(detail.currentY),
|
|
1380
|
+
currentBreakpoint: closest,
|
|
1381
|
+
};
|
|
1382
|
+
onDragEnd(eventDetail);
|
|
1321
1383
|
};
|
|
1322
1384
|
const moveSheetToBreakpoint = (options) => {
|
|
1323
1385
|
const { breakpoint, canDismiss, breakpointOffset, animated } = options;
|
|
@@ -1457,6 +1519,94 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1457
1519
|
.progressEnd(1, 0, animated ? 500 : 0);
|
|
1458
1520
|
});
|
|
1459
1521
|
};
|
|
1522
|
+
/**
|
|
1523
|
+
* Calculates the closest breakpoint based on the current velocity and deltaY.
|
|
1524
|
+
* This determines where the sheet should snap to when the user releases the
|
|
1525
|
+
* gesture.
|
|
1526
|
+
*
|
|
1527
|
+
* @param velocityY The current velocity of the gesture in the Y direction.
|
|
1528
|
+
* @param deltaY The change in Y position since the gesture started.
|
|
1529
|
+
* @returns The closest breakpoint value.
|
|
1530
|
+
*/
|
|
1531
|
+
const calculateClosestBreakpoint = (velocityY, deltaY) => {
|
|
1532
|
+
const threshold = (deltaY + velocityY * 350) / height;
|
|
1533
|
+
const diff = currentBreakpoint - threshold;
|
|
1534
|
+
const closest = breakpoints.reduce((a, b) => {
|
|
1535
|
+
return Math.abs(b - diff) < Math.abs(a - diff) ? b : a;
|
|
1536
|
+
});
|
|
1537
|
+
return closest;
|
|
1538
|
+
};
|
|
1539
|
+
/**
|
|
1540
|
+
* Calculates the progress of the swipe gesture.
|
|
1541
|
+
*
|
|
1542
|
+
* The progress is a value between 0 and 1 that represents how far
|
|
1543
|
+
* the swipe has progressed towards closing the modal.
|
|
1544
|
+
*
|
|
1545
|
+
* A value closer to 1 means the modal is closer to being opened,
|
|
1546
|
+
* while a value closer to 0 means the modal is closer to being closed.
|
|
1547
|
+
*
|
|
1548
|
+
* @param currentY The current Y position of the gesture
|
|
1549
|
+
* @returns The progress of the sheet gesture
|
|
1550
|
+
*/
|
|
1551
|
+
const calculateProgress = (currentY) => {
|
|
1552
|
+
const minBreakpoint = breakpoints[0];
|
|
1553
|
+
const maxBreakpoint = breakpoints[breakpoints.length - 1];
|
|
1554
|
+
// Convert breakpoints to pixel Y coordinates
|
|
1555
|
+
/**
|
|
1556
|
+
* The lowest point the sheet can be dragged to aka the point at which
|
|
1557
|
+
* the sheet is fully closed.
|
|
1558
|
+
*/
|
|
1559
|
+
const maxY = convertBreakpointToY(minBreakpoint);
|
|
1560
|
+
/**
|
|
1561
|
+
* The highest point the sheet can be dragged to aka the point at which
|
|
1562
|
+
* the sheet is fully open.
|
|
1563
|
+
*/
|
|
1564
|
+
const minY = convertBreakpointToY(maxBreakpoint);
|
|
1565
|
+
// The total distance between the fully open and fully closed positions.
|
|
1566
|
+
const totalDistance = maxY - minY;
|
|
1567
|
+
// The distance from the current position to the fully closed position.
|
|
1568
|
+
const distanceFromBottom = maxY - currentY;
|
|
1569
|
+
/**
|
|
1570
|
+
* The progress represents how far the sheet is from the bottom relative
|
|
1571
|
+
* to the total distance. When the user starts swiping up, the progress
|
|
1572
|
+
* should be close to 1, and when the user has swiped all the way down,
|
|
1573
|
+
* the progress should be close to 0.
|
|
1574
|
+
*/
|
|
1575
|
+
const progress = distanceFromBottom / totalDistance;
|
|
1576
|
+
// Round to the nearest thousandth to avoid returning very small decimal
|
|
1577
|
+
const roundedProgress = Math.round(progress * 1000) / 1000;
|
|
1578
|
+
return Math.max(0, Math.min(1, roundedProgress));
|
|
1579
|
+
};
|
|
1580
|
+
/**
|
|
1581
|
+
* Converts a breakpoint value (0 to 1) into a pixel Y coordinate
|
|
1582
|
+
* on the screen.
|
|
1583
|
+
*
|
|
1584
|
+
* @param breakpoint The breakpoint value (e.g., 0.5 for half-open)
|
|
1585
|
+
* @returns The pixel Y coordinate on the screen
|
|
1586
|
+
*/
|
|
1587
|
+
const convertBreakpointToY = (breakpoint) => {
|
|
1588
|
+
const rect = baseEl.getBoundingClientRect();
|
|
1589
|
+
const modalHeight = rect.height;
|
|
1590
|
+
// The bottom of the screen.
|
|
1591
|
+
const viewportBottom = window.innerHeight;
|
|
1592
|
+
/**
|
|
1593
|
+
* The active height is how much of the modal is actually showing
|
|
1594
|
+
* on the screen for this specific breakpoint.
|
|
1595
|
+
*/
|
|
1596
|
+
const activeHeight = modalHeight * breakpoint;
|
|
1597
|
+
/**
|
|
1598
|
+
* To find the Y coordinate, start at the bottom of the screen
|
|
1599
|
+
* and move up by the active height of the modal.
|
|
1600
|
+
*
|
|
1601
|
+
* A breakpoint of 1.0 means the active height is the full modal height
|
|
1602
|
+
* (fully open). A breakpoint of 0.0 means the active height is 0
|
|
1603
|
+
* (fully closed).
|
|
1604
|
+
*
|
|
1605
|
+
* Since screen Y coordinates get smaller as you go up, we subtract the
|
|
1606
|
+
* active height from the viewport bottom.
|
|
1607
|
+
*/
|
|
1608
|
+
return viewportBottom - activeHeight;
|
|
1609
|
+
};
|
|
1460
1610
|
const gesture = index$1.createGesture({
|
|
1461
1611
|
el: wrapperEl,
|
|
1462
1612
|
gestureName: 'modalSheet',
|
|
@@ -1491,6 +1641,9 @@ const Modal = class {
|
|
|
1491
1641
|
this.willDismissShorthand = index$3.createEvent(this, "willDismiss", 7);
|
|
1492
1642
|
this.didDismissShorthand = index$3.createEvent(this, "didDismiss", 7);
|
|
1493
1643
|
this.ionMount = index$3.createEvent(this, "ionMount", 7);
|
|
1644
|
+
this.ionDragStart = index$3.createEvent(this, "ionDragStart", 7);
|
|
1645
|
+
this.ionDragMove = index$3.createEvent(this, "ionDragMove", 7);
|
|
1646
|
+
this.ionDragEnd = index$3.createEvent(this, "ionDragEnd", 7);
|
|
1494
1647
|
this.lockController = lockController.createLockController();
|
|
1495
1648
|
this.triggerController = overlays.createTriggerController();
|
|
1496
1649
|
this.coreDelegate = frameworkDelegate.CoreDelegate();
|
|
@@ -1958,32 +2111,7 @@ const Modal = class {
|
|
|
1958
2111
|
return;
|
|
1959
2112
|
}
|
|
1960
2113
|
const statusBarStyle = (_a = this.statusBarStyle) !== null && _a !== void 0 ? _a : Style.Default;
|
|
1961
|
-
this.gesture = createSwipeToCloseGesture(el, ani, statusBarStyle, () =>
|
|
1962
|
-
/**
|
|
1963
|
-
* While the gesture animation is finishing
|
|
1964
|
-
* it is possible for a user to tap the backdrop.
|
|
1965
|
-
* This would result in the dismiss animation
|
|
1966
|
-
* being played again. Typically this is avoided
|
|
1967
|
-
* by setting `presented = false` on the overlay
|
|
1968
|
-
* component; however, we cannot do that here as
|
|
1969
|
-
* that would prevent the element from being
|
|
1970
|
-
* removed from the DOM.
|
|
1971
|
-
*/
|
|
1972
|
-
this.gestureAnimationDismissing = true;
|
|
1973
|
-
/**
|
|
1974
|
-
* Reset the status bar style as the dismiss animation
|
|
1975
|
-
* starts otherwise the status bar will be the wrong
|
|
1976
|
-
* color for the duration of the dismiss animation.
|
|
1977
|
-
* The dismiss method does this as well, but
|
|
1978
|
-
* in this case it's only called once the animation
|
|
1979
|
-
* has finished.
|
|
1980
|
-
*/
|
|
1981
|
-
setCardStatusBarDefault(this.statusBarStyle);
|
|
1982
|
-
this.animation.onFinish(async () => {
|
|
1983
|
-
await this.dismiss(undefined, overlays.GESTURE);
|
|
1984
|
-
this.gestureAnimationDismissing = false;
|
|
1985
|
-
});
|
|
1986
|
-
});
|
|
2114
|
+
this.gesture = createSwipeToCloseGesture(el, ani, statusBarStyle, () => this.cardOnDismiss(), () => this.onDragStart(), (detail) => this.onDragMove(detail), (detail) => this.onDragEnd(detail));
|
|
1987
2115
|
this.gesture.enable(true);
|
|
1988
2116
|
}
|
|
1989
2117
|
initSheetGesture() {
|
|
@@ -2004,7 +2132,7 @@ const Modal = class {
|
|
|
2004
2132
|
this.currentBreakpoint = breakpoint;
|
|
2005
2133
|
this.ionBreakpointDidChange.emit({ breakpoint });
|
|
2006
2134
|
}
|
|
2007
|
-
});
|
|
2135
|
+
}, () => this.onDragStart(), (detail) => this.onDragMove(detail), (detail) => this.onDragEnd(detail));
|
|
2008
2136
|
this.gesture = gesture;
|
|
2009
2137
|
this.moveSheetToBreakpoint = moveSheetToBreakpoint;
|
|
2010
2138
|
this.gesture.enable(true);
|
|
@@ -2101,6 +2229,32 @@ const Modal = class {
|
|
|
2101
2229
|
this.gestureAnimationDismissing = false;
|
|
2102
2230
|
});
|
|
2103
2231
|
}
|
|
2232
|
+
cardOnDismiss() {
|
|
2233
|
+
/**
|
|
2234
|
+
* While the gesture animation is finishing
|
|
2235
|
+
* it is possible for a user to tap the backdrop.
|
|
2236
|
+
* This would result in the dismiss animation
|
|
2237
|
+
* being played again. Typically this is avoided
|
|
2238
|
+
* by setting `presented = false` on the overlay
|
|
2239
|
+
* component; however, we cannot do that here as
|
|
2240
|
+
* that would prevent the element from being
|
|
2241
|
+
* removed from the DOM.
|
|
2242
|
+
*/
|
|
2243
|
+
this.gestureAnimationDismissing = true;
|
|
2244
|
+
/**
|
|
2245
|
+
* Reset the status bar style as the dismiss animation
|
|
2246
|
+
* starts otherwise the status bar will be the wrong
|
|
2247
|
+
* color for the duration of the dismiss animation.
|
|
2248
|
+
* The dismiss method does this as well, but
|
|
2249
|
+
* in this case it's only called once the animation
|
|
2250
|
+
* has finished.
|
|
2251
|
+
*/
|
|
2252
|
+
setCardStatusBarDefault(this.statusBarStyle);
|
|
2253
|
+
this.animation.onFinish(async () => {
|
|
2254
|
+
await this.dismiss(undefined, overlays.GESTURE);
|
|
2255
|
+
this.gestureAnimationDismissing = false;
|
|
2256
|
+
});
|
|
2257
|
+
}
|
|
2104
2258
|
/**
|
|
2105
2259
|
* Dismiss the modal overlay after it has been presented.
|
|
2106
2260
|
* This is a no-op if the overlay has not been presented yet. If you want
|
|
@@ -2416,6 +2570,15 @@ const Modal = class {
|
|
|
2416
2570
|
(_a = this.parentRemovalObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
2417
2571
|
this.parentRemovalObserver = undefined;
|
|
2418
2572
|
}
|
|
2573
|
+
onDragStart() {
|
|
2574
|
+
this.ionDragStart.emit();
|
|
2575
|
+
}
|
|
2576
|
+
onDragMove(detail) {
|
|
2577
|
+
this.ionDragMove.emit(detail);
|
|
2578
|
+
}
|
|
2579
|
+
onDragEnd(detail) {
|
|
2580
|
+
this.ionDragEnd.emit(detail);
|
|
2581
|
+
}
|
|
2419
2582
|
render() {
|
|
2420
2583
|
const { handle, isSheetModal, presentingElement, htmlAttributes, handleBehavior, inheritedAttributes, focusTrap, expandToScroll, } = this;
|
|
2421
2584
|
const showHandle = handle !== false && isSheetModal;
|
|
@@ -2423,20 +2586,20 @@ const Modal = class {
|
|
|
2423
2586
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
2424
2587
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
2425
2588
|
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
2426
|
-
return (index$3.h(index$3.Host, Object.assign({ key: '
|
|
2589
|
+
return (index$3.h(index$3.Host, Object.assign({ key: 'bca3cbdb2ce8e5127d27eae7494c434aaeddaf88', "no-router": true,
|
|
2427
2590
|
// Allow the modal to be navigable when the handle is focusable
|
|
2428
2591
|
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
2429
2592
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
2430
|
-
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [overlays.FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), index$3.h("ion-backdrop", { key: '
|
|
2593
|
+
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [overlays.FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), index$3.h("ion-backdrop", { key: 'b1c4112123d84d8a9b9d455bcc17d884f99d9f28', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && index$3.h("div", { key: '080c8e6d37b311a1b5ad2655d99f18668abae211', class: "modal-shadow" }), index$3.h("div", Object.assign({ key: '8ba05e9520b1b5529bf0caeb766da5bf612d4d14',
|
|
2431
2594
|
/*
|
|
2432
2595
|
role and aria-modal must be used on the
|
|
2433
2596
|
same element. They must also be set inside the
|
|
2434
2597
|
shadow DOM otherwise ion-button will not be highlighted
|
|
2435
2598
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
2436
2599
|
*/
|
|
2437
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (index$3.h("button", { key: '
|
|
2600
|
+
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (index$3.h("button", { key: '2d2d5d731f55755f32ebcbf557f97486dc6202a6', class: "modal-handle",
|
|
2438
2601
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
2439
|
-
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), index$3.h("slot", { key: '
|
|
2602
|
+
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), index$3.h("slot", { key: 'c717d19865dafba02e15db79bc0662c5d89e96fd', onSlotchange: this.onSlotChange }))));
|
|
2440
2603
|
}
|
|
2441
2604
|
get el() { return index$3.getElement(this); }
|
|
2442
2605
|
static get watchers() { return {
|