@ionic/core 8.8.4-dev.11776186452.1cc0af05 → 8.8.4-dev.11776246162.138c2737
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/index.js +1 -1
- package/components/ion-action-sheet.js +1 -1
- package/components/ion-alert.js +1 -1
- package/components/ion-datetime.js +1 -1
- package/components/ion-infinite-scroll-content.js +1 -1
- package/components/ion-loading.js +1 -1
- package/components/ion-menu.js +1 -1
- package/components/ion-modal.js +1 -1
- package/components/ion-picker-legacy.js +1 -1
- package/components/ion-popover.js +1 -1
- package/components/ion-refresher-content.js +1 -1
- package/components/ion-select-modal.js +1 -1
- package/components/ion-select-option.js +1 -1
- package/components/ion-select-popover.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/ion-skeleton-text.js +1 -1
- package/components/ion-spinner.js +1 -1
- package/components/ion-split-pane.js +1 -1
- package/components/ion-tab-bar.js +1 -1
- package/components/ion-tab-button.js +1 -1
- package/components/ion-tab.js +1 -1
- package/components/ion-tabs.js +1 -1
- package/components/ion-text.js +1 -1
- package/components/ion-textarea.js +1 -1
- package/components/ion-thumbnail.js +1 -1
- package/components/ion-title.js +1 -1
- package/components/ion-toast.js +1 -1
- package/components/ion-toggle.js +1 -1
- package/components/ion-toolbar.js +1 -1
- package/components/p-B36-MWK0.js +4 -0
- package/components/p-BDPU2685.js +4 -0
- package/components/p-BrNzoF1U.js +4 -0
- package/components/{p-B0orUoaV.js → p-C-_EGKki.js} +1 -1
- package/components/{p-qhBzWoOF.js → p-C2cZvGcF.js} +1 -1
- package/components/p-CEUppJkx.js +4 -0
- package/components/p-CSexRbnt.js +4 -0
- package/components/{p-ZRp3l6Dk.js → p-CoarhFWH.js} +1 -1
- package/components/p-DNdBtsfu.js +4 -0
- package/components/p-Njik5v4C.js +4 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +34 -25
- package/dist/cjs/ion-alert.cjs.entry.js +51 -44
- package/dist/cjs/ion-app_8.cjs.entry.js +4 -4
- package/dist/cjs/ion-avatar_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-datetime_3.cjs.entry.js +28 -4
- package/dist/cjs/ion-item_8.cjs.entry.js +2 -2
- package/dist/cjs/ion-loading.cjs.entry.js +29 -4
- package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-modal.cjs.entry.js +176 -79
- package/dist/cjs/ion-popover.cjs.entry.js +90 -4
- package/dist/cjs/ion-select-modal.cjs.entry.js +27 -60
- package/dist/cjs/ion-select_3.cjs.entry.js +48 -191
- package/dist/cjs/ion-spinner.cjs.entry.js +1 -1
- package/dist/cjs/ion-split-pane.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab-bar_2.cjs.entry.js +4 -4
- package/dist/cjs/ion-tab_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-text.cjs.entry.js +2 -2
- package/dist/cjs/ion-textarea.cjs.entry.js +3 -3
- package/dist/cjs/ion-toast.cjs.entry.js +32 -4
- package/dist/cjs/ion-toggle.cjs.entry.js +3 -3
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{overlays-Dhoy6v_5.js → overlays-BbhewSIQ.js} +4 -4
- package/dist/collection/components/action-sheet/action-sheet.ios.css +0 -84
- package/dist/collection/components/action-sheet/action-sheet.js +8 -22
- package/dist/collection/components/action-sheet/action-sheet.md.css +0 -84
- package/dist/collection/components/action-sheet/animations/ionic.enter.js +27 -0
- package/dist/collection/components/action-sheet/animations/ionic.leave.js +21 -0
- package/dist/collection/components/alert/alert.ios.css +0 -83
- package/dist/collection/components/alert/alert.js +24 -41
- package/dist/collection/components/alert/alert.md.css +0 -83
- package/dist/collection/components/alert/animations/ionic.enter.js +28 -0
- package/dist/collection/components/alert/animations/ionic.leave.js +19 -0
- package/dist/collection/components/loading/animations/ionic.enter.js +28 -0
- package/dist/collection/components/loading/animations/ionic.leave.js +22 -0
- package/dist/collection/components/loading/loading.js +4 -3
- package/dist/collection/components/modal/animations/ionic.enter.js +40 -0
- package/dist/collection/components/modal/animations/ionic.leave.js +28 -0
- package/dist/collection/components/modal/gestures/sheet.js +71 -9
- package/dist/collection/components/modal/modal.ionic.css +1 -1
- package/dist/collection/components/modal/modal.js +6 -5
- package/dist/collection/components/picker-legacy/animations/ionic.enter.js +27 -0
- package/dist/collection/components/picker-legacy/animations/ionic.leave.js +23 -0
- package/dist/collection/components/picker-legacy/picker.js +4 -3
- package/dist/collection/components/popover/animations/ionic.enter.js +91 -0
- package/dist/collection/components/popover/animations/ionic.leave.js +29 -0
- package/dist/collection/components/popover/popover.js +4 -3
- package/dist/collection/components/select/select.ionic.css +0 -31
- package/dist/collection/components/select/select.ios.css +0 -31
- package/dist/collection/components/select/select.js +14 -125
- package/dist/collection/components/select/select.md.css +0 -31
- package/dist/collection/components/select-modal/select-modal.ionic.css +0 -24
- package/dist/collection/components/select-modal/select-modal.ios.css +0 -77
- package/dist/collection/components/select-modal/select-modal.js +23 -56
- package/dist/collection/components/select-modal/select-modal.md.css +1 -80
- package/dist/collection/components/select-option/select-option.js +2 -21
- package/dist/collection/components/select-popover/select-popover.ios.css +0 -77
- package/dist/collection/components/select-popover/select-popover.js +26 -59
- package/dist/collection/components/select-popover/select-popover.md.css +0 -77
- package/dist/collection/components/skeleton-text/skeleton-text.js +2 -2
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/split-pane/split-pane.js +2 -2
- package/dist/collection/components/tab/tab.js +2 -2
- package/dist/collection/components/tab-bar/tab-bar.js +2 -2
- package/dist/collection/components/tab-button/tab-button.js +2 -2
- package/dist/collection/components/tabs/tabs.js +1 -1
- package/dist/collection/components/text/text.js +2 -2
- package/dist/collection/components/textarea/textarea.js +3 -3
- package/dist/collection/components/thumbnail/thumbnail.js +2 -2
- package/dist/collection/components/title/title.js +2 -2
- package/dist/collection/components/toast/animations/ionic.enter.js +33 -0
- package/dist/collection/components/toast/animations/ionic.leave.js +16 -0
- package/dist/collection/components/toast/toast.js +4 -3
- package/dist/collection/components/toggle/toggle.js +3 -3
- package/dist/collection/components/toolbar/toolbar.js +2 -2
- package/dist/collection/utils/overlays.js +5 -5
- package/dist/docs.json +1 -135
- package/dist/esm/index.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +34 -25
- package/dist/esm/ion-alert.entry.js +51 -44
- package/dist/esm/ion-app_8.entry.js +4 -4
- package/dist/esm/ion-avatar_3.entry.js +2 -2
- package/dist/esm/ion-datetime_3.entry.js +28 -4
- package/dist/esm/ion-item_8.entry.js +2 -2
- package/dist/esm/ion-loading.entry.js +29 -4
- package/dist/esm/ion-menu_3.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +177 -80
- package/dist/esm/ion-popover.entry.js +90 -4
- package/dist/esm/ion-select-modal.entry.js +27 -60
- package/dist/esm/ion-select_3.entry.js +49 -192
- package/dist/esm/ion-spinner.entry.js +1 -1
- package/dist/esm/ion-split-pane.entry.js +2 -2
- package/dist/esm/ion-tab-bar_2.entry.js +4 -4
- package/dist/esm/ion-tab_2.entry.js +3 -3
- package/dist/esm/ion-text.entry.js +2 -2
- package/dist/esm/ion-textarea.entry.js +3 -3
- package/dist/esm/ion-toast.entry.js +32 -4
- package/dist/esm/ion-toggle.entry.js +3 -3
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{overlays-CvFHfO3y.js → overlays-VA-4NWjf.js} +5 -5
- package/dist/html.html-data.json +0 -4
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-07b129d5.entry.js +4 -0
- package/dist/ionic/p-0cb50208.entry.js +4 -0
- package/dist/ionic/{p-db4f4eaf.entry.js → p-1efe83c8.entry.js} +1 -1
- package/dist/ionic/{p-d2fe6791.entry.js → p-2193e875.entry.js} +1 -1
- package/dist/ionic/{p-69033ad6.entry.js → p-2bf931ae.entry.js} +1 -1
- package/dist/ionic/{p-26595044.entry.js → p-3bf01c2c.entry.js} +1 -1
- package/dist/ionic/p-3d4c8528.entry.js +4 -0
- package/dist/ionic/{p-9e71982e.entry.js → p-49799a34.entry.js} +1 -1
- package/dist/ionic/p-64341e32.entry.js +4 -0
- package/dist/ionic/p-6992d9d6.entry.js +4 -0
- package/dist/ionic/{p-aa8c1e64.entry.js → p-6c8c37c2.entry.js} +1 -1
- package/dist/ionic/{p-a94016be.entry.js → p-91e242e4.entry.js} +1 -1
- package/dist/ionic/{p-96ec9a10.entry.js → p-9b9b1450.entry.js} +1 -1
- package/dist/ionic/p-9dd4276b.entry.js +4 -0
- package/dist/ionic/p-BExfzy0B.js +4 -0
- package/dist/ionic/p-a3d794ba.entry.js +4 -0
- package/dist/ionic/p-ba9f8cbb.entry.js +4 -0
- package/dist/ionic/{p-2095969c.entry.js → p-bae3ebe5.entry.js} +1 -1
- package/dist/ionic/{p-a1c8ba8c.entry.js → p-bc5713f7.entry.js} +1 -1
- package/dist/ionic/{p-71f28573.entry.js → p-cdfbe4cc.entry.js} +1 -1
- package/dist/ionic/p-fa701753.entry.js +4 -0
- package/dist/types/components/action-sheet/animations/ionic.enter.d.ts +5 -0
- package/dist/types/components/action-sheet/animations/ionic.leave.d.ts +5 -0
- package/dist/types/components/alert/animations/ionic.enter.d.ts +5 -0
- package/dist/types/components/alert/animations/ionic.leave.d.ts +5 -0
- package/dist/types/components/loading/animations/ionic.enter.d.ts +5 -0
- package/dist/types/components/loading/animations/ionic.leave.d.ts +5 -0
- package/dist/types/components/modal/animations/ionic.enter.d.ts +6 -0
- package/dist/types/components/modal/animations/ionic.leave.d.ts +6 -0
- package/dist/types/components/modal/gestures/sheet.d.ts +1 -1
- package/dist/types/components/picker-legacy/animations/ionic.enter.d.ts +5 -0
- package/dist/types/components/picker-legacy/animations/ionic.leave.d.ts +5 -0
- package/dist/types/components/popover/animations/ionic.enter.d.ts +5 -0
- package/dist/types/components/popover/animations/ionic.leave.d.ts +5 -0
- package/dist/types/components/select/select-interface.d.ts +0 -21
- package/dist/types/components/select/select.d.ts +0 -7
- package/dist/types/components/select-option/select-option.d.ts +0 -4
- package/dist/types/components/toast/animations/ionic.enter.d.ts +6 -0
- package/dist/types/components/toast/animations/ionic.leave.d.ts +5 -0
- package/dist/types/components.d.ts +0 -9
- package/dist/types/utils/overlays.d.ts +1 -1
- package/hydrate/index.js +534 -489
- package/hydrate/index.mjs +534 -489
- package/package.json +1 -1
- package/components/p-B6czg-mf.js +0 -4
- package/components/p-BObmvbuR.js +0 -4
- package/components/p-C8Dne7pI.js +0 -4
- package/components/p-Cm7hjN9B.js +0 -4
- package/components/p-DQY5lHUa.js +0 -4
- package/components/p-D_uMZULz.js +0 -4
- package/components/p-GytrfCp8.js +0 -4
- package/components/p-ZeIAjDcZ.js +0 -4
- package/dist/cjs/select-option-render-qQf4xz8P.js +0 -67
- package/dist/collection/components/action-sheet/action-sheet.ionic.css +0 -834
- package/dist/collection/components/alert/alert.ionic.css +0 -1165
- package/dist/collection/components/select-popover/select-popover.ionic.css +0 -489
- package/dist/collection/utils/select-option-render.js +0 -62
- package/dist/esm/select-option-render-BQUT9Aqa.js +0 -65
- package/dist/ionic/p-003b40fc.entry.js +0 -4
- package/dist/ionic/p-35aa95dc.entry.js +0 -4
- package/dist/ionic/p-37f895a8.entry.js +0 -4
- package/dist/ionic/p-3884bfa4.entry.js +0 -4
- package/dist/ionic/p-38897781.entry.js +0 -4
- package/dist/ionic/p-575061c0.entry.js +0 -4
- package/dist/ionic/p-6bffc700.entry.js +0 -4
- package/dist/ionic/p-BYtS2rae.js +0 -4
- package/dist/ionic/p-Dr3N4o63.js +0 -4
- package/dist/ionic/p-c3335fe0.entry.js +0 -4
- package/dist/ionic/p-ef0c281a.entry.js +0 -4
- package/dist/types/utils/select-option-render.d.ts +0 -26
|
@@ -7,16 +7,16 @@ import { clamp, getElementRoot, raf } from "../../../utils/helpers";
|
|
|
7
7
|
import { FOCUS_TRAP_DISABLE_CLASS } from "../../../utils/overlays";
|
|
8
8
|
import { getBackdropValueForSheet } from "../utils";
|
|
9
9
|
import { calculateSpringStep, handleCanDismiss } from "./utils";
|
|
10
|
-
export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange,
|
|
10
|
+
export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange, isIonicTheme, onDragStart, onDragMove, onDragEnd) => {
|
|
11
11
|
// Defaults for the sheet swipe animation
|
|
12
12
|
const defaultBackdrop = [
|
|
13
13
|
{ offset: 0, opacity: 'var(--backdrop-opacity)' },
|
|
14
|
-
{ offset: 1, opacity:
|
|
14
|
+
{ offset: 1, opacity: isIonicTheme ? 'var(--backdrop-opacity)' : 0.01 },
|
|
15
15
|
];
|
|
16
16
|
const customBackdrop = [
|
|
17
17
|
{ offset: 0, opacity: 'var(--backdrop-opacity)' },
|
|
18
|
-
{ offset: 1 - backdropBreakpoint, opacity:
|
|
19
|
-
{ offset: 1, opacity:
|
|
18
|
+
{ offset: 1 - backdropBreakpoint, opacity: isIonicTheme ? 'var(--backdrop-opacity)' : 0 },
|
|
19
|
+
{ offset: 1, opacity: isIonicTheme ? 'var(--backdrop-opacity)' : 0 },
|
|
20
20
|
];
|
|
21
21
|
const SheetDefaults = {
|
|
22
22
|
WRAPPER_KEYFRAMES: [
|
|
@@ -339,7 +339,9 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
339
339
|
: step;
|
|
340
340
|
offset = clamp(0.0001, processedStep, maxStep);
|
|
341
341
|
animation.progressStep(offset);
|
|
342
|
-
const snapBreakpoint =
|
|
342
|
+
const snapBreakpoint = isIonicTheme
|
|
343
|
+
? calculateIonicSnapBreakpoint(detail.deltaY, detail.velocityY, detail.currentY)
|
|
344
|
+
: calculateSnapBreakpoint(detail.deltaY);
|
|
343
345
|
const eventDetail = {
|
|
344
346
|
currentY: detail.currentY,
|
|
345
347
|
deltaY: detail.deltaY,
|
|
@@ -350,7 +352,9 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
350
352
|
onDragMove(eventDetail);
|
|
351
353
|
};
|
|
352
354
|
const onEnd = (detail) => {
|
|
353
|
-
const snapBreakpoint =
|
|
355
|
+
const snapBreakpoint = isIonicTheme
|
|
356
|
+
? calculateIonicSnapBreakpoint(detail.deltaY, detail.velocityY, detail.currentY)
|
|
357
|
+
: calculateSnapBreakpoint(detail.deltaY);
|
|
354
358
|
const eventDetail = {
|
|
355
359
|
currentY: detail.currentY,
|
|
356
360
|
deltaY: detail.deltaY,
|
|
@@ -397,6 +401,14 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
397
401
|
*/
|
|
398
402
|
const shouldPreventDismiss = canDismiss && breakpoint === 0;
|
|
399
403
|
const snapToBreakpoint = shouldPreventDismiss ? currentBreakpoint : breakpoint;
|
|
404
|
+
/**
|
|
405
|
+
* Detect snap-back behavior: when the snap target is the same as the current breakpoint,
|
|
406
|
+
* the user released before crossing the threshold to a new breakpoint.
|
|
407
|
+
* Apply different timing and easing for snap-back vs. snap-to-new.
|
|
408
|
+
*/
|
|
409
|
+
const isSnapBack = snapToBreakpoint === currentBreakpoint;
|
|
410
|
+
const duration = isIonicTheme ? (isSnapBack ? 300 : 400) : 500;
|
|
411
|
+
const easing = isSnapBack ? 'cubic-bezier(0.34, 1.4, 0.64, 1)' : 'cubic-bezier(0.32, 0.68, 0, 1)';
|
|
400
412
|
const shouldRemainOpen = snapToBreakpoint !== 0;
|
|
401
413
|
currentBreakpoint = 0;
|
|
402
414
|
/**
|
|
@@ -411,13 +423,13 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
411
423
|
backdropAnimation.keyframes([
|
|
412
424
|
{
|
|
413
425
|
offset: 0,
|
|
414
|
-
opacity:
|
|
426
|
+
opacity: isIonicTheme
|
|
415
427
|
? 'var(--backdrop-opacity)'
|
|
416
428
|
: `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(1 - breakpointOffset, backdropBreakpoint)})`,
|
|
417
429
|
},
|
|
418
430
|
{
|
|
419
431
|
offset: 1,
|
|
420
|
-
opacity:
|
|
432
|
+
opacity: isIonicTheme
|
|
421
433
|
? 'var(--backdrop-opacity)'
|
|
422
434
|
: `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(snapToBreakpoint, backdropBreakpoint)})`,
|
|
423
435
|
},
|
|
@@ -437,6 +449,12 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
437
449
|
}
|
|
438
450
|
animation.progressStep(0);
|
|
439
451
|
}
|
|
452
|
+
/**
|
|
453
|
+
* Apply the appropriate easing curve for this snap behavior.
|
|
454
|
+
*/
|
|
455
|
+
if (isIonicTheme) {
|
|
456
|
+
animation.easing(easing);
|
|
457
|
+
}
|
|
440
458
|
/**
|
|
441
459
|
* Gesture should remain disabled until the
|
|
442
460
|
* snapping animation completes.
|
|
@@ -526,7 +544,7 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
526
544
|
* be added every time onEnd runs.
|
|
527
545
|
*/
|
|
528
546
|
}, { oneTimeCallback: true })
|
|
529
|
-
.progressEnd(1, 0, animated ?
|
|
547
|
+
.progressEnd(1, 0, animated ? duration : 0);
|
|
530
548
|
});
|
|
531
549
|
};
|
|
532
550
|
/**
|
|
@@ -557,6 +575,50 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
557
575
|
});
|
|
558
576
|
return snapBreakpoint;
|
|
559
577
|
};
|
|
578
|
+
/**
|
|
579
|
+
* Calculates the Ionic-specific snap breakpoint using velocity-based logic.
|
|
580
|
+
* This provides a more intuitive and responsive sheet behavior for the Ionic theme.
|
|
581
|
+
*
|
|
582
|
+
* Rules:
|
|
583
|
+
* 1. Fast downward flick (> 500 px/s) always dismisses, regardless of position
|
|
584
|
+
* 2. Fast upward flick (> 400 px/s) snaps to the next breakpoint above
|
|
585
|
+
* 3. If dragged 40% below current snap point without fast upward flick, dismisses
|
|
586
|
+
* 4. Otherwise, falls back to position-based snap (closest breakpoint)
|
|
587
|
+
*
|
|
588
|
+
* @param deltaY The change in Y position since gesture started
|
|
589
|
+
* @param velocityY The velocity in pixels per millisecond
|
|
590
|
+
* @param currentY The current Y position of the gesture
|
|
591
|
+
* @returns The snap breakpoint value
|
|
592
|
+
*/
|
|
593
|
+
const calculateIonicSnapBreakpoint = (deltaY, velocityY, currentY) => {
|
|
594
|
+
// Convert velocity from px/ms to px/s for easier threshold comparison
|
|
595
|
+
const velocityYPerSecond = velocityY * 1000;
|
|
596
|
+
// Calculate current progress (0 = fully closed, 1 = fully expanded)
|
|
597
|
+
const currentProgress = calculateProgress(currentY);
|
|
598
|
+
// Rule 1: Fast downward flick always dismisses
|
|
599
|
+
if (velocityYPerSecond > 500) {
|
|
600
|
+
return minBreakpoint;
|
|
601
|
+
}
|
|
602
|
+
// Rule 2: Fast upward flick moves to next breakpoint above
|
|
603
|
+
if (velocityYPerSecond < -400) {
|
|
604
|
+
// Find next breakpoint above current position
|
|
605
|
+
const nextBreakpoint = breakpoints.find((bp) => bp > currentProgress);
|
|
606
|
+
// If no breakpoint above, stay at max breakpoint
|
|
607
|
+
return nextBreakpoint !== null && nextBreakpoint !== void 0 ? nextBreakpoint : maxBreakpoint;
|
|
608
|
+
}
|
|
609
|
+
// Rule 3: 40% dismissal rule (only if not flicking up and 0 breakpoint exists)
|
|
610
|
+
if (minBreakpoint === 0 && currentBreakpoint > 0) {
|
|
611
|
+
// Calculate how far we've moved below the current snap point
|
|
612
|
+
const distanceBelowSnap = currentBreakpoint - currentProgress;
|
|
613
|
+
const percentageBelowSnap = distanceBelowSnap / currentBreakpoint;
|
|
614
|
+
// If dragged more than 40% below and not flicking up, dismiss
|
|
615
|
+
if (percentageBelowSnap > 0.4 && velocityYPerSecond <= 400) {
|
|
616
|
+
return 0;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
// Rule 4: Fallback to position-based snap (existing logic)
|
|
620
|
+
return calculateSnapBreakpoint(deltaY);
|
|
621
|
+
};
|
|
560
622
|
/**
|
|
561
623
|
* Calculates the progress of the swipe gesture.
|
|
562
624
|
*
|
|
@@ -191,7 +191,7 @@ ion-backdrop {
|
|
|
191
191
|
:host {
|
|
192
192
|
--background: var(--token-bg-surface-default, var(--token-primitives-base-white, #ffffff));
|
|
193
193
|
--box-shadow: var(--token-elevation-3, 0px 2px 7px 0px rgba(0, 0, 0, 0.05), 0px 6px 32px 0px rgba(0, 0, 0, 0.16));
|
|
194
|
-
--backdrop-opacity:
|
|
194
|
+
--backdrop-opacity: 0.7;
|
|
195
195
|
color: var(--token-text-default, var(--token-primitives-neutral-1200, #242424));
|
|
196
196
|
}
|
|
197
197
|
|
|
@@ -14,6 +14,7 @@ import { deepReady, waitForMount } from "../../utils/transition/index";
|
|
|
14
14
|
import { config } from "../../global/config";
|
|
15
15
|
import { getIonMode, getIonTheme } from "../../global/ionic-global";
|
|
16
16
|
import { KEYBOARD_DID_OPEN } from "../../utils/keyboard/keyboard";
|
|
17
|
+
import { ionicEnterAnimation } from "./animations/ionic.enter";
|
|
17
18
|
import { iosEnterAnimation } from "./animations/ios.enter";
|
|
18
19
|
import { iosLeaveAnimation } from "./animations/ios.leave";
|
|
19
20
|
import { portraitToLandscapeTransition, landscapeToPortraitTransition } from "./animations/ios.transition";
|
|
@@ -454,7 +455,7 @@ export class Modal {
|
|
|
454
455
|
this.statusBarStyle = await StatusBar.getStyle();
|
|
455
456
|
setCardStatusBarDark();
|
|
456
457
|
}
|
|
457
|
-
await present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {
|
|
458
|
+
await present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, ionicEnterAnimation, {
|
|
458
459
|
presentingEl: presentingElement,
|
|
459
460
|
currentBreakpoint: this.initialBreakpoint,
|
|
460
461
|
backdropBreakpoint: this.backdropBreakpoint,
|
|
@@ -1149,20 +1150,20 @@ export class Modal {
|
|
|
1149
1150
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
1150
1151
|
const shape = this.getShape();
|
|
1151
1152
|
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
1152
|
-
return (h(Host, Object.assign({ key: '
|
|
1153
|
+
return (h(Host, Object.assign({ key: '3011c8f49c1ccb6c20c01db35b59fe4f6e22ec01', "no-router": true,
|
|
1153
1154
|
// Allow the modal to be navigable when the handle is focusable
|
|
1154
1155
|
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
1155
1156
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
1156
|
-
}, class: Object.assign({ [theme]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-${shape}`]: shape !== undefined, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), h("ion-backdrop", { key: '
|
|
1157
|
+
}, class: Object.assign({ [theme]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-${shape}`]: shape !== undefined, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), h("ion-backdrop", { key: 'ab99fb4ff1b335b06d5676890012dfe3cd1a1a01', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), theme === 'ios' && h("div", { key: '95d4c79c4455c6a5ae6d581fa9dfaabdbee8c567', class: "modal-shadow" }), h("div", Object.assign({ key: '2d7d2406cdb986c69ef52708d33eca67d8a877f8',
|
|
1157
1158
|
/*
|
|
1158
1159
|
role and aria-modal must be used on the
|
|
1159
1160
|
same element. They must also be set inside the
|
|
1160
1161
|
shadow DOM otherwise ion-button will not be highlighted
|
|
1161
1162
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
1162
1163
|
*/
|
|
1163
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: '
|
|
1164
|
+
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: 'ccec8bfc314763bd6dd868b69fbfdc085f5957c9', class: "modal-handle",
|
|
1164
1165
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
1165
|
-
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) })), h("slot", { key: '
|
|
1166
|
+
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) })), h("slot", { key: '38469e3447b46983783627d697e12cadcef614fa', onSlotchange: this.onSlotChange }))));
|
|
1166
1167
|
}
|
|
1167
1168
|
static get is() { return "ion-modal"; }
|
|
1168
1169
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { createAnimation } from "../../../utils/animation/animation";
|
|
5
|
+
/**
|
|
6
|
+
* Ionic Picker Enter Animation
|
|
7
|
+
*/
|
|
8
|
+
export const ionicEnterAnimation = (baseEl) => {
|
|
9
|
+
const baseAnimation = createAnimation();
|
|
10
|
+
const backdropAnimation = createAnimation();
|
|
11
|
+
const wrapperAnimation = createAnimation();
|
|
12
|
+
backdropAnimation
|
|
13
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
14
|
+
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
|
15
|
+
.beforeStyles({
|
|
16
|
+
'pointer-events': 'none',
|
|
17
|
+
})
|
|
18
|
+
.afterClearStyles(['pointer-events']);
|
|
19
|
+
wrapperAnimation
|
|
20
|
+
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
21
|
+
.fromTo('transform', 'translateY(100%)', 'translateY(0%)');
|
|
22
|
+
return baseAnimation
|
|
23
|
+
.addElement(baseEl)
|
|
24
|
+
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
25
|
+
.duration(400)
|
|
26
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
27
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { createAnimation } from "../../../utils/animation/animation";
|
|
5
|
+
/**
|
|
6
|
+
* iOS Picker Leave Animation
|
|
7
|
+
*/
|
|
8
|
+
export const ionicLeaveAnimation = (baseEl) => {
|
|
9
|
+
const baseAnimation = createAnimation();
|
|
10
|
+
const backdropAnimation = createAnimation();
|
|
11
|
+
const wrapperAnimation = createAnimation();
|
|
12
|
+
backdropAnimation
|
|
13
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
14
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 0.01);
|
|
15
|
+
wrapperAnimation
|
|
16
|
+
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
17
|
+
.fromTo('transform', 'translateY(0%)', 'translateY(100%)');
|
|
18
|
+
return baseAnimation
|
|
19
|
+
.addElement(baseEl)
|
|
20
|
+
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
21
|
+
.duration(400)
|
|
22
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
23
|
+
};
|
|
@@ -8,6 +8,7 @@ import { printIonWarning } from "../../utils/logging/index";
|
|
|
8
8
|
import { createDelegateController, createTriggerController, BACKDROP, dismiss, eventMethod, isCancel, prepareOverlay, present, safeCall, setOverlayId, } from "../../utils/overlays";
|
|
9
9
|
import { getClassMap } from "../../utils/theme";
|
|
10
10
|
import { getIonTheme } from "../../global/ionic-global";
|
|
11
|
+
import { ionicEnterAnimation } from "./animations/ionic.enter";
|
|
11
12
|
import { iosEnterAnimation } from "./animations/ios.enter";
|
|
12
13
|
import { iosLeaveAnimation } from "./animations/ios.leave";
|
|
13
14
|
// TODO(FW-2832): types
|
|
@@ -123,7 +124,7 @@ export class Picker {
|
|
|
123
124
|
async present() {
|
|
124
125
|
const unlock = await this.lockController.lock();
|
|
125
126
|
await this.delegateController.attachViewToDom();
|
|
126
|
-
await present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
|
|
127
|
+
await present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, ionicEnterAnimation, undefined);
|
|
127
128
|
if (this.duration > 0) {
|
|
128
129
|
this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
|
|
129
130
|
}
|
|
@@ -208,11 +209,11 @@ export class Picker {
|
|
|
208
209
|
render() {
|
|
209
210
|
const { htmlAttributes } = this;
|
|
210
211
|
const theme = getIonTheme(this);
|
|
211
|
-
return (h(Host, Object.assign({ key: '
|
|
212
|
+
return (h(Host, Object.assign({ key: '8db0e1a6cb7697efcc5d5a4a80f3dc3435760c1d', "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
|
|
212
213
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
213
214
|
}, class: Object.assign({ [theme]: true,
|
|
214
215
|
// Used internally for styling
|
|
215
|
-
[`picker-${theme}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), h("ion-backdrop", { key: '
|
|
216
|
+
[`picker-${theme}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), h("ion-backdrop", { key: 'c32c446147dff1e8b53fcf6885bdaa504d134d06', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: '87c9eeeed6869569b0da65d720289f14f76d0cba', tabindex: "0", "aria-hidden": "true" }), h("div", { key: '17a1250e5ce1dc176a39d7480587c56aa11f0247', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, h("div", { key: '4d4043aae3373d2f271e8e1320ba72f726eb2338', class: "picker-toolbar" }, this.buttons.map((b) => (h("div", { class: buttonWrapperClass(b) }, h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), h("div", { key: '954edc5d83380d04025ec8029194ad0f9c6778ff', class: "picker-columns" }, h("div", { key: 'f3c7f7bbb784b8076eebe984e7dd057d78c9824f', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => h("ion-picker-legacy-column", { col: c })), h("div", { key: '63dcf6a252024984cb3eaca133805343b324fdb1', class: "picker-below-highlight" }))), h("div", { key: 'e07eb1a59edf5d94fc487114c2d8b923fd768696', tabindex: "0", "aria-hidden": "true" })));
|
|
216
217
|
}
|
|
217
218
|
static get is() { return "ion-picker-legacy"; }
|
|
218
219
|
static get encapsulation() { return "scoped"; }
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { createAnimation } from "../../../utils/animation/animation";
|
|
5
|
+
import { getElementRoot } from "../../../utils/helpers";
|
|
6
|
+
import { calculateWindowAdjustment, getPopoverDimensions, getPopoverPosition, getSafeAreaInsets } from "../utils";
|
|
7
|
+
const POPOVER_MD_BODY_PADDING = 12;
|
|
8
|
+
/**
|
|
9
|
+
* Ionic Popover Enter Animation
|
|
10
|
+
*/
|
|
11
|
+
// TODO(FW-2832): types
|
|
12
|
+
export const ionicEnterAnimation = (baseEl, opts) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const { event: ev, size, trigger, reference, side, align } = opts;
|
|
15
|
+
const doc = baseEl.ownerDocument;
|
|
16
|
+
const isRTL = doc.dir === 'rtl';
|
|
17
|
+
const bodyWidth = doc.defaultView.innerWidth;
|
|
18
|
+
const bodyHeight = doc.defaultView.innerHeight;
|
|
19
|
+
const root = getElementRoot(baseEl);
|
|
20
|
+
const contentEl = root.querySelector('.popover-content');
|
|
21
|
+
const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target);
|
|
22
|
+
const { contentWidth, contentHeight } = getPopoverDimensions(size, contentEl, referenceSizeEl);
|
|
23
|
+
const defaultPosition = {
|
|
24
|
+
top: bodyHeight / 2 - contentHeight / 2,
|
|
25
|
+
left: bodyWidth / 2 - contentWidth / 2,
|
|
26
|
+
originX: isRTL ? 'right' : 'left',
|
|
27
|
+
originY: 'top',
|
|
28
|
+
};
|
|
29
|
+
const results = getPopoverPosition(isRTL, contentWidth, contentHeight, 0, 0, reference, side, align, defaultPosition, trigger, ev);
|
|
30
|
+
const padding = size === 'cover' ? 0 : POPOVER_MD_BODY_PADDING;
|
|
31
|
+
// MD mode now applies safe-area insets (previously passed 0, ignoring all safe areas).
|
|
32
|
+
// This is needed for Android edge-to-edge (API 36+) where system bars overlap content.
|
|
33
|
+
const safeArea = size === 'cover' ? { top: 0, bottom: 0, left: 0, right: 0 } : getSafeAreaInsets(doc);
|
|
34
|
+
const { originX, originY, top, left, bottom, checkSafeAreaLeft, checkSafeAreaRight, checkSafeAreaTop, checkSafeAreaBottom, addPopoverBottomClass, } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, safeArea, results.originX, results.originY, results.referenceCoordinates);
|
|
35
|
+
const safeAreaLeftCalc = ' + var(--ion-safe-area-left, 0px)';
|
|
36
|
+
const safeAreaRightCalc = ' - var(--ion-safe-area-right, 0px)';
|
|
37
|
+
let leftValue = `${left}px`;
|
|
38
|
+
if (checkSafeAreaLeft) {
|
|
39
|
+
leftValue = `${left}px${safeAreaLeftCalc}`;
|
|
40
|
+
}
|
|
41
|
+
if (checkSafeAreaRight) {
|
|
42
|
+
leftValue = `${left}px${safeAreaRightCalc}`;
|
|
43
|
+
}
|
|
44
|
+
let topValue = `${top}px`;
|
|
45
|
+
if (checkSafeAreaTop) {
|
|
46
|
+
topValue = `${top}px + var(--ion-safe-area-top, 0px)`;
|
|
47
|
+
}
|
|
48
|
+
const baseAnimation = createAnimation();
|
|
49
|
+
const backdropAnimation = createAnimation();
|
|
50
|
+
const wrapperAnimation = createAnimation();
|
|
51
|
+
const contentAnimation = createAnimation();
|
|
52
|
+
const viewportAnimation = createAnimation();
|
|
53
|
+
backdropAnimation
|
|
54
|
+
.addElement(root.querySelector('ion-backdrop'))
|
|
55
|
+
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
|
56
|
+
.beforeStyles({
|
|
57
|
+
'pointer-events': 'none',
|
|
58
|
+
})
|
|
59
|
+
.afterClearStyles(['pointer-events']);
|
|
60
|
+
wrapperAnimation.addElement(root.querySelector('.popover-wrapper')).duration(150).fromTo('opacity', 0.01, 1);
|
|
61
|
+
contentAnimation
|
|
62
|
+
.addElement(contentEl)
|
|
63
|
+
.beforeStyles({
|
|
64
|
+
top: `calc(${topValue} + var(--offset-y, 0px))`,
|
|
65
|
+
left: `calc(${leftValue} + var(--offset-x, 0px))`,
|
|
66
|
+
'transform-origin': `${originY} ${originX}`,
|
|
67
|
+
})
|
|
68
|
+
.beforeAddWrite(() => {
|
|
69
|
+
if (bottom !== undefined) {
|
|
70
|
+
let bottomValue = `${bottom}px`;
|
|
71
|
+
if (checkSafeAreaBottom) {
|
|
72
|
+
bottomValue = `${bottom}px + var(--ion-safe-area-bottom, 0px)`;
|
|
73
|
+
}
|
|
74
|
+
contentEl.style.setProperty('bottom', `calc(${bottomValue})`);
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
.fromTo('transform', 'scale(0.8)', 'scale(1)');
|
|
78
|
+
viewportAnimation.addElement(root.querySelector('.popover-viewport')).fromTo('opacity', 0.01, 1);
|
|
79
|
+
return baseAnimation
|
|
80
|
+
.easing('cubic-bezier(0.36,0.66,0.04,1)')
|
|
81
|
+
.duration(300)
|
|
82
|
+
.beforeAddWrite(() => {
|
|
83
|
+
if (size === 'cover') {
|
|
84
|
+
baseEl.style.setProperty('--width', `${contentWidth}px`);
|
|
85
|
+
}
|
|
86
|
+
if (addPopoverBottomClass) {
|
|
87
|
+
baseEl.classList.add('popover-bottom');
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
.addAnimation([backdropAnimation, wrapperAnimation, contentAnimation, viewportAnimation]);
|
|
91
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { createAnimation } from "../../../utils/animation/animation";
|
|
5
|
+
import { getElementRoot } from "../../../utils/helpers";
|
|
6
|
+
/**
|
|
7
|
+
* Ionic Popover Leave Animation
|
|
8
|
+
*/
|
|
9
|
+
export const ionicLeaveAnimation = (baseEl) => {
|
|
10
|
+
const root = getElementRoot(baseEl);
|
|
11
|
+
const contentEl = root.querySelector('.popover-content');
|
|
12
|
+
const baseAnimation = createAnimation();
|
|
13
|
+
const backdropAnimation = createAnimation();
|
|
14
|
+
const wrapperAnimation = createAnimation();
|
|
15
|
+
backdropAnimation.addElement(root.querySelector('ion-backdrop')).fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
|
16
|
+
wrapperAnimation.addElement(root.querySelector('.popover-wrapper')).fromTo('opacity', 0.99, 0);
|
|
17
|
+
return baseAnimation
|
|
18
|
+
.easing('ease')
|
|
19
|
+
.afterAddWrite(() => {
|
|
20
|
+
baseEl.style.removeProperty('--width');
|
|
21
|
+
baseEl.classList.remove('popover-bottom');
|
|
22
|
+
contentEl.style.removeProperty('top');
|
|
23
|
+
contentEl.style.removeProperty('left');
|
|
24
|
+
contentEl.style.removeProperty('bottom');
|
|
25
|
+
contentEl.style.removeProperty('transform-origin');
|
|
26
|
+
})
|
|
27
|
+
.duration(150)
|
|
28
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
29
|
+
};
|
|
@@ -12,6 +12,7 @@ import { isPlatform } from "../../utils/platform";
|
|
|
12
12
|
import { getClassMap } from "../../utils/theme";
|
|
13
13
|
import { deepReady, waitForMount } from "../../utils/transition/index";
|
|
14
14
|
import { getIonTheme } from "../../global/ionic-global";
|
|
15
|
+
import { ionicEnterAnimation } from "./animations/ionic.enter";
|
|
15
16
|
import { iosEnterAnimation } from "./animations/ios.enter";
|
|
16
17
|
import { iosLeaveAnimation } from "./animations/ios.leave";
|
|
17
18
|
import { mdEnterAnimation } from "./animations/md.enter";
|
|
@@ -359,7 +360,7 @@ export class Popover {
|
|
|
359
360
|
else if (!this.keepContentsMounted) {
|
|
360
361
|
await waitForMount();
|
|
361
362
|
}
|
|
362
|
-
await present(this, 'popoverEnter', iosEnterAnimation, mdEnterAnimation, {
|
|
363
|
+
await present(this, 'popoverEnter', iosEnterAnimation, mdEnterAnimation, ionicEnterAnimation, {
|
|
363
364
|
event: event || this.event,
|
|
364
365
|
size: this.size,
|
|
365
366
|
trigger: this.triggerEl,
|
|
@@ -468,9 +469,9 @@ export class Popover {
|
|
|
468
469
|
const { onLifecycle, parentPopover, dismissOnSelect, side, arrow, htmlAttributes, focusTrap } = this;
|
|
469
470
|
const desktop = isPlatform('desktop');
|
|
470
471
|
const enableArrow = arrow && !parentPopover;
|
|
471
|
-
return (h(Host, Object.assign({ key: '
|
|
472
|
+
return (h(Host, Object.assign({ key: '398b4c72cfea89fb743d427e3c2b48507649aff1', "aria-modal": "true", "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
|
|
472
473
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
473
|
-
}, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [theme]: true, 'popover-translucent': this.translucent, 'overlay-hidden': true, 'popover-desktop': desktop, [`popover-side-${side}`]: true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false, 'popover-nested': !!parentPopover }), onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }), !parentPopover && h("ion-backdrop", { key: '
|
|
474
|
+
}, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [theme]: true, 'popover-translucent': this.translucent, 'overlay-hidden': true, 'popover-desktop': desktop, [`popover-side-${side}`]: true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false, 'popover-nested': !!parentPopover }), onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }), !parentPopover && h("ion-backdrop", { key: '6baec0b33665557c55425ffad9c6b31741c25651', tappable: this.backdropDismiss, visible: this.showBackdrop, part: "backdrop" }), h("div", { key: '6ce3a61164f478560cc45c618fc5b7f62b491ecd', class: "popover-wrapper ion-overlay-wrapper", onClick: dismissOnSelect ? () => this.dismiss() : undefined }, enableArrow && h("div", { key: 'a36815fc0417a10fb350429909a79cb4025baf3a', class: "popover-arrow", part: "arrow" }), h("div", { key: 'cec3436cdb2cb6fa839c37abb3cb6daf7de453de', class: "popover-content", part: "content" }, h("slot", { key: '5405fb03bab017acd7fa09d00cfe1b7cfbdfae92' })))));
|
|
474
475
|
}
|
|
475
476
|
static get is() { return "ion-popover"; }
|
|
476
477
|
static get encapsulation() { return "shadow"; }
|
|
@@ -81,13 +81,6 @@
|
|
|
81
81
|
* @prop --border-width: Width of the select border
|
|
82
82
|
*
|
|
83
83
|
* @prop --ripple-color: The color of the ripple effect on MD mode.
|
|
84
|
-
*
|
|
85
|
-
* @prop --select-text-media-width: The width of media (icons/images) in the select text.
|
|
86
|
-
* @prop --select-text-media-height: The height of media (icons/images) in the select text.
|
|
87
|
-
* @prop --select-text-media-border-width: The border width of media (icons/images) in the select text.
|
|
88
|
-
* @prop --select-text-media-border-color: The border color of media (icons/images) in the select text.
|
|
89
|
-
* @prop --select-text-media-border-radius: The border radius of media (icons/images) in the select text.
|
|
90
|
-
* @prop --select-text-media-border-style: The border style of media (icons/images) in the select text.
|
|
91
84
|
*/
|
|
92
85
|
--padding-top: 0px;
|
|
93
86
|
--padding-end: 0px;
|
|
@@ -99,8 +92,6 @@
|
|
|
99
92
|
--highlight-color-focused: ion-color(primary, base);
|
|
100
93
|
--highlight-color-valid: ion-color(success, base);
|
|
101
94
|
--highlight-color-invalid: ion-color(danger, base);
|
|
102
|
-
--select-text-media-height: 1.5em;
|
|
103
|
-
--select-text-media-width: 1.5em;
|
|
104
95
|
/**
|
|
105
96
|
* This is a private API that is used to switch
|
|
106
97
|
* out the highlight color based on the state
|
|
@@ -205,19 +196,6 @@ button {
|
|
|
205
196
|
overflow: hidden;
|
|
206
197
|
}
|
|
207
198
|
|
|
208
|
-
.select-text img,
|
|
209
|
-
.select-text ion-img,
|
|
210
|
-
.select-text ion-icon,
|
|
211
|
-
.select-text ion-thumbnail,
|
|
212
|
-
.select-text ion-avatar {
|
|
213
|
-
border-radius: var(--select-text-media-border-radius);
|
|
214
|
-
width: var(--select-text-media-width);
|
|
215
|
-
height: var(--select-text-media-height);
|
|
216
|
-
border-width: var(--select-text-media-border-width);
|
|
217
|
-
border-style: var(--select-text-media-border-style);
|
|
218
|
-
border-color: var(--select-text-media-border-color);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
199
|
.select-wrapper {
|
|
222
200
|
display: flex;
|
|
223
201
|
position: relative;
|
|
@@ -589,15 +567,6 @@ button {
|
|
|
589
567
|
color: var(--token-text-default, var(--token-primitives-neutral-1200, #242424));
|
|
590
568
|
}
|
|
591
569
|
|
|
592
|
-
/**
|
|
593
|
-
* If the select text contains rich content, we want to add some
|
|
594
|
-
* spacing between the items without changing the display to prevent
|
|
595
|
-
* losing the ellipsis behavior.
|
|
596
|
-
*/
|
|
597
|
-
.select-text > * {
|
|
598
|
-
margin-inline-start: var(--token-space-200, var(--token-scale-200, 8px));
|
|
599
|
-
}
|
|
600
|
-
|
|
601
570
|
.label-text-wrapper {
|
|
602
571
|
font-size: var(--token-font-size-300, 0.75rem);
|
|
603
572
|
font-weight: var(--token-font-weight-medium, 500);
|
|
@@ -103,13 +103,6 @@
|
|
|
103
103
|
* @prop --border-width: Width of the select border
|
|
104
104
|
*
|
|
105
105
|
* @prop --ripple-color: The color of the ripple effect on MD mode.
|
|
106
|
-
*
|
|
107
|
-
* @prop --select-text-media-width: The width of media (icons/images) in the select text.
|
|
108
|
-
* @prop --select-text-media-height: The height of media (icons/images) in the select text.
|
|
109
|
-
* @prop --select-text-media-border-width: The border width of media (icons/images) in the select text.
|
|
110
|
-
* @prop --select-text-media-border-color: The border color of media (icons/images) in the select text.
|
|
111
|
-
* @prop --select-text-media-border-radius: The border radius of media (icons/images) in the select text.
|
|
112
|
-
* @prop --select-text-media-border-style: The border style of media (icons/images) in the select text.
|
|
113
106
|
*/
|
|
114
107
|
--padding-top: 0px;
|
|
115
108
|
--padding-end: 0px;
|
|
@@ -121,8 +114,6 @@
|
|
|
121
114
|
--highlight-color-focused: var(--ion-color-primary, #0054e9);
|
|
122
115
|
--highlight-color-valid: var(--ion-color-success, #2dd55b);
|
|
123
116
|
--highlight-color-invalid: var(--ion-color-danger, #c5000f);
|
|
124
|
-
--select-text-media-height: 1.5em;
|
|
125
|
-
--select-text-media-width: 1.5em;
|
|
126
117
|
/**
|
|
127
118
|
* This is a private API that is used to switch
|
|
128
119
|
* out the highlight color based on the state
|
|
@@ -227,19 +218,6 @@ button {
|
|
|
227
218
|
overflow: hidden;
|
|
228
219
|
}
|
|
229
220
|
|
|
230
|
-
.select-text img,
|
|
231
|
-
.select-text ion-img,
|
|
232
|
-
.select-text ion-icon,
|
|
233
|
-
.select-text ion-thumbnail,
|
|
234
|
-
.select-text ion-avatar {
|
|
235
|
-
border-radius: var(--select-text-media-border-radius);
|
|
236
|
-
width: var(--select-text-media-width);
|
|
237
|
-
height: var(--select-text-media-height);
|
|
238
|
-
border-width: var(--select-text-media-border-width);
|
|
239
|
-
border-style: var(--select-text-media-border-style);
|
|
240
|
-
border-color: var(--select-text-media-border-color);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
221
|
.select-wrapper {
|
|
244
222
|
display: flex;
|
|
245
223
|
position: relative;
|
|
@@ -641,15 +619,6 @@ button {
|
|
|
641
619
|
min-width: 16px;
|
|
642
620
|
}
|
|
643
621
|
|
|
644
|
-
/**
|
|
645
|
-
* If the select text contains rich content, we want to add some
|
|
646
|
-
* spacing between the items without changing the display to prevent
|
|
647
|
-
* losing the ellipsis behavior.
|
|
648
|
-
*/
|
|
649
|
-
.select-text > * {
|
|
650
|
-
margin-inline-start: 8px;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
622
|
.label-text-wrapper {
|
|
654
623
|
/**
|
|
655
624
|
* Label text should not extend
|