Skip to content

Commit d38e734

Browse files
committed
docs(modal): add type import and cleanup
1 parent 6950b0e commit d38e734

13 files changed

Lines changed: 30 additions & 24 deletions

File tree

static/code/stackblitz/v8/angular/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"@angular/platform-browser": "^20.0.0",
1616
"@angular/platform-browser-dynamic": "^20.0.0",
1717
"@angular/router": "^20.0.0",
18-
"@ionic/angular": "8.7.14",
19-
"@ionic/core": "8.7.14",
18+
"@ionic/angular": "8.7.17-dev.11772030258.1ee4f499",
19+
"@ionic/core": "8.7.17-dev.11772030258.1ee4f499",
2020
"ionicons": "8.0.13",
2121
"rxjs": "^7.8.1",
2222
"tslib": "^2.5.0",

static/code/stackblitz/v8/html/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"start": "vite preview"
1010
},
1111
"dependencies": {
12-
"@ionic/core": "8.7.14",
12+
"@ionic/core": "8.7.17-dev.11772030258.1ee4f499",
1313
"ionicons": "8.0.13"
1414
},
1515
"devDependencies": {

static/code/stackblitz/v8/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@ionic/react": "8.7.14",
7-
"@ionic/react-router": "8.7.14",
6+
"@ionic/react": "8.7.17-dev.11772030258.1ee4f499",
7+
"@ionic/react-router": "8.7.17-dev.11772030258.1ee4f499",
88
"@types/node": "^24.0.0",
99
"@types/react": "^19.0.0",
1010
"@types/react-dom": "^19.0.0",

static/code/stackblitz/v8/vue/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"preview": "vite preview"
99
},
1010
"dependencies": {
11-
"@ionic/vue": "8.7.14",
12-
"@ionic/vue-router": "8.7.14",
11+
"@ionic/vue": "8.7.17-dev.11772030258.1ee4f499",
12+
"@ionic/vue-router": "8.7.17-dev.11772030258.1ee4f499",
1313
"vue": "^3.2.25",
1414
"vue-router": "5.0.1"
1515
},

static/usage/v8/modal/card/drag-events/angular/example_component_ts.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```ts
22
import { Component, ElementRef, ViewChild, OnInit } from '@angular/core';
33
import { IonHeader, IonToolbar, IonTitle, IonContent, IonButton, IonModal, IonLabel } from '@ionic/angular/standalone';
4+
import type { ModalDragEventDetail } from '@ionic/core';
45

56
@Component({
67
selector: 'app-example',
@@ -36,7 +37,7 @@ export class ExampleComponent implements OnInit {
3637
appEl.style.transition = 'none';
3738
}
3839

39-
onDragMove(event: any) {
40+
onDragMove(event: CustomEvent<ModalDragEventDetail>) {
4041
// `progress` is a value from 1 (top) to 0 (bottom)
4142
const { progress } = event.detail;
4243

@@ -54,7 +55,7 @@ export class ExampleComponent implements OnInit {
5455
appEl.style.setProperty('filter', `brightness(${brightnessValue}%)`, 'important');
5556
}
5657

57-
onDragEnd(event: any) {
58+
onDragEnd(event: CustomEvent<ModalDragEventDetail>) {
5859
// `progress` is a value from 1 (top) to 0 (bottom)
5960
const { progress } = event.detail;
6061

static/usage/v8/modal/card/drag-events/demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</ion-toolbar>
2121
</ion-header>
2222
<ion-content class="ion-padding">
23-
<ion-button id="open-modal" expand="block">Open Sheet Modal</ion-button>
23+
<ion-button id="open-modal" expand="block">Open Card Modal</ion-button>
2424

2525
<ion-modal trigger="open-modal">
2626
<ion-header>

static/usage/v8/modal/card/drag-events/javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</ion-toolbar>
77
</ion-header>
88
<ion-content class="ion-padding">
9-
<ion-button id="open-modal" expand="block">Open Sheet Modal</ion-button>
9+
<ion-button id="open-modal" expand="block">Open Card Modal</ion-button>
1010

1111
<ion-modal trigger="open-modal">
1212
<ion-header>

static/usage/v8/modal/card/drag-events/react.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```tsx
22
import React, { useRef, useState, useEffect } from 'react';
33
import { IonButton, IonModal, IonHeader, IonContent, IonToolbar, IonTitle, IonPage, IonLabel } from '@ionic/react';
4+
import type { ModalDragEventDetail } from '@ionic/react';
45

56
function Example() {
67
const modal = useRef<HTMLIonModalElement>(null);
@@ -26,7 +27,7 @@ function Example() {
2627
page.current!.style.transition = 'none';
2728
};
2829

29-
const onDragMove = (event: CustomEvent) => {
30+
const onDragMove = (event: CustomEvent<ModalDragEventDetail>) => {
3031
// `progress` is a value from 1 (top) to 0 (bottom)
3132
const { progress } = event.detail;
3233

@@ -43,7 +44,7 @@ function Example() {
4344
page.current!.style.setProperty('filter', `brightness(${brightnessValue}%)`, 'important');
4445
};
4546

46-
const onDragEnd = (event: CustomEvent) => {
47+
const onDragEnd = (event: CustomEvent<ModalDragEventDetail>) => {
4748
// `progress` is a value from 1 (top) to 0 (bottom)
4849
const { progress } = event.detail;
4950

static/usage/v8/modal/card/drag-events/vue.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@ionDragStart="onDragStart()"
1818
@ionDragMove="onDragMove($event)"
1919
@ionDragEnd="onDragEnd($event)"
20-
@willDismiss="onWillDismiss"
20+
@willDismiss="onWillDismiss()"
2121
>
2222
<ion-header>
2323
<ion-toolbar>
@@ -37,6 +37,7 @@
3737
<script setup lang="ts">
3838
import { ref, onMounted } from 'vue';
3939
import { IonPage, IonModal, IonHeader, IonToolbar, IonTitle, IonContent, IonButton, IonLabel } from '@ionic/vue';
40+
import type { ModalDragEventDetail } from '@ionic/vue';
4041
4142
const modal = ref();
4243
const page = ref<HTMLDivElement | null>(null);
@@ -67,7 +68,7 @@ const onDragStart = () => {
6768
appEl.style.transition = 'none';
6869
};
6970
70-
const onDragMove = (event: CustomEvent) => {
71+
const onDragMove = (event: CustomEvent<ModalDragEventDetail>) => {
7172
// `progress` is a value from 1 (top) to 0 (bottom)
7273
const { progress } = event.detail;
7374
@@ -85,7 +86,7 @@ const onDragMove = (event: CustomEvent) => {
8586
appEl.style.setProperty('filter', `brightness(${brightnessValue}%)`, 'important');
8687
};
8788
88-
const onDragEnd = (event: CustomEvent) => {
89+
const onDragEnd = (event: CustomEvent<ModalDragEventDetail>) => {
8990
// `progress` is a value from 1 (top) to 0 (bottom)
9091
const { progress } = event.detail;
9192

static/usage/v8/modal/sheet/drag-events/angular/example_component_html.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#modal
1212
trigger="open-modal"
1313
[initialBreakpoint]="0.25"
14-
[breakpoints]="[0, 0.25, 0.5, 0.75]"
14+
[breakpoints]="[0, 0.25, 0.5, 0.75, 1]"
1515
(ionDragStart)="onDragStart()"
1616
(ionDragMove)="onDragMove($event)"
1717
(ionDragEnd)="onDragEnd($event)"

0 commit comments

Comments
 (0)